-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
65 lines (64 loc) · 1.85 KB
/
eslint.config.mjs
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
import { fixupConfigRules } from '@eslint/compat';
import globals from 'globals';
import pluginJs from '@eslint/js';
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
import stylistic from '@stylistic/eslint-plugin';
export default [
{
settings: {
react: {
version: 'detect'
}
}
},
{
languageOptions: {
ecmaVersion: 2021,
globals: {
...globals.browser,
...globals.es2021,
...globals.node,
document: 'readonly',
navigator: 'readonly',
window: 'readonly'
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
}
},
{
plugins: {
'@stylistic': stylistic
}
},
...fixupConfigRules(pluginReactConfig),
stylistic.configs['recommended-flat'],
{
rules: {
'@stylistic/brace-style': ['error', '1tbs'],
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/jsx-one-expression-per-line': ['error', { allow: 'single-line' }],
'@stylistic/jsx-quotes': ['error', 'prefer-single'],
'@stylistic/operator-linebreak': ['error', 'before'],
'@stylistic/quote-props': ['error', 'as-needed'],
'@stylistic/semi': ['error', 'always'],
'@stylistic/space-before-function-paren': ['error', 'always'],
'@stylistic/spaced-comment': ['error', 'always', { block: { balanced: true } }],
...pluginJs.configs.all.rules,
'arrow-body-style': ['error', 'always'],
complexity: 'off',
'default-param-last': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-statements': 'off',
'no-magic-numbers': 'off',
'no-ternary': 'off',
'one-var': ['error', { initialized: 'never' }],
'react/no-unknown-property': ['error', { ignore: ['css'] }],
'sort-imports': ['error', { ignoreCase: true }]
}
}
];