Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated features in ESLint configuration files. #22767

Merged
merged 2 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions .eslintrc.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading