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

This commit is contained in:
Esteban 2021-11-23 23:53:26 +01:00 committed by GitHub
parent a04795c89c
commit 09d9b17757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 156 additions and 159 deletions

View File

@ -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',
},
};

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -6,50 +6,50 @@ 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',
// UMD wrapper code
// TODO: this is too permissive.
// Ideally we should only allow these *inside* the UMD wrapper.
exports: true,
module: true,
define: true,
require: true,
globalThis: true,
global: true,
exports: 'readonly',
module: 'readonly',
define: 'readonly',
require: 'readonly',
globalThis: 'readonly',
global: 'readonly',
// Internet Explorer
setImmediate: true,
setImmediate: '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
jest: true,
jest: 'readonly',
// act
IS_REACT_ACT_ENVIRONMENT: true,
IS_REACT_ACT_ENVIRONMENT: 'readonly',
},
parserOptions: {
ecmaVersion: 5,