-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.cjs
96 lines (95 loc) · 3.24 KB
/
.eslintrc.cjs
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:storybook/recommended',
'plugin:perfectionist/recommended-natural-legacy',
'prettier'
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'plop', 'plop/**', 'plopfile.js', '.stylelintrc.js'],
plugins: ['react-refresh', 'import'],
parser: '@typescript-eslint/parser',
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
node: true,
typescript: {
project: '.'
}
}
},
rules: {
'perfectionist/sort-imports': [
'error',
{
type: 'line-length',
order: 'desc',
ignoreCase: true,
specialCharacters: 'keep',
internalPattern: ['^~/.+'],
tsconfigRootDir: '.',
partitionByComment: false,
partitionByNewLine: false,
newlinesBetween: 'always',
maxLineLength: undefined,
groups: [
'type',
['builtin', 'external'],
'internal-type',
'internal',
['parent-type', 'sibling-type', 'index-type'],
['parent', 'sibling', 'index'],
'object',
'unknown'
],
customGroups: { type: {}, value: {} },
environment: 'node'
}
],
'perfectionist/sort-objects': ['off'],
'perfectionist/sort-modules': ['off'],
indent: ['error', 4, { SwitchCase: 1 }],
'max-classes-per-file': 'off',
'import/no-extraneous-dependencies': ['off'],
'import/no-unresolved': ['error', { ignore: ['^@theme', '^@docusaurus', '^@site'] }],
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'no-bitwise': 'off',
'no-plusplus': 'off',
'no-restricted-syntax': ['off', 'ForInStatement'],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'no-shadow': ['off'],
'arrow-body-style': ['off'],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'no-underscore-dangle': [
'off',
{
allow: ['_'],
allowAfterThis: true,
allowAfterSuper: true,
allowAfterThisConstructor: true,
enforceInMethodNames: false
}
],
semi: ['error', 'never'],
'comma-dangle': ['off'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'object-curly-newline': ['error', { multiline: true, consistent: true }],
'react-hooks/exhaustive-deps': 'off',
'no-empty-pattern': 'warn',
'@typescript-eslint/ban-types': [
'error',
{
types: {
'{}': false
}
}
]
}
}