main
js 96 lines 2.45 KB
Raw
1 'use strict';
2
3 module.exports = {
4 env: {
5 commonjs: true,
6 browser: true,
7 },
8 globals: {
9 // ES6
10 BigInt: 'readonly',
11 Map: 'readonly',
12 Set: 'readonly',
13 Symbol: 'readonly',
14 Proxy: '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 // FB
45 __DEV__: 'readonly',
46 // Fabric. See https://github.com/facebook/react/pull/15490
47 // for more information
48 nativeFabricUIManager: 'readonly',
49 RN$isNativeEventTargetEventDispatchingEnabled: 'readonly',
50 // Trusted Types
51 trustedTypes: 'readonly',
52 // RN supports this
53 setImmediate: 'readonly',
54 // Scheduler profiling
55 TaskController: 'readonly',
56 reportError: 'readonly',
57 AggregateError: 'readonly',
58
59 // Node Feature Detection
60 process: 'readonly',
61
62 // Temp
63 AsyncLocalStorage: 'readonly',
64 async_hooks: 'readonly',
65
66 // jest
67 jest: 'readonly',
68
69 // act
70 IS_REACT_ACT_ENVIRONMENT: 'readonly',
71 },
72 parserOptions: {
73 ecmaVersion: 5,
74 sourceType: 'script',
75 },
76 rules: {
77 'no-undef': 'error',
78 'no-shadow-restricted-names': 'error',
79 'no-restricted-syntax': [
80 'error',
81 // TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
82 {
83 selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
84 message:
85 'Google Closure Compiler optimized `arguments` access. ' +
86 'This affects function arity. ' +
87 'Create a reference to `arguments` to avoid this optimization',
88 },
89 ],
90 },
91
92 // These plugins aren't used, but eslint complains if an eslint-ignore comment
93 // references unused plugins. An alternate approach could be to strip
94 // eslint-ignore comments as part of the build.
95 plugins: ['ft-flow', 'jest', 'no-for-of-loops', 'react', 'react-internal'],
96 };