-
Notifications
You must be signed in to change notification settings - Fork 111
/
.eslintrc.js
77 lines (75 loc) · 2.01 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
const sharedRules = {
'consistent-return': 0,
'no-underscore-dangle': 0,
'import/prefer-default-export': 0,
'import/extensions': ['error', 'never', { json: 'always' }],
'func-names': 0,
'no-param-reassign': 0,
'prefer-destructuring': ['error', { object: true, array: false }],
'max-classes-per-file': 0,
'no-plusplus': 0,
'sonarjs/cognitive-complexity': 0,
'sonarjs/no-collapsible-if': 0,
'sonarjs/no-duplicate-string': 0,
'sonarjs/no-identical-functions': 0,
'class-methods-use-this': 0,
};
const settings = {
'import/resolver': {
node: { extensions: ['.js', '.ts'] },
},
};
module.exports = {
root: true,
plugins: ['prettier', 'chai-friendly'],
extends: [
'airbnb-base',
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:sonarjs/recommended',
'plugin:chai-friendly/recommended',
],
parser: '@babel/eslint-parser',
env: {
es6: true,
browser: true,
commonjs: true,
mocha: true,
},
globals: {
process: true,
},
settings,
rules: sharedRules,
overrides: [
{
files: ['**/*.ts'],
plugins: ['prettier', '@typescript-eslint', 'typescript-sort-keys'],
extends: [
'airbnb-base',
'eslint:recommended',
'plugin:prettier/recommended',
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:sonarjs/recommended',
],
parser: '@typescript-eslint/parser',
settings,
rules: {
...sharedRules,
camelcase: 0,
'lines-between-class-members': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/ban-ts-comment': 0,
'no-useless-constructor': 0,
'@typescript-eslint/triple-slash-reference': 0,
'typescript-sort-keys/interface': [
'error',
'asc',
{ caseSensitive: false, natural: true, requiredFirst: true },
],
'typescript-sort-keys/string-enum': ['error', 'asc', { caseSensitive: false, natural: true }],
},
},
],
};