GeezerVison is showing github.com — Merged master (with events -> legacy-events package rename) · react/react@44e4109
File treeExpand file treeCollapse file tree Open diff view settings fixtures/ssr/src/components eslint-plugin-react-hooks unstable-native-dependencies
react-native-renderer/src
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .circleci/config.yml -13Lines changed: 0 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 94 | 94 | - *run_yarn | 95 | 95 | - run: yarn test-prod --maxWorkers=2 | 96 | 96 |
| 97 | | - test_coverage: | 98 | | - docker: *docker | 99 | | - environment: *environment | 100 | | - | 101 | | - steps: | 102 | | - - checkout | 103 | | - - *restore_yarn_cache | 104 | | - - *run_yarn | 105 | | - - run: ./scripts/circleci/test_coverage.sh | 106 | | - | 107 | 97 | build: | 108 | 98 | docker: *docker | 109 | 99 | environment: *environment | @@ -257,6 +247,3 @@ workflows: | 257 | 247 | - test_fuzz: | 258 | 248 | requires: | 259 | 249 | - setup | 260 | | - - test_coverage: | 261 | | - requires: | 262 | | - - setup |
Collapse file Copy file name to clipboardExpand all lines: .eslintrc.js +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -129,6 +129,8 @@ module.exports = { | 129 | 129 | rules: { | 130 | 130 | // https://github.com/jest-community/eslint-plugin-jest | 131 | 131 | 'jest/no-focused-tests': ERROR, | | 132 | + 'jest/valid-expect': ERROR, | | 133 | + 'jest/valid-expect-in-promise': ERROR, | 132 | 134 | }, | 133 | 135 | }, | 134 | 136 | { | @@ -140,6 +142,8 @@ module.exports = { | 140 | 142 | ], | 141 | 143 |
| 142 | 144 | globals: { | | 145 | + SharedArrayBuffer: true, | | 146 | + | 143 | 147 | spyOnDev: true, | 144 | 148 | spyOnDevAndProd: true, | 145 | 149 | spyOnProd: true, | |
Collapse file Copy file name to clipboardExpand all lines: fixtures/ssr/src/components/Chrome.js +10-1Lines changed: 10 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,7 +26,16 @@ export default class Chrome extends Component { | 26 | 26 | <Theme.Provider value={this.state.theme}> | 27 | 27 | {this.props.children} | 28 | 28 | <div> | 29 | | - <ThemeToggleButton onChange={theme => this.setState({theme})} /> | | 29 | + <ThemeToggleButton | | 30 | + onChange={theme => { | | 31 | + React.unstable_withSuspenseConfig( | | 32 | + () => { | | 33 | + this.setState({theme}); | | 34 | + }, | | 35 | + {timeoutMs: 6000} | | 36 | + ); | | 37 | + }} | | 38 | + /> | 30 | 39 | </div> | 31 | 40 | </Theme.Provider> | 32 | 41 | <script | |
Collapse file Copy file name to clipboardExpand all lines: package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 48 | 48 | "eslint": "^6.1.0", | 49 | 49 | "eslint-config-fbjs": "^1.1.1", | 50 | 50 | "eslint-plugin-flowtype": "^2.25.0", | 51 | | - "eslint-plugin-jest": "^21.6.1", | | 51 | + "eslint-plugin-jest": "^22.15.0", | 52 | 52 | "eslint-plugin-no-for-of-loops": "^1.0.0", | 53 | 53 | "eslint-plugin-babel": "^5.3.0", | 54 | 54 | "eslint-plugin-react": "^6.7.1", | |
Collapse file Copy file name to clipboardExpand all lines: packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js +22-1Lines changed: 22 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -521,7 +521,6 @@ const tests = { | 521 | 521 | // Valid because the ref is captured. | 522 | 522 | code: ` | 523 | 523 | function useMyThing(myRef) { | 524 | | - const myRef = useRef(); | 525 | 524 | useEffect(() => { | 526 | 525 | const handleMove = () => {}; | 527 | 526 | const node = myRef.current; | @@ -1024,6 +1023,28 @@ const tests = { | 1024 | 1023 | } | 1025 | 1024 | `, | 1026 | 1025 | }, | | 1026 | + // Ignore arguments keyword for arrow functions. | | 1027 | + { | | 1028 | + code: ` | | 1029 | + function Example() { | | 1030 | + useEffect(() => { | | 1031 | + arguments | | 1032 | + }, []) | | 1033 | + } | | 1034 | + `, | | 1035 | + }, | | 1036 | + { | | 1037 | + code: ` | | 1038 | + function Example() { | | 1039 | + useEffect(() => { | | 1040 | + const bar = () => { | | 1041 | + arguments; | | 1042 | + }; | | 1043 | + bar(); | | 1044 | + }, []) | | 1045 | + } | | 1046 | + `, | | 1047 | + }, | 1027 | 1048 | ], | 1028 | 1049 | invalid: [ | 1029 | 1050 | { | |
Collapse file Copy file name to clipboardExpand all lines: packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -95,7 +95,7 @@ eslintTester.run('react-hooks', ReactHooksESLintRule, { | 95 | 95 | useHook2 = () => { useState(); }; | 96 | 96 | ({useHook: () => { useState(); }}); | 97 | 97 | ({useHook() { useState(); }}); | 98 | | - const {useHook = () => { useState(); }} = {}; | | 98 | + const {useHook3 = () => { useState(); }} = {}; | 99 | 99 | ({useHook = () => { useState(); }} = {}); | 100 | 100 | `, | 101 | 101 | ` | |
Collapse file Copy file name to clipboardExpand all lines: packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js +7-6Lines changed: 7 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -397,13 +397,14 @@ export default { | 397 | 397 | }); | 398 | 398 | } | 399 | 399 |
| 400 | | - // Ignore references to the function itself as it's not defined yet. | 401 | 400 | const def = reference.resolved.defs[0]; | 402 | | - if ( | 403 | | - def != null && | 404 | | - def.node != null && | 405 | | - def.node.init === node.parent | 406 | | - ) { | | 401 | + | | 402 | + if (def == null) { | | 403 | + continue; | | 404 | + } | | 405 | + | | 406 | + // Ignore references to the function itself as it's not defined yet. | | 407 | + if (def.node != null && def.node.init === node.parent) { | 407 | 408 | continue; | 408 | 409 | } | 409 | 410 |
| |
Collapse file Copy file name to clipboard File renamed without changes. Collapse file Copy file name to clipboard File renamed without changes. Collapse file Copy file name to clipboard File renamed without changes.
|