forked from tronprotocol/tronweb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
78 lines (78 loc) · 2.3 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
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
},
globals: {
bootstrap: 'readonly',
ApexCharts: 'readonly',
moment: 'readonly',
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'eslint-config-prettier',
'plugin:sonarjs/recommended',
],
root: true,
parserOptions: {
ecmaVersion: 13,
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'sonarjs'],
rules: {
'linebreak-style': [2, 'unix'],
quotes: [1, 'single', 'avoid-escape'],
semi: [2, 'always'],
'max-len': [1, 120, 2, {ignoreUrls: true}],
'no-trailing-spaces': 2,
'no-multi-spaces': 2,
'array-bracket-spacing': 2,
'keyword-spacing': ['error', {after: true, before: true}],
'max-depth': [2, 7],
'max-statements': [2, 133],
complexity: [2, 45],
'no-eval': 2,
'no-underscore-dangle': 0,
'no-loop-func': 2,
'no-floating-decimal': 2,
eqeqeq: [2, 'smart'],
'new-cap': 2,
'no-empty': 0,
'space-infix-ops': 2,
'comma-dangle': [2, 'always-multiline'],
curly: [2, 'multi', 'consistent'],
'no-constant-condition': ['error', {checkLoops: false}],
'no-unused-vars': 0,
// sonarjs
'sonarjs/no-duplicate-string': 0, // to dumb to figure out literal types
// ts
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-empty-function': 0,
// FIXME: only temporary
'@typescript-eslint/no-this-alias': 0,
'sonarjs/cognitive-complexity': 0,
},
overrides: [
{
files: ['test/**/*.ts'],
env: {node: true, mocha: true},
rules: {
'max-len': 0,
'sonarjs/cognitive-complexity': 0,
},
},
{
files: ['scripts/*.js', './*'],
env: {node: true},
rules: {
'max-len': 0,
'@typescript-eslint/no-var-requires': 0,
},
},
],
};