Skip to content

Commit

Permalink
Update deprecated features in ESLint configuration files. (#22767)
Browse files Browse the repository at this point in the history
  • Loading branch information
elas7 committed Nov 23, 2021
1 parent a04795c commit 09d9b17
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 159 deletions.
37 changes: 17 additions & 20 deletions .eslintrc.js
Expand Up @@ -26,11 +26,8 @@ module.exports = {

parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
ecmaVersion: 9,
sourceType: 'script',
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},

// We're stricter than the default config, mostly. We'll override a few rules
Expand Down Expand Up @@ -248,36 +245,36 @@ module.exports = {
'packages/react-server-native-relay/**/*.js',
],
globals: {
nativeFabricUIManager: true,
nativeFabricUIManager: 'readonly',
},
},
{
files: ['packages/react-server-dom-webpack/**/*.js'],
globals: {
__webpack_chunk_load__: true,
__webpack_require__: true,
__webpack_chunk_load__: 'readonly',
__webpack_require__: 'readonly',
},
},
{
files: ['packages/scheduler/**/*.js'],
globals: {
TaskController: true,
TaskController: 'readonly',
},
},
],

globals: {
spyOnDev: true,
spyOnDevAndProd: true,
spyOnProd: true,
__EXPERIMENTAL__: true,
__EXTENSION__: true,
__PROFILE__: true,
__TEST__: true,
__UMD__: true,
__VARIANT__: true,
gate: true,
trustedTypes: true,
IS_REACT_ACT_ENVIRONMENT: true,
spyOnDev: 'readonly',
spyOnDevAndProd: 'readonly',
spyOnProd: 'readonly',
__EXPERIMENTAL__: 'readonly',
__EXTENSION__: 'readonly',
__PROFILE__: 'readonly',
__TEST__: 'readonly',
__UMD__: 'readonly',
__VARIANT__: 'readonly',
gate: 'readonly',
trustedTypes: 'readonly',
IS_REACT_ACT_ENVIRONMENT: 'readonly',
},
};
50 changes: 25 additions & 25 deletions scripts/rollup/validate/eslintrc.cjs.js
Expand Up @@ -7,45 +7,45 @@ module.exports = {
},
globals: {
// ES 6
Map: true,
Set: true,
Proxy: true,
Symbol: true,
WeakMap: true,
WeakSet: true,
Uint16Array: true,
Reflect: true,
globalThis: true,
Map: 'readonly',
Set: 'readonly',
Proxy: 'readonly',
Symbol: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
Uint16Array: 'readonly',
Reflect: 'readonly',
globalThis: 'readonly',
// Vendor specific
MSApp: true,
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
MSApp: 'readonly',
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
// CommonJS / Node
process: true,
setImmediate: true,
Buffer: true,
process: 'readonly',
setImmediate: 'readonly',
Buffer: 'readonly',
// Trusted Types
trustedTypes: true,
trustedTypes: 'readonly',

// Scheduler profiling
Int32Array: true,
ArrayBuffer: true,
Int32Array: 'readonly',
ArrayBuffer: 'readonly',

TaskController: true,
TaskController: 'readonly',

// Flight
Uint8Array: true,
Promise: true,
Uint8Array: 'readonly',
Promise: 'readonly',

// Flight Webpack
__webpack_chunk_load__: true,
__webpack_require__: true,
__webpack_chunk_load__: 'readonly',
__webpack_require__: 'readonly',

// jest
expect: true,
jest: true,
expect: 'readonly',
jest: 'readonly',

// act
IS_REACT_ACT_ENVIRONMENT: true,
IS_REACT_ACT_ENVIRONMENT: 'readonly',
},
parserOptions: {
ecmaVersion: 5,
Expand Down
48 changes: 24 additions & 24 deletions scripts/rollup/validate/eslintrc.cjs2015.js
Expand Up @@ -7,44 +7,44 @@ module.exports = {
},
globals: {
// ES 6
Map: true,
Set: true,
Proxy: true,
Symbol: true,
WeakMap: true,
WeakSet: true,
Uint16Array: true,
Reflect: true,
Map: 'readonly',
Set: 'readonly',
Proxy: 'readonly',
Symbol: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
Uint16Array: 'readonly',
Reflect: 'readonly',
// Vendor specific
MSApp: true,
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
MSApp: 'readonly',
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
// CommonJS / Node
process: true,
setImmediate: true,
Buffer: true,
process: 'readonly',
setImmediate: 'readonly',
Buffer: 'readonly',
// Trusted Types
trustedTypes: true,
trustedTypes: 'readonly',

// Scheduler profiling
Int32Array: true,
ArrayBuffer: true,
Int32Array: 'readonly',
ArrayBuffer: 'readonly',

TaskController: true,
TaskController: 'readonly',

// Flight
Uint8Array: true,
Promise: true,
Uint8Array: 'readonly',
Promise: 'readonly',

// Flight Webpack
__webpack_chunk_load__: true,
__webpack_require__: true,
__webpack_chunk_load__: 'readonly',
__webpack_require__: 'readonly',

// jest
expect: true,
jest: true,
expect: 'readonly',
jest: 'readonly',

// act
IS_REACT_ACT_ENVIRONMENT: true,
IS_REACT_ACT_ENVIRONMENT: 'readonly',
},
parserOptions: {
ecmaVersion: 2015,
Expand Down
48 changes: 24 additions & 24 deletions scripts/rollup/validate/eslintrc.esm.js
Expand Up @@ -7,44 +7,44 @@ module.exports = {
},
globals: {
// ES 6
Map: true,
Set: true,
Proxy: true,
Symbol: true,
WeakMap: true,
WeakSet: true,
Uint16Array: true,
Reflect: true,
Map: 'readonly',
Set: 'readonly',
Proxy: 'readonly',
Symbol: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
Uint16Array: 'readonly',
Reflect: 'readonly',
// Vendor specific
MSApp: true,
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
MSApp: 'readonly',
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
// CommonJS / Node
process: true,
setImmediate: true,
Buffer: true,
process: 'readonly',
setImmediate: 'readonly',
Buffer: 'readonly',
// Trusted Types
trustedTypes: true,
trustedTypes: 'readonly',

// Scheduler profiling
Int32Array: true,
ArrayBuffer: true,
Int32Array: 'readonly',
ArrayBuffer: 'readonly',

TaskController: true,
TaskController: 'readonly',

// Flight
Uint8Array: true,
Promise: true,
Uint8Array: 'readonly',
Promise: 'readonly',

// Flight Webpack
__webpack_chunk_load__: true,
__webpack_require__: true,
__webpack_chunk_load__: 'readonly',
__webpack_require__: 'readonly',

// jest
expect: true,
jest: true,
expect: 'readonly',
jest: 'readonly',

// act
IS_REACT_ACT_ENVIRONMENT: true,
IS_REACT_ACT_ENVIRONMENT: 'readonly',
},
parserOptions: {
ecmaVersion: 2017,
Expand Down
42 changes: 21 additions & 21 deletions scripts/rollup/validate/eslintrc.fb.js
Expand Up @@ -7,40 +7,40 @@ module.exports = {
},
globals: {
// ES6
Map: true,
Set: true,
Symbol: true,
Proxy: true,
WeakMap: true,
WeakSet: true,
Uint16Array: true,
Reflect: true,
Map: 'readonly',
Set: 'readonly',
Symbol: 'readonly',
Proxy: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
Uint16Array: 'readonly',
Reflect: 'readonly',
// Vendor specific
MSApp: true,
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
MSApp: 'readonly',
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
// FB
__DEV__: true,
__DEV__: 'readonly',
// Node.js Server Rendering
setImmediate: true,
Buffer: true,
setImmediate: 'readonly',
Buffer: 'readonly',
// Trusted Types
trustedTypes: true,
trustedTypes: 'readonly',

// Scheduler profiling
Int32Array: true,
ArrayBuffer: true,
Int32Array: 'readonly',
ArrayBuffer: 'readonly',

TaskController: true,
TaskController: 'readonly',

// Flight
Uint8Array: true,
Promise: true,
Uint8Array: 'readonly',
Promise: 'readonly',

// jest
jest: true,
jest: 'readonly',

// act
IS_REACT_ACT_ENVIRONMENT: true,
IS_REACT_ACT_ENVIRONMENT: 'readonly',
},
parserOptions: {
ecmaVersion: 5,
Expand Down
36 changes: 18 additions & 18 deletions scripts/rollup/validate/eslintrc.rn.js
Expand Up @@ -7,36 +7,36 @@ module.exports = {
},
globals: {
// ES6
Map: true,
Set: true,
Symbol: true,
Proxy: true,
WeakMap: true,
WeakSet: true,
Reflect: true,
Map: 'readonly',
Set: 'readonly',
Symbol: 'readonly',
Proxy: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
Reflect: 'readonly',
// Vendor specific
MSApp: true,
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
MSApp: 'readonly',
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
// FB
__DEV__: true,
__DEV__: 'readonly',
// Fabric. See https://github.com/facebook/react/pull/15490
// for more information
nativeFabricUIManager: true,
nativeFabricUIManager: 'readonly',
// Trusted Types
trustedTypes: true,
trustedTypes: 'readonly',
// RN supports this
setImmediate: true,
setImmediate: 'readonly',
// Scheduler profiling
Int32Array: true,
ArrayBuffer: true,
Int32Array: 'readonly',
ArrayBuffer: 'readonly',

TaskController: true,
TaskController: 'readonly',

// jest
jest: true,
jest: 'readonly',

// act
IS_REACT_ACT_ENVIRONMENT: true,
IS_REACT_ACT_ENVIRONMENT: 'readonly',
},
parserOptions: {
ecmaVersion: 5,
Expand Down

0 comments on commit 09d9b17

Please sign in to comment.