-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
101 lines (100 loc) · 3.06 KB
/
eslint.config.js
File metadata and controls
101 lines (100 loc) · 3.06 KB
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
97
98
99
100
101
import eslint from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import stylisticJSX from '@stylistic/eslint-plugin-jsx'
import importPlugin from 'eslint-plugin-import'
import tseslint from 'typescript-eslint'
export default tseslint.config([
{
ignores: ['**/lib/**', '**/dist/**']
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
...tseslint.configs.recommended.rules,
'@typescript-eslint/no-unused-vars': [
'error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
'@typescript-eslint/triple-slash-reference': 'off'
}
},
stylistic.configs['recommended-flat'],
{
rules: {
...stylistic.configs['recommended-flat'].rules,
'@stylistic/semi': 'error',
'@stylistic/quotes': ['error', 'single'],
'@stylistic/eol-last': 'error',
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
'@stylistic/member-delimiter-style': 'off',
'@stylistic/prop-types': 'off',
'@stylistic/array-bracket-spacing': ['error', 'never'],
'@stylistic/comma-spacing': ['error', { after: true }],
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/indent': ['error', 2],
'@stylistic/arrow-parens': ['error', 'as-needed'],
'@stylistic/operator-linebreak': ['error', 'before', { overrides: { '=': 'after' } }],
'@stylistic/react-in-jsx-scope': 'off',
'@stylistic/jsx-tag-spacing': ['error', { beforeSelfClosing: 'always' }],
'@stylistic/jsx-indent': 'off',
'@stylistic/jsx-indent-props': 'off',
'@stylistic/jsx-closing-bracket-location': 'off',
'@stylistic/jsx-one-expression-per-line': 'off'
}
},
{
...stylisticJSX.configs['all-flat'],
rules: {
...stylisticJSX.configs['all-flat'].rules,
'@stylistic/jsx/jsx-indent': 'off',
'@stylistic/jsx/jsx-indent-props': 'off',
'@stylistic/jsx/jsx-closing-bracket-location': 'off',
'@stylistic/jsx/jsx-newline': 'off',
'@stylistic/jsx/jsx-one-expression-per-line': 'off'
}
},
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
{
files: ['**/*.{js,ts,jsx,tsx}'],
settings: {
typescript: { }
},
rules: {
'import/no-unresolved': 'off',
'import/no-named-as-default': 'off',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'unknown',
'parent',
'sibling',
'index',
'object',
'type'
],
pathGroups: [
{
pattern: '{react,react-dom/**,react-router-dom,react-icons/**,styled-components}',
group: 'builtin',
position: 'before'
}
],
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: {
order: 'asc'
}
}
]
}
}
])