Skip to content
Permalink
Browse files
Update deprecated features in ESLint configuration files. (#22767)
  • Loading branch information
elas7 committed Nov 23, 2021
1 parent a04795c commit 09d9b17757d538c43fe872a5a0cb72a72c79c897
Showing 7 changed files with 156 additions and 159 deletions.
@@ -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
@@ -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',
},
};
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,

1 comment on commit 09d9b17

@jemilyntpccsibal
Copy link

@jemilyntpccsibal jemilyntpccsibal commented on 09d9b17 Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.