-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
112 lines (112 loc) · 3.71 KB
/
.eslintrc.js
File metadata and controls
112 lines (112 loc) · 3.71 KB
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
module.exports = {
root: true,
env: {
browser: true,
es6: true
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:sonarjs/recommended',
'plugin:unicorn/recommended',
'airbnb-base'
],
plugins: [
'import',
'no-loops',
'simple-import-sort',
'sonarjs',
'unicorn'
],
overrides: [
{
files: [
'.eslintrc.js',
'webpack.config.js'
],
env: {
node: true
},
rules: {
'unicorn/prefer-module': 'off' // eslint does not support ES modules usage in configuration files
}
},
{
files: ['src/**'],
plugins: [
'@typescript-eslint'
],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: '.',
sourceType: 'module'
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts']
},
'import/resolver': {
typescript: {
alwaysTryTypes: true
}
}
},
rules: {
'@typescript-eslint/member-delimiter-style': 'error',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/semi': 'error',
'no-shadow': 'off', // in favor of @typescript-eslint/no-shadow
semi: 'off', // in favor of @typescript-eslint/semi
'unicorn/prevent-abbreviations': [
'error', {
allowList: {
arg: true,
'i-have-adapter': true,
'i-have-endpoints': true,
params: true,
TParams: true
}
}
]
}
}
],
rules: {
'import/extensions': ['error', 'never'],
'import/no-extraneous-dependencies': [
'error', {
devDependencies: true
}
],
'import/order': 'off',
'import/prefer-default-export': 'off',
'no-loops/no-loops': 'error',
'unicorn/no-null': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'comma-dangle': ['error', 'never'],
'eol-last': ['error', 'never'],
indent: ['error', 4],
'max-classes-per-file': 'warn',
'max-len': ['error', 120],
'no-empty-function': 'off',
'no-trailing-spaces': 'error',
'no-useless-constructor': 'off',
quotes: ['error', 'single'],
'sort-imports': 'off', // in favor of simple-import-sort plugin
// forEach is not less readable when you are familiar to functional collection methods
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off' // not "in almost every case" reduce calls should be replaced with for loops
}
};