Files
react/scripts/rollup/validate/eslintrc.cjs2015.js
Stephen Cyron 1f7a901d7b Fix false positive lint error with large number of branches (#24287)
* Switched RulesOfHooks.js to use BigInt. Added test and updated .eslintrc.js to use es2020.

* Added BigInt as readonly global in eslintrc.cjs.js and eslintrc.cjs2015.js

* Added comment to RulesOfHooks.js that gets rid of BigInt eslint error

* Got rid of changes in .eslintrc.js and yarn.lock

* Move global down

Co-authored-by: stephen cyron <stephen.cyron@fdmgroup.com>
Co-authored-by: dan <dan.abramov@gmail.com>
2022-04-08 00:22:47 +01:00

65 lines
1.4 KiB
JavaScript

'use strict';
module.exports = {
env: {
commonjs: true,
browser: true,
},
globals: {
// ES 6
BigInt: 'readonly',
Map: 'readonly',
Set: 'readonly',
Proxy: 'readonly',
Symbol: 'readonly',
WeakMap: 'readonly',
WeakSet: 'readonly',
Uint16Array: 'readonly',
Reflect: 'readonly',
// Vendor specific
MSApp: 'readonly',
__REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
// CommonJS / Node
process: 'readonly',
setImmediate: 'readonly',
Buffer: 'readonly',
// Trusted Types
trustedTypes: 'readonly',
// Scheduler profiling
Int32Array: 'readonly',
ArrayBuffer: 'readonly',
TaskController: 'readonly',
reportError: 'readonly',
// Flight
Uint8Array: 'readonly',
Promise: 'readonly',
// Flight Webpack
__webpack_chunk_load__: 'readonly',
__webpack_require__: 'readonly',
// jest
expect: 'readonly',
jest: 'readonly',
// act
IS_REACT_ACT_ENVIRONMENT: 'readonly',
},
parserOptions: {
ecmaVersion: 2015,
sourceType: 'script',
},
rules: {
'no-undef': 'error',
'no-shadow-restricted-names': 'error',
},
// These plugins aren't used, but eslint complains if an eslint-ignore comment
// references unused plugins. An alternate approach could be to strip
// eslint-ignore comments as part of the build.
plugins: ['jest', 'no-for-of-loops', 'react', 'react-internal'],
};