-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
eslint.config.js
50 lines (47 loc) · 1.61 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const reactRecommended = require('eslint-plugin-react/configs/recommended');
const reactHooks = require('eslint-plugin-react-hooks');
const typescriptParser = require('@typescript-eslint/parser');
const globals = require('globals');
const globalsBrowser = { ...globals.browser };
if (!('AudioWorkletGlobalScope' in globalsBrowser)) {
// This particular key in the globals object has a trailing space, so for now we work around that problem here
globalsBrowser['AudioWorkletGlobalScope'] = globalsBrowser['AudioWorkletGlobalScope '];
delete globalsBrowser['AudioWorkletGlobalScope '];
}
module.exports = [
{
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
...reactRecommended,
rules: {
...reactRecommended.rules,
...reactHooks.configs.recommended.rules,
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
},
plugins: {
...reactRecommended.plugins,
'react-hooks': { rules: { ...reactHooks.rules } },
},
settings: {
...reactRecommended.settings,
react: {
version: 'detect',
},
},
languageOptions: {
...reactRecommended.languageOptions,
ecmaVersion: 'latest',
sourceType: 'module',
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.serviceworker,
...globalsBrowser,
},
},
},
];