Skip to content

Commit 44e4109

Browse files
author
Brian Vaughn
committed
Merged master (with events -> legacy-events package rename)
2 parents 441d014 + b1a03df commit 44e4109

File tree

119 files changed

+2316
-1473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+2316
-1473
lines changed

.circleci/config.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,6 @@ jobs:
9494
- *run_yarn
9595
- run: yarn test-prod --maxWorkers=2
9696

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-
10797
build:
10898
docker: *docker
10999
environment: *environment
@@ -257,6 +247,3 @@ workflows:
257247
- test_fuzz:
258248
requires:
259249
- setup
260-
- test_coverage:
261-
requires:
262-
- setup

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ module.exports = {
129129
rules: {
130130
// https://github.com/jest-community/eslint-plugin-jest
131131
'jest/no-focused-tests': ERROR,
132+
'jest/valid-expect': ERROR,
133+
'jest/valid-expect-in-promise': ERROR,
132134
},
133135
},
134136
{
@@ -140,6 +142,8 @@ module.exports = {
140142
],
141143

142144
globals: {
145+
SharedArrayBuffer: true,
146+
143147
spyOnDev: true,
144148
spyOnDevAndProd: true,
145149
spyOnProd: true,

fixtures/ssr/src/components/Chrome.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ export default class Chrome extends Component {
2626
<Theme.Provider value={this.state.theme}>
2727
{this.props.children}
2828
<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+
/>
3039
</div>
3140
</Theme.Provider>
3241
<script

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"eslint": "^6.1.0",
4949
"eslint-config-fbjs": "^1.1.1",
5050
"eslint-plugin-flowtype": "^2.25.0",
51-
"eslint-plugin-jest": "^21.6.1",
51+
"eslint-plugin-jest": "^22.15.0",
5252
"eslint-plugin-no-for-of-loops": "^1.0.0",
5353
"eslint-plugin-babel": "^5.3.0",
5454
"eslint-plugin-react": "^6.7.1",

packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@ const tests = {
521521
// Valid because the ref is captured.
522522
code: `
523523
function useMyThing(myRef) {
524-
const myRef = useRef();
525524
useEffect(() => {
526525
const handleMove = () => {};
527526
const node = myRef.current;
@@ -1024,6 +1023,28 @@ const tests = {
10241023
}
10251024
`,
10261025
},
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+
},
10271048
],
10281049
invalid: [
10291050
{

packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ eslintTester.run('react-hooks', ReactHooksESLintRule, {
9595
useHook2 = () => { useState(); };
9696
({useHook: () => { useState(); }});
9797
({useHook() { useState(); }});
98-
const {useHook = () => { useState(); }} = {};
98+
const {useHook3 = () => { useState(); }} = {};
9999
({useHook = () => { useState(); }} = {});
100100
`,
101101
`

packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,14 @@ export default {
397397
});
398398
}
399399

400-
// Ignore references to the function itself as it's not defined yet.
401400
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) {
407408
continue;
408409
}
409410

0 commit comments

Comments
 (0)