-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy path.eslintrc.js
92 lines (90 loc) · 2 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
const BASE_EXTENDS = [
'airbnb-base',
'airbnb-typescript/base',
'plugin:jest/all',
'plugin:sonarjs/recommended',
];
module.exports = {
root: true,
extends: BASE_EXTENDS,
plugins: [
'sonarjs',
],
env: {
node: true,
},
ignorePatterns: [
'dist/**',
'.eslintrc.js',
'jest.config.js'
],
rules: {
'@typescript-eslint/naming-convention': 'off',
'implicit-arrow-linebreak': 0,
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'.eslint-bin/*.js',
'test/**/*.js',
],
},
],
'import/extensions': ['error', 'ignorePackages', {
js: 'never',
ts: 'never',
}],
'jest/max-expects': 'off',
'jest/max-nested-describe': 'off',
'jest/require-hook': 'off',
"jest/prefer-expect-assertions": [
"error",
{ "onlyFunctionsWithExpectInLoop": true, "onlyFunctionsWithExpectInCallback": true }
],
'no-param-reassign': 0,
'no-underscore-dangle': 0,
'sonarjs/cognitive-complexity': 1,
'sonarjs/no-collapsible-if': 0,
'sonarjs/no-duplicate-string': 0,
'sonarjs/no-extra-arguments': 0,
'sonarjs/no-identical-expressions': 0,
'sonarjs/no-identical-functions': 0,
'sonarjs/no-same-line-conditional': 0,
},
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.json', '.ts'],
},
},
'import/extensions': [
'.js',
'.ts',
],
},
overrides: [
{
files: ['*.ts'],
extends: [
...BASE_EXTENDS,
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
plugins: [
'sonarjs',
'@typescript-eslint',
],
rules: {
'import/extensions': ['error', 'ignorePackages', {
js: 'never',
ts: 'never',
}],
},
},
],
};