@samitouri / QOS-React-2 / commits / 09d9b17757

Update deprecated features in ESLint configuration files. (#22767)

Esteban committed Nov 23, 2021 at 23:53 UTC 09d9b17757d538c43fe872a5a0cb72a72c79c897
7 files changed +156 -159
.eslintrc.js
+17 -20
@@ -26,11 +26,8 @@ module.exports = {
26
27 parser: 'babel-eslint',
28 parserOptions: {
29 - ecmaVersion: 8,
29 + ecmaVersion: 9,
30 sourceType: 'script',
31 - ecmaFeatures: {
32 - experimentalObjectRestSpread: true,
33 - },
31 },
32
33 // We're stricter than the default config, mostly. We'll override a few rules
@@ -248,36 +245,36 @@ module.exports = {
245 'packages/react-server-native-relay/**/*.js',
246 ],
247 globals: {
251 - nativeFabricUIManager: true,
248 + nativeFabricUIManager: 'readonly',
249 },
250 },
251 {
252 files: ['packages/react-server-dom-webpack/**/*.js'],
253 globals: {
257 - __webpack_chunk_load__: true,
258 - __webpack_require__: true,
254 + __webpack_chunk_load__: 'readonly',
255 + __webpack_require__: 'readonly',
256 },
257 },
258 {
259 files: ['packages/scheduler/**/*.js'],
260 globals: {
264 - TaskController: true,
261 + TaskController: 'readonly',
262 },
263 },
264 ],
265
266 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',
279 },
280 };
scripts/rollup/validate/eslintrc.cjs.js
+25 -25
@@ -7,45 +7,45 @@ module.exports = {
7 },
8 globals: {
9 // 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',
19 // Vendor specific
20 - MSApp: true,
21 - __REACT_DEVTOOLS_GLOBAL_HOOK__: true,
20 + MSApp: 'readonly',
21 + __REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
22 // CommonJS / Node
23 - process: true,
24 - setImmediate: true,
25 - Buffer: true,
23 + process: 'readonly',
24 + setImmediate: 'readonly',
25 + Buffer: 'readonly',
26 // Trusted Types
27 - trustedTypes: true,
27 + trustedTypes: 'readonly',
28
29 // Scheduler profiling
30 - Int32Array: true,
31 - ArrayBuffer: true,
30 + Int32Array: 'readonly',
31 + ArrayBuffer: 'readonly',
32
33 - TaskController: true,
33 + TaskController: 'readonly',
34
35 // Flight
36 - Uint8Array: true,
37 - Promise: true,
36 + Uint8Array: 'readonly',
37 + Promise: 'readonly',
38
39 // Flight Webpack
40 - __webpack_chunk_load__: true,
41 - __webpack_require__: true,
40 + __webpack_chunk_load__: 'readonly',
41 + __webpack_require__: 'readonly',
42
43 // jest
44 - expect: true,
45 - jest: true,
44 + expect: 'readonly',
45 + jest: 'readonly',
46
47 // act
48 - IS_REACT_ACT_ENVIRONMENT: true,
48 + IS_REACT_ACT_ENVIRONMENT: 'readonly',
49 },
50 parserOptions: {
51 ecmaVersion: 5,
scripts/rollup/validate/eslintrc.cjs2015.js
+24 -24
@@ -7,44 +7,44 @@ module.exports = {
7 },
8 globals: {
9 // 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',
18 // Vendor specific
19 - MSApp: true,
20 - __REACT_DEVTOOLS_GLOBAL_HOOK__: true,
19 + MSApp: 'readonly',
20 + __REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
21 // CommonJS / Node
22 - process: true,
23 - setImmediate: true,
24 - Buffer: true,
22 + process: 'readonly',
23 + setImmediate: 'readonly',
24 + Buffer: 'readonly',
25 // Trusted Types
26 - trustedTypes: true,
26 + trustedTypes: 'readonly',
27
28 // Scheduler profiling
29 - Int32Array: true,
30 - ArrayBuffer: true,
29 + Int32Array: 'readonly',
30 + ArrayBuffer: 'readonly',
31
32 - TaskController: true,
32 + TaskController: 'readonly',
33
34 // Flight
35 - Uint8Array: true,
36 - Promise: true,
35 + Uint8Array: 'readonly',
36 + Promise: 'readonly',
37
38 // Flight Webpack
39 - __webpack_chunk_load__: true,
40 - __webpack_require__: true,
39 + __webpack_chunk_load__: 'readonly',
40 + __webpack_require__: 'readonly',
41
42 // jest
43 - expect: true,
44 - jest: true,
43 + expect: 'readonly',
44 + jest: 'readonly',
45
46 // act
47 - IS_REACT_ACT_ENVIRONMENT: true,
47 + IS_REACT_ACT_ENVIRONMENT: 'readonly',
48 },
49 parserOptions: {
50 ecmaVersion: 2015,
scripts/rollup/validate/eslintrc.esm.js
+24 -24
@@ -7,44 +7,44 @@ module.exports = {
7 },
8 globals: {
9 // 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',
18 // Vendor specific
19 - MSApp: true,
20 - __REACT_DEVTOOLS_GLOBAL_HOOK__: true,
19 + MSApp: 'readonly',
20 + __REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
21 // CommonJS / Node
22 - process: true,
23 - setImmediate: true,
24 - Buffer: true,
22 + process: 'readonly',
23 + setImmediate: 'readonly',
24 + Buffer: 'readonly',
25 // Trusted Types
26 - trustedTypes: true,
26 + trustedTypes: 'readonly',
27
28 // Scheduler profiling
29 - Int32Array: true,
30 - ArrayBuffer: true,
29 + Int32Array: 'readonly',
30 + ArrayBuffer: 'readonly',
31
32 - TaskController: true,
32 + TaskController: 'readonly',
33
34 // Flight
35 - Uint8Array: true,
36 - Promise: true,
35 + Uint8Array: 'readonly',
36 + Promise: 'readonly',
37
38 // Flight Webpack
39 - __webpack_chunk_load__: true,
40 - __webpack_require__: true,
39 + __webpack_chunk_load__: 'readonly',
40 + __webpack_require__: 'readonly',
41
42 // jest
43 - expect: true,
44 - jest: true,
43 + expect: 'readonly',
44 + jest: 'readonly',
45
46 // act
47 - IS_REACT_ACT_ENVIRONMENT: true,
47 + IS_REACT_ACT_ENVIRONMENT: 'readonly',
48 },
49 parserOptions: {
50 ecmaVersion: 2017,
scripts/rollup/validate/eslintrc.fb.js
+21 -21
@@ -7,40 +7,40 @@ module.exports = {
7 },
8 globals: {
9 // 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',
18 // Vendor specific
19 - MSApp: true,
20 - __REACT_DEVTOOLS_GLOBAL_HOOK__: true,
19 + MSApp: 'readonly',
20 + __REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
21 // FB
22 - __DEV__: true,
22 + __DEV__: 'readonly',
23 // Node.js Server Rendering
24 - setImmediate: true,
25 - Buffer: true,
24 + setImmediate: 'readonly',
25 + Buffer: 'readonly',
26 // Trusted Types
27 - trustedTypes: true,
27 + trustedTypes: 'readonly',
28
29 // Scheduler profiling
30 - Int32Array: true,
31 - ArrayBuffer: true,
30 + Int32Array: 'readonly',
31 + ArrayBuffer: 'readonly',
32
33 - TaskController: true,
33 + TaskController: 'readonly',
34
35 // Flight
36 - Uint8Array: true,
37 - Promise: true,
36 + Uint8Array: 'readonly',
37 + Promise: 'readonly',
38
39 // jest
40 - jest: true,
40 + jest: 'readonly',
41
42 // act
43 - IS_REACT_ACT_ENVIRONMENT: true,
43 + IS_REACT_ACT_ENVIRONMENT: 'readonly',
44 },
45 parserOptions: {
46 ecmaVersion: 5,
scripts/rollup/validate/eslintrc.rn.js
+18 -18
@@ -7,36 +7,36 @@ module.exports = {
7 },
8 globals: {
9 // 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',
17 // Vendor specific
18 - MSApp: true,
19 - __REACT_DEVTOOLS_GLOBAL_HOOK__: true,
18 + MSApp: 'readonly',
19 + __REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
20 // FB
21 - __DEV__: true,
21 + __DEV__: 'readonly',
22 // Fabric. See https://github.com/facebook/react/pull/15490
23 // for more information
24 - nativeFabricUIManager: true,
24 + nativeFabricUIManager: 'readonly',
25 // Trusted Types
26 - trustedTypes: true,
26 + trustedTypes: 'readonly',
27 // RN supports this
28 - setImmediate: true,
28 + setImmediate: 'readonly',
29 // Scheduler profiling
30 - Int32Array: true,
31 - ArrayBuffer: true,
30 + Int32Array: 'readonly',
31 + ArrayBuffer: 'readonly',
32
33 - TaskController: true,
33 + TaskController: 'readonly',
34
35 // jest
36 - jest: true,
36 + jest: 'readonly',
37
38 // act
39 - IS_REACT_ACT_ENVIRONMENT: true,
39 + IS_REACT_ACT_ENVIRONMENT: 'readonly',
40 },
41 parserOptions: {
42 ecmaVersion: 5,
scripts/rollup/validate/eslintrc.umd.js
+27 -27
@@ -6,50 +6,50 @@ module.exports = {
6 },
7 globals: {
8 // ES6
9 - Map: true,
10 - Set: true,
11 - Symbol: true,
12 - Proxy: true,
13 - WeakMap: true,
14 - WeakSet: true,
15 - Uint16Array: true,
16 - Reflect: true,
9 + Map: 'readonly',
10 + Set: 'readonly',
11 + Symbol: 'readonly',
12 + Proxy: 'readonly',
13 + WeakMap: 'readonly',
14 + WeakSet: 'readonly',
15 + Uint16Array: 'readonly',
16 + Reflect: 'readonly',
17 // Vendor specific
18 - MSApp: true,
19 - __REACT_DEVTOOLS_GLOBAL_HOOK__: true,
18 + MSApp: 'readonly',
19 + __REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
20 // UMD wrapper code
21 // TODO: this is too permissive.
22 // Ideally we should only allow these *inside* the UMD wrapper.
23 - exports: true,
24 - module: true,
25 - define: true,
26 - require: true,
27 - globalThis: true,
28 - global: true,
23 + exports: 'readonly',
24 + module: 'readonly',
25 + define: 'readonly',
26 + require: 'readonly',
27 + globalThis: 'readonly',
28 + global: 'readonly',
29 // Internet Explorer
30 - setImmediate: true,
30 + setImmediate: 'readonly',
31 // Trusted Types
32 - trustedTypes: true,
32 + trustedTypes: 'readonly',
33
34 // Scheduler profiling
35 - Int32Array: true,
36 - ArrayBuffer: true,
35 + Int32Array: 'readonly',
36 + ArrayBuffer: 'readonly',
37
38 - TaskController: true,
38 + TaskController: 'readonly',
39
40 // Flight
41 - Uint8Array: true,
42 - Promise: true,
41 + Uint8Array: 'readonly',
42 + Promise: 'readonly',
43
44 // Flight Webpack
45 - __webpack_chunk_load__: true,
46 - __webpack_require__: true,
45 + __webpack_chunk_load__: 'readonly',
46 + __webpack_require__: 'readonly',
47
48 // jest
49 - jest: true,
49 + jest: 'readonly',
50
51 // act
52 - IS_REACT_ACT_ENVIRONMENT: true,
52 + IS_REACT_ACT_ENVIRONMENT: 'readonly',
53 },
54 parserOptions: {
55 ecmaVersion: 5,