-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
133 lines (131 loc) · 4.11 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
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
126
127
128
129
130
131
132
133
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: ['airbnb', 'prettier'],
ignorePatterns: ['dist', '.eslintrc.cjs', 'vite.config.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
'project': './tsconfig.json',
'ecmaVersion': 6,
'sourceType': 'module',
},
plugins: ['jsdoc', '@typescript-eslint', 'prettier', 'simple-import-sort'],
rules: {
'import/prefer-default-export': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
'': 'never',
'js': 'never',
'jsx': 'never',
'ts': 'never',
'tsx': 'never',
},
],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/no-extraneous-dependencies': 'off',
'react/function-component-definition': 'off',
'react/no-array-index-key': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'react/jsx-filename-extension': 'off',
'import/no-unresolved': 'off',
'no-undef': 'off',
'no-param-reassign': 'off',
'arrow-body-style': 'off',
'no-shadow': 'off',
'react/jsx-props-no-spreading': 'warn',
'@typescript-eslint/no-shadow': 'warn',
'no-restricted-syntax': ['off', 'ForOfStatement'],
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/no-empty-interface': [
'error',
{
'allowSingleExtends': false,
},
],
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
'vars': 'all',
'args': 'after-used',
'ignoreRestSiblings': false,
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^_',
},
],
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/comma-dangle': 'off',
'jsdoc/require-description-complete-sentence': [
'error',
{
'tags': ['see', 'copyright'],
},
],
'jsdoc/require-param': [
'error',
{
'checkDestructured': false,
'enableFixer': false,
},
],
'jsdoc/require-param-name': 'error',
'jsdoc/require-param-description': 'error',
'jsdoc/check-tag-names': 'error',
'jsdoc/no-types': 'error',
'func-style': [
'error',
'declaration',
{
'allowArrowFunctions': true,
},
],
'jsdoc/check-alignment': 'error',
'jsdoc/no-bad-blocks': 'error',
},
overrides: [
{
'files': ['*.js', '*.jsx', '*.ts', '*.tsx'],
'rules': {
'simple-import-sort/imports': [
'error',
{
'groups': [
// Packages `react` related packages come first.
['^react', '^@?\\w'],
// Internal packages.
['^(@|components)(/.*|$)'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Side effect imports.
['^\\u0000'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.?(css)$'],
],
},
],
},
},
],
}