-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
125 lines (125 loc) · 2.95 KB
/
.eslintrc.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
globals: {
JSX: true,
React: true,
},
ignorePatterns: [
// Ignore dotfiles
'.*.js',
'node_modules/',
'dist/',
],
overrides: [
{
files: ['*.js?(x)', '*.ts?(x)'],
},
],
plugins: ['import', 'only-warn', 'sort-destructure-keys', 'sort-keys-plus', 'typescript-sort-keys', 'unused-imports'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
ignoreRestSiblings: true,
varsIgnorePattern: '^_',
},
],
curly: 'error',
'import/no-cycle': ['warn'],
'import/order': [
'warn',
{
alphabetize: {
caseInsensitive: false,
order: 'asc',
},
groups: ['builtin', 'external', 'type', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'never',
pathGroups: [
{
group: 'external',
pattern: 'react',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['react'],
warnOnUnassignedImports: true,
},
],
'no-case-declarations': 'off',
'no-empty-pattern': 'off',
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 1 }],
'no-unused-vars': 'off',
'react/jsx-newline': ['warn', { prevent: true }],
'react/jsx-sort-props': [
'warn',
{
callbacksLast: false,
ignoreCase: false,
locale: 'auto',
multiline: 'ignore',
noSortAlphabetically: false,
reservedFirst: false,
shorthandFirst: false,
shorthandLast: false,
},
],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/self-closing-comp': 'error',
'react-hooks/exhaustive-deps': 'error',
'require-await': 'error',
'sort-destructure-keys/sort-destructure-keys': ['warn', { caseSensitive: true }],
'sort-imports': [
'warn',
{
// let import/order deal with declarations
ignoreDeclarationSort: true,
},
],
'sort-keys-plus/sort-keys': [
'warn',
'asc',
{
allowLineSeparatedGroups: true,
natural: true,
},
],
'typescript-sort-keys/interface': [
'warn',
'asc',
{
caseSensitive: true,
natural: true,
requiredFirst: false,
},
],
'typescript-sort-keys/string-enum': [
'warn',
'asc',
{
caseSensitive: true,
natural: true,
},
],
'unused-imports/no-unused-imports': 'warn',
},
settings: {
react: {
version: 'detect',
},
},
};