-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
111 lines (111 loc) · 3.67 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
module.exports = {
ignorePatterns: ['.eslintrc.js'],
parserOptions: {
parser: '@typescript-eslint/parser',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
ecmaVersion: 2021,
},
plugins: ['@typescript-eslint', 'prettier', 'import', 'unused-imports'], // Merged plugins from both files
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
// TODO: Extend from these configurations once upgrading to typescript-eslint v6+
//'plugin:@typescript-eslint/recommended-type-checked',
//'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/lines-between-class-members': [
'warn',
'always',
{ exceptAfterSingleLine: true },
],
'padding-line-between-statements': 'off',
'@typescript-eslint/padding-line-between-statements': [
'warn',
{ blankLine: 'any', prev: 'import', next: '*' }, // handled by sort-imports
{ blankLine: 'any', prev: '*', next: 'singleline-const' },
{ blankLine: 'any', prev: '*', next: 'singleline-let' },
{ blankLine: 'any', prev: '*', next: 'singleline-var' },
{ blankLine: 'always', prev: '*', next: 'block-like' },
{ blankLine: 'always', prev: '*', next: 'multiline-block-like' },
{ blankLine: 'always', prev: '*', next: 'multiline-expression' },
{ blankLine: 'always', prev: '*', next: 'multiline-const' },
{ blankLine: 'always', prev: '*', next: 'multiline-let' },
{ blankLine: 'always', prev: '*', next: 'multiline-var' },
{ blankLine: 'always', prev: '*', next: 'export' },
{ blankLine: 'always', prev: 'block-like', next: '*' },
{ blankLine: 'always', prev: 'multiline-block-like', next: '*' },
{ blankLine: 'always', prev: 'multiline-expression', next: '*' },
{ blankLine: 'always', prev: 'multiline-const', next: '*' },
{ blankLine: 'always', prev: 'multiline-let', next: '*' },
{ blankLine: 'always', prev: 'multiline-var', next: '*' },
],
'prettier/prettier': [
'warn',
{
endOfLine: 'auto',
trailingComma: 'all',
},
],
'unused-imports/no-unused-imports': 'warn',
'sort-imports': [
'warn',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: false,
},
],
'import/no-unresolved': 'error',
'import/newline-after-import': 'warn',
'import/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
['sibling', 'parent'],
'index',
'unknown',
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
settings: {
'import/resolver': {
typescript: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
};