main
js 105 lines 2.61 KB
Raw
1 'use strict';
2
3 module.exports = {
4 env: {
5 commonjs: true,
6 browser: true,
7 },
8 globals: {
9 // ES 6
10 BigInt: 'readonly',
11 Map: 'readonly',
12 Set: 'readonly',
13 Proxy: 'readonly',
14 Symbol: 'readonly',
15 WeakMap: 'readonly',
16 WeakSet: 'readonly',
17 WeakRef: 'readonly',
18
19 Int8Array: 'readonly',
20 Uint8Array: 'readonly',
21 Uint8ClampedArray: 'readonly',
22 Int16Array: 'readonly',
23 Uint16Array: 'readonly',
24 Int32Array: 'readonly',
25 Uint32Array: 'readonly',
26 Float32Array: 'readonly',
27 Float64Array: 'readonly',
28 BigInt64Array: 'readonly',
29 BigUint64Array: 'readonly',
30 DataView: 'readonly',
31 ArrayBuffer: 'readonly',
32
33 Reflect: 'readonly',
34 globalThis: 'readonly',
35 FinalizationRegistry: 'readonly',
36 ScrollTimeline: 'readonly',
37 navigation: 'readonly',
38 // Vendor specific
39 MSApp: 'readonly',
40 __REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
41 // CommonJS / Node
42 process: 'readonly',
43 setImmediate: 'readonly',
44 Buffer: 'readonly',
45 // Trusted Types
46 trustedTypes: 'readonly',
47
48 // Scheduler profiling
49 TaskController: 'readonly',
50 reportError: 'readonly',
51 AggregateError: 'readonly',
52
53 // Flight
54 Promise: 'readonly',
55
56 // Temp
57 AsyncLocalStorage: 'readonly',
58 async_hooks: 'readonly',
59
60 // Flight Webpack
61 __webpack_chunk_load__: 'readonly',
62 __webpack_get_script_filename__: 'readonly',
63 __webpack_require__: 'readonly',
64
65 // Flight Turbopack
66 __turbopack_load_by_url__: 'readonly',
67 __turbopack_require__: 'readonly',
68
69 // Flight Parcel
70 parcelRequire: 'readonly',
71
72 // jest
73 expect: 'readonly',
74 jest: 'readonly',
75
76 // act
77 IS_REACT_ACT_ENVIRONMENT: 'readonly',
78
79 Bun: 'readonly',
80 },
81 parserOptions: {
82 ecmaVersion: 2015,
83 sourceType: 'script',
84 },
85 rules: {
86 'no-undef': 'error',
87 'no-shadow-restricted-names': 'error',
88 'no-restricted-syntax': [
89 'error',
90 // TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
91 {
92 selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
93 message:
94 'Google Closure Compiler optimized `arguments` access. ' +
95 'This affects function arity. ' +
96 'Create a reference to `arguments` to avoid this optimization',
97 },
98 ],
99 },
100
101 // These plugins aren't used, but eslint complains if an eslint-ignore comment
102 // references unused plugins. An alternate approach could be to strip
103 // eslint-ignore comments as part of the build.
104 plugins: ['ft-flow', 'jest', 'no-for-of-loops', 'react', 'react-internal'],
105 };