-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.cjs
66 lines (57 loc) · 1.88 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
const eslintConfig = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'import'],
extends: [
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'prettier',
'plugin:prettier/recommended',
],
rules: {
'prefer-template': 'error',
'no-nested-ternary': 'error',
'no-unneeded-ternary': 'error',
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': 'allow-with-description' }],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true }],
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/restrict-template-expressions': 'off',
'import/no-default-export': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
overrides: [
{
files: ['example/**/*'],
rules: {
'import/no-default-export': 'off',
},
},
],
// ESlint default behavior ignores file/folders starting with "." - https://github.com/eslint/eslint/issues/10341
ignorePatterns: ['!.*', 'bin', 'dist', 'node_modules'],
settings: {
'import/resolver': {
typescript: { project: 'tsconfig.json' },
},
},
};
module.exports = eslintConfig;