Skip to content

Commit 09d9b17

Browse files
authored
Update deprecated features in ESLint configuration files. (facebook#22767)
1 parent a04795c commit 09d9b17

File tree

7 files changed

+156
-159
lines changed

7 files changed

+156
-159
lines changed

.eslintrc.js

+17-20
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ module.exports = {
2626

2727
parser: 'babel-eslint',
2828
parserOptions: {
29-
ecmaVersion: 8,
29+
ecmaVersion: 9,
3030
sourceType: 'script',
31-
ecmaFeatures: {
32-
experimentalObjectRestSpread: true,
33-
},
3431
},
3532

3633
// We're stricter than the default config, mostly. We'll override a few rules
@@ -248,36 +245,36 @@ module.exports = {
248245
'packages/react-server-native-relay/**/*.js',
249246
],
250247
globals: {
251-
nativeFabricUIManager: true,
248+
nativeFabricUIManager: 'readonly',
252249
},
253250
},
254251
{
255252
files: ['packages/react-server-dom-webpack/**/*.js'],
256253
globals: {
257-
__webpack_chunk_load__: true,
258-
__webpack_require__: true,
254+
__webpack_chunk_load__: 'readonly',
255+
__webpack_require__: 'readonly',
259256
},
260257
},
261258
{
262259
files: ['packages/scheduler/**/*.js'],
263260
globals: {
264-
TaskController: true,
261+
TaskController: 'readonly',
265262
},
266263
},
267264
],
268265

269266
globals: {
270-
spyOnDev: true,
271-
spyOnDevAndProd: true,
272-
spyOnProd: true,
273-
__EXPERIMENTAL__: true,
274-
__EXTENSION__: true,
275-
__PROFILE__: true,
276-
__TEST__: true,
277-
__UMD__: true,
278-
__VARIANT__: true,
279-
gate: true,
280-
trustedTypes: true,
281-
IS_REACT_ACT_ENVIRONMENT: true,
267+
spyOnDev: 'readonly',
268+
spyOnDevAndProd: 'readonly',
269+
spyOnProd: 'readonly',
270+
__EXPERIMENTAL__: 'readonly',
271+
__EXTENSION__: 'readonly',
272+
__PROFILE__: 'readonly',
273+
__TEST__: 'readonly',
274+
__UMD__: 'readonly',
275+
__VARIANT__: 'readonly',
276+
gate: 'readonly',
277+
trustedTypes: 'readonly',
278+
IS_REACT_ACT_ENVIRONMENT: 'readonly',
282279
},
283280
};

scripts/rollup/validate/eslintrc.cjs.js

+25-25
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,45 @@ module.exports = {
77
},
88
globals: {
99
// ES 6
10-
Map: true,
11-
Set: true,
12-
Proxy: true,
13-
Symbol: true,
14-
WeakMap: true,
15-
WeakSet: true,
16-
Uint16Array: true,
17-
Reflect: true,
18-
globalThis: true,
10+
Map: 'readonly',
11+
Set: 'readonly',
12+
Proxy: 'readonly',
13+
Symbol: 'readonly',
14+
WeakMap: 'readonly',
15+
WeakSet: 'readonly',
16+
Uint16Array: 'readonly',
17+
Reflect: 'readonly',
18+
globalThis: 'readonly',
1919
// Vendor specific
20-
MSApp: true,
21-
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
20+
MSApp: 'readonly',
21+
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
2222
// CommonJS / Node
23-
process: true,
24-
setImmediate: true,
25-
Buffer: true,
23+
process: 'readonly',
24+
setImmediate: 'readonly',
25+
Buffer: 'readonly',
2626
// Trusted Types
27-
trustedTypes: true,
27+
trustedTypes: 'readonly',
2828

2929
// Scheduler profiling
30-
Int32Array: true,
31-
ArrayBuffer: true,
30+
Int32Array: 'readonly',
31+
ArrayBuffer: 'readonly',
3232

33-
TaskController: true,
33+
TaskController: 'readonly',
3434

3535
// Flight
36-
Uint8Array: true,
37-
Promise: true,
36+
Uint8Array: 'readonly',
37+
Promise: 'readonly',
3838

3939
// Flight Webpack
40-
__webpack_chunk_load__: true,
41-
__webpack_require__: true,
40+
__webpack_chunk_load__: 'readonly',
41+
__webpack_require__: 'readonly',
4242

4343
// jest
44-
expect: true,
45-
jest: true,
44+
expect: 'readonly',
45+
jest: 'readonly',
4646

4747
// act
48-
IS_REACT_ACT_ENVIRONMENT: true,
48+
IS_REACT_ACT_ENVIRONMENT: 'readonly',
4949
},
5050
parserOptions: {
5151
ecmaVersion: 5,

scripts/rollup/validate/eslintrc.cjs2015.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@ module.exports = {
77
},
88
globals: {
99
// ES 6
10-
Map: true,
11-
Set: true,
12-
Proxy: true,
13-
Symbol: true,
14-
WeakMap: true,
15-
WeakSet: true,
16-
Uint16Array: true,
17-
Reflect: true,
10+
Map: 'readonly',
11+
Set: 'readonly',
12+
Proxy: 'readonly',
13+
Symbol: 'readonly',
14+
WeakMap: 'readonly',
15+
WeakSet: 'readonly',
16+
Uint16Array: 'readonly',
17+
Reflect: 'readonly',
1818
// Vendor specific
19-
MSApp: true,
20-
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
19+
MSApp: 'readonly',
20+
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
2121
// CommonJS / Node
22-
process: true,
23-
setImmediate: true,
24-
Buffer: true,
22+
process: 'readonly',
23+
setImmediate: 'readonly',
24+
Buffer: 'readonly',
2525
// Trusted Types
26-
trustedTypes: true,
26+
trustedTypes: 'readonly',
2727

2828
// Scheduler profiling
29-
Int32Array: true,
30-
ArrayBuffer: true,
29+
Int32Array: 'readonly',
30+
ArrayBuffer: 'readonly',
3131

32-
TaskController: true,
32+
TaskController: 'readonly',
3333

3434
// Flight
35-
Uint8Array: true,
36-
Promise: true,
35+
Uint8Array: 'readonly',
36+
Promise: 'readonly',
3737

3838
// Flight Webpack
39-
__webpack_chunk_load__: true,
40-
__webpack_require__: true,
39+
__webpack_chunk_load__: 'readonly',
40+
__webpack_require__: 'readonly',
4141

4242
// jest
43-
expect: true,
44-
jest: true,
43+
expect: 'readonly',
44+
jest: 'readonly',
4545

4646
// act
47-
IS_REACT_ACT_ENVIRONMENT: true,
47+
IS_REACT_ACT_ENVIRONMENT: 'readonly',
4848
},
4949
parserOptions: {
5050
ecmaVersion: 2015,

scripts/rollup/validate/eslintrc.esm.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@ module.exports = {
77
},
88
globals: {
99
// ES 6
10-
Map: true,
11-
Set: true,
12-
Proxy: true,
13-
Symbol: true,
14-
WeakMap: true,
15-
WeakSet: true,
16-
Uint16Array: true,
17-
Reflect: true,
10+
Map: 'readonly',
11+
Set: 'readonly',
12+
Proxy: 'readonly',
13+
Symbol: 'readonly',
14+
WeakMap: 'readonly',
15+
WeakSet: 'readonly',
16+
Uint16Array: 'readonly',
17+
Reflect: 'readonly',
1818
// Vendor specific
19-
MSApp: true,
20-
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
19+
MSApp: 'readonly',
20+
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
2121
// CommonJS / Node
22-
process: true,
23-
setImmediate: true,
24-
Buffer: true,
22+
process: 'readonly',
23+
setImmediate: 'readonly',
24+
Buffer: 'readonly',
2525
// Trusted Types
26-
trustedTypes: true,
26+
trustedTypes: 'readonly',
2727

2828
// Scheduler profiling
29-
Int32Array: true,
30-
ArrayBuffer: true,
29+
Int32Array: 'readonly',
30+
ArrayBuffer: 'readonly',
3131

32-
TaskController: true,
32+
TaskController: 'readonly',
3333

3434
// Flight
35-
Uint8Array: true,
36-
Promise: true,
35+
Uint8Array: 'readonly',
36+
Promise: 'readonly',
3737

3838
// Flight Webpack
39-
__webpack_chunk_load__: true,
40-
__webpack_require__: true,
39+
__webpack_chunk_load__: 'readonly',
40+
__webpack_require__: 'readonly',
4141

4242
// jest
43-
expect: true,
44-
jest: true,
43+
expect: 'readonly',
44+
jest: 'readonly',
4545

4646
// act
47-
IS_REACT_ACT_ENVIRONMENT: true,
47+
IS_REACT_ACT_ENVIRONMENT: 'readonly',
4848
},
4949
parserOptions: {
5050
ecmaVersion: 2017,

scripts/rollup/validate/eslintrc.fb.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,40 @@ module.exports = {
77
},
88
globals: {
99
// ES6
10-
Map: true,
11-
Set: true,
12-
Symbol: true,
13-
Proxy: true,
14-
WeakMap: true,
15-
WeakSet: true,
16-
Uint16Array: true,
17-
Reflect: true,
10+
Map: 'readonly',
11+
Set: 'readonly',
12+
Symbol: 'readonly',
13+
Proxy: 'readonly',
14+
WeakMap: 'readonly',
15+
WeakSet: 'readonly',
16+
Uint16Array: 'readonly',
17+
Reflect: 'readonly',
1818
// Vendor specific
19-
MSApp: true,
20-
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
19+
MSApp: 'readonly',
20+
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
2121
// FB
22-
__DEV__: true,
22+
__DEV__: 'readonly',
2323
// Node.js Server Rendering
24-
setImmediate: true,
25-
Buffer: true,
24+
setImmediate: 'readonly',
25+
Buffer: 'readonly',
2626
// Trusted Types
27-
trustedTypes: true,
27+
trustedTypes: 'readonly',
2828

2929
// Scheduler profiling
30-
Int32Array: true,
31-
ArrayBuffer: true,
30+
Int32Array: 'readonly',
31+
ArrayBuffer: 'readonly',
3232

33-
TaskController: true,
33+
TaskController: 'readonly',
3434

3535
// Flight
36-
Uint8Array: true,
37-
Promise: true,
36+
Uint8Array: 'readonly',
37+
Promise: 'readonly',
3838

3939
// jest
40-
jest: true,
40+
jest: 'readonly',
4141

4242
// act
43-
IS_REACT_ACT_ENVIRONMENT: true,
43+
IS_REACT_ACT_ENVIRONMENT: 'readonly',
4444
},
4545
parserOptions: {
4646
ecmaVersion: 5,

scripts/rollup/validate/eslintrc.rn.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,36 @@ module.exports = {
77
},
88
globals: {
99
// ES6
10-
Map: true,
11-
Set: true,
12-
Symbol: true,
13-
Proxy: true,
14-
WeakMap: true,
15-
WeakSet: true,
16-
Reflect: true,
10+
Map: 'readonly',
11+
Set: 'readonly',
12+
Symbol: 'readonly',
13+
Proxy: 'readonly',
14+
WeakMap: 'readonly',
15+
WeakSet: 'readonly',
16+
Reflect: 'readonly',
1717
// Vendor specific
18-
MSApp: true,
19-
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
18+
MSApp: 'readonly',
19+
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
2020
// FB
21-
__DEV__: true,
21+
__DEV__: 'readonly',
2222
// Fabric. See https://github.com/facebook/react/pull/15490
2323
// for more information
24-
nativeFabricUIManager: true,
24+
nativeFabricUIManager: 'readonly',
2525
// Trusted Types
26-
trustedTypes: true,
26+
trustedTypes: 'readonly',
2727
// RN supports this
28-
setImmediate: true,
28+
setImmediate: 'readonly',
2929
// Scheduler profiling
30-
Int32Array: true,
31-
ArrayBuffer: true,
30+
Int32Array: 'readonly',
31+
ArrayBuffer: 'readonly',
3232

33-
TaskController: true,
33+
TaskController: 'readonly',
3434

3535
// jest
36-
jest: true,
36+
jest: 'readonly',
3737

3838
// act
39-
IS_REACT_ACT_ENVIRONMENT: true,
39+
IS_REACT_ACT_ENVIRONMENT: 'readonly',
4040
},
4141
parserOptions: {
4242
ecmaVersion: 5,

0 commit comments

Comments
 (0)