-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy patheslint.config.js
65 lines (62 loc) · 1.95 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const reactPlugin = require('eslint-plugin-react');
const js = require('@eslint/js');
const globals = require('globals');
const {includeIgnoreFile} = require('@eslint/compat');
const pluginCypress = require('eslint-plugin-cypress/flat');
// TODO: remove once all deps are using the latest version
globals.browser['AudioWorkletGlobalScope'] = globals.browser['AudioWorkletGlobalScope '];
delete globals.browser['AudioWorkletGlobalScope '];
module.exports = [
includeIgnoreFile(__dirname + '/.gitignore'),
js.configs.recommended,
pluginCypress.configs.globals,
{
plugins: {
cypress: pluginCypress
},
rules: {
'cypress/unsafe-to-chain-command': 'error'
},
},
{
...reactPlugin.configs.flat.recommended,
languageOptions: {
...reactPlugin.configs.flat.recommended.languageOptions,
globals: {
...globals.browser,
...globals.jest,
...globals.node,
...globals.console,
flushConsoleOutput: 'readable',
},
},
rules: {
'semi': ['error', 'always'],
'curly': 'error',
'no-var': 'error',
'quotes': ['error', 'single'],
'no-console': 'error',
'no-debugger': 'warn',
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
'no-unused-vars': ['error', {
'ignoreRestSiblings': true,
'varsIgnorePattern': '^_',
'argsIgnorePattern': '^_',
'caughtErrorsIgnorePattern': '^_',
'destructuredArrayIgnorePattern': '^_'
}],
'eol-last': 'error',
'object-curly-spacing': ['error', 'never'],
'react/prop-types': 'off',
'react/display-name': 'off',
'space-before-function-paren': ['error', 'never'],
'space-before-blocks': ['error', 'always'],
'space-in-parens': ['error', 'never'],
'comma-dangle': ['error', 'only-multiline'],
'func-call-spacing': ['error', 'never'],
'no-multi-spaces': 'error',
'indent': ['error', 2]
}
}
];