main
js 111 lines 2.67 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
36 FinalizationRegistry: 'readonly',
37
38 ScrollTimeline: 'readonly',
39 navigation: 'readonly',
40
41 // Vendor specific
42 MSApp: 'readonly',
43 __REACT_DEVTOOLS_GLOBAL_HOOK__: 'readonly',
44 // CommonJS / Node
45 process: 'readonly',
46 setImmediate: 'readonly',
47 Buffer: 'readonly',
48 // Trusted Types
49 trustedTypes: 'readonly',
50
51 // Scheduler profiling
52 TaskController: 'readonly',
53 reportError: 'readonly',
54 AggregateError: 'readonly',
55
56 // Flight
57 Promise: 'readonly',
58
59 // Temp
60 AsyncLocalStorage: 'readonly',
61 async_hooks: 'readonly',
62
63 // Flight Webpack
64 __webpack_chunk_load__: 'readonly',
65 __webpack_get_script_filename__: 'readonly',
66 __webpack_require__: 'readonly',
67
68 // Flight Turbopack
69 __turbopack_load_by_url__: 'readonly',
70 __turbopack_require__: 'readonly',
71
72 // Flight Parcel
73 parcelRequire: 'readonly',
74
75 // jest
76 expect: 'readonly',
77 jest: 'readonly',
78
79 // act
80 IS_REACT_ACT_ENVIRONMENT: 'readonly',
81
82 // Native Scheduler
83 nativeRuntimeScheduler: 'readonly',
84
85 Bun: 'readonly',
86 },
87 parserOptions: {
88 ecmaVersion: 2020,
89 sourceType: 'script',
90 },
91 rules: {
92 'no-undef': 'error',
93 'no-shadow-restricted-names': 'error',
94 'no-restricted-syntax': [
95 'error',
96 // TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
97 {
98 selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
99 message:
100 'Google Closure Compiler optimized `arguments` access. ' +
101 'This affects function arity. ' +
102 'Create a reference to `arguments` to avoid this optimization',
103 },
104 ],
105 },
106
107 // These plugins aren't used, but eslint complains if an eslint-ignore comment
108 // references unused plugins. An alternate approach could be to strip
109 // eslint-ignore comments as part of the build.
110 plugins: ['ft-flow', 'jest', 'no-for-of-loops', 'react', 'react-internal'],
111 };