-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
82 lines (77 loc) · 2.14 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
/* eslint-env node */
module.exports = {
root: true,
env: {
browser: true,
},
extends: [
'eslint:recommended',
'plugin:import/typescript',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/strict',
'plugin:react/jsx-runtime',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
'plugin:prettier/recommended',
'prettier',
],
settings: {
react: {
version: 'detect',
},
},
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
plugins: [
'react',
'@typescript-eslint',
'import',
'jsx-a11y',
'react-hooks',
'react-refresh',
'prettier',
],
rules: {
'no-var': 'error',
'no-alert': 'error',
'no-console': 'error',
'prefer-const': 'error',
// "prefer-destructuring": "error",
'import/no-duplicates': 'error',
'import/no-self-import': 'error',
'import/no-relative-packages': 'error',
'import/no-relative-parent-imports': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
'import/no-empty-named-blocks': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-import-module-exports': 'error',
'import/newline-after-import': 'error',
'import/group-exports': 'error',
'import/exports-last': 'error',
'import/no-useless-path-segments': ['error', { noUselessIndex: true }],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/consistent-type-definitions': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'prettier/prettier': [
'warn',
{
endOfLine: 'lf',
singleQuote: true,
},
],
'react-refresh/only-export-components': ['error', { allowConstantExport: true }],
},
}