-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
149 lines (149 loc) · 3.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
/* eslint-disable filenames-simple/naming-convention */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:eslint-plugin/recommended',
'airbnb-base',
],
parserOptions: {
ecmaVersion: 'latest',
},
plugins: [
'filenames-simple',
'unused-imports',
'import',
'modules-newlines',
],
env: {
node: true,
},
rules: {
'filenames-simple/naming-convention': ['error', { rule: 'kebab-case' }],
'unused-imports/no-unused-imports': 'error',
'comma-dangle': ['error', 'always-multiline'],
indent: ['error', 2],
'brace-style': 'error',
semi: ['error', 'always'],
quotes: ['error', 'single', { avoidEscape: true }],
'object-property-newline': 'error',
'max-len': ['error', 150],
'object-curly-spacing': ['error', 'always'],
'modules-newlines/import-declaration-newline': 'error',
'modules-newlines/export-declaration-newline': 'error',
'object-curly-newline': ['error', {
ObjectExpression: {
multiline: true,
minProperties: 2,
consistent: true,
},
ObjectPattern: {
multiline: true,
minProperties: 2,
},
ImportDeclaration: {
multiline: true,
consistent: true,
},
ExportDeclaration: {
multiline: true,
minProperties: 2,
consistent: true,
},
}],
'import/no-duplicates': ['error'],
'import/order': ['error', {
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'never',
pathGroupsExcludedImportTypes: ['builtin'],
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
}],
'@typescript-eslint/consistent-type-imports': ['error', {
fixStyle: 'inline-type-imports',
}],
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'import/no-extraneous-dependencies': 'off',
'prefer-destructuring': 'off',
'linebreak-style': ['error', 'unix'],
complexity: ['error', 10],
'import/no-unresolved': 'error',
},
ignorePatterns: [
'dist',
],
overrides: [
{
files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.eslint.json'],
},
extends: [
'plugin:@typescript-eslint/recommended',
],
rules: {
'@typescript-eslint/consistent-type-exports': ['error', {
fixMixedExportsWithInlineTypeSpecifier: true,
}],
},
},
{
files: ['tests/**/*'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['**/*.test.ts'],
extends: [
'plugin:vitest/all',
],
},
{
files: ['./src/rules/**/index.test.ts'],
rules: {
'vitest/require-hook': 'off',
},
},
{
files: ['./src/rules/*/index.ts'],
rules: {
'max-len': 'off',
},
},
{
files: ['scripts/**/*'],
rules: {
'no-console': 'off',
},
},
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': [
'.ts',
'.tsx',
],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: '<root>/tsconfig.eslint.json',
},
},
},
};