This repository has been archived by the owner on Aug 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
168 lines (167 loc) · 5.44 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['react', 'react-hooks', 'jsx-a11y', '@typescript-eslint'],
ignorePatterns: ['**/dist', '**/.eslintrc.*', '**/.*rc.js', '**/*.config.js'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:typescript-sort-keys/recommended',
'prettier',
],
settings: {
react: {
version: 'detect',
},
formComponents: ['Form'],
linkComponents: [
// Components used as alternatives to <a> for linking, eg. <Link to={ url } />
{ name: 'Link', linkAttribute: 'to' },
'Button',
],
},
rules: {
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
alphabetize: { order: 'asc' },
'newlines-between': 'always',
pathGroups: [
{
pattern: '@src/**',
group: 'internal',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
'import/first': 'error',
'import/newline-after-import': 'warn',
'import/no-duplicates': 'error',
'import/named': 'off',
'import/namespace': 'off',
'import/no-unused-modules': ['warn' /* , { unusedExports: true } */],
'import/no-extraneous-dependencies': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ ignoreRestSiblings: true, argsIgnorePattern: '^_|e$', varsIgnorePattern: '^_|e$' },
],
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/unified-signatures': 'error',
camelcase: 'off',
complexity: 'warn',
'constructor-super': 'error',
curly: ['error', 'multi-line'],
'dot-notation': 'error',
'eol-last': 'off',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'id-blacklist': ['error', 'Undefined'],
'id-match': 'error',
'linebreak-style': ['warn', 'unix'],
'max-classes-per-file': 'off',
'max-len': 'off',
'new-parens': 'off',
'newline-per-chained-call': 'off',
'no-bitwise': 'off',
'no-caller': 'error',
'no-case-declarations': 'off',
'no-cond-assign': 'error',
'no-console': 'warn',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-debugger': 'warn',
'no-empty': 'off',
'no-eval': 'error',
'no-extra-semi': 'warn',
'no-extra-boolean-cast': 'off',
'no-fallthrough': 'warn',
'no-invalid-regexp': 'error',
'no-multiple-empty-lines': 'off',
'no-new-wrappers': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-regex-spaces': 'error',
'no-restricted-syntax': ['error', 'ForInStatement'],
'no-shadow': [
'off',
{
hoist: 'all',
},
],
'no-throw-literal': 'error',
'no-trailing-spaces': 'off',
'no-undef-init': 'error',
'no-underscore-dangle': 'off',
'no-unsafe-finally': 'error',
'no-unused-labels': 'error',
'no-unused-vars': 'off',
'no-warning-comments': ['error', { terms: ['fixme'], location: 'start' }],
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'padding-line-between-statements': [
'warn',
{ blankLine: 'always', prev: ['const', 'let', 'var', 'multiline-block-like'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var', 'if'], next: ['const', 'let', 'var', 'if', 'return'] },
],
'prefer-arrow-callback': 'error',
'quote-props': 'off',
radix: 'error',
'space-before-function-paren': 'off',
'space-in-parens': ['off', 'never'],
'spaced-comment': ['warn', 'always', { markers: ['/'] }],
// 'sort-imports': [
// 'warn',
// { ignoreCase: true, allowSeparatedGroups: true, memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'] },
// ],
'typescript-sort-keys/interface': 'warn',
'typescript-sort-keys/string-enum': 'off',
'use-isnan': 'error',
'valid-typeof': 'off',
'react/prop-types': 'off',
'react/display-name': 'off',
'react/no-unescaped-entities': 'off',
'react/jsx-no-literals': 'warn',
'react-hooks/exhaustive-deps': [
'warn',
{
additionalHooks: '(useLazy|useLazyCallback)',
},
],
'react/react-in-jsx-scope': 'off',
'jsx-a11y/accessible-emoji': 'warn',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/anchor-is-valid': 'warn',
'jsx-a11y/media-has-caption': 'off',
},
};