-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
102 lines (101 loc) · 2.8 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
93
94
95
96
97
98
99
100
101
102
module.exports = {
'env': {
'es6': true
},
'extends': 'eslint:recommended',
'globals': {
'process': true
},
'settings': {
'import/resolver': {
'node': {
'extensions': ['.js', '.jsx', '.ts', '.tsx']
}
}
},
'parser': '@typescript-eslint/parser',
'parserOptions': {
'sourceType': 'module',
'ecmaFeatures': {
'modules': true
}
},
'plugins': [
'@typescript-eslint',
'@typescript-eslint/tslint',
'eslint-plugin-import'
],
'rules': {
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
'@typescript-eslint/indent': ['error', 4],
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/quotes': [
'error',
'single'
],
"max-classes-per-file": ['warn', 1],
'comma-dangle': 'error',
'curly': 'error',
'eqeqeq': [
'error',
'always'
],
'no-trailing-spaces': 'error',
'no-var': 'error',
'prefer-const': 'error',
'no-console': 'error',
'no-throw-literal': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-cycle': 'warn',
'import/no-self-import': 'error',
'import/no-unresolved': 'error',
'no-undef': 'off',
'no-unused-vars': 'off',
'id-length': [2, { 'exceptions': 'ij'.split(''), 'properties': 'never' }],
'space-before-blocks': 'error',
'keyword-spacing': 'error',
'space-before-function-paren': 'error',
'camelcase': ['error', { ignoreDestructuring: true }],
'semi': 'error',
'no-underscore-dangle': ['error', { 'allow': ['_id', '__history'] }],
'no-duplicate-imports': 'error',
},
'overrides': [{
'files': ['*.ts', '*.tsx'],
'parserOptions': {
'project': 'tsconfig.json',
'sourceType': 'module',
'ecmaFeatures': {
'modules': true
}
},
'rules': {
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
'no-undef': 'off'
},
'env': {
'es6': true,
'node': true
}
}, {
'files': ['test/*.js'],
'parserOptions': {
'ecmaVersion': 6,
'sourceType': 'module',
'ecmaFeatures': {
'modules': true
}
},
'env': {
'es6': true,
'mocha': true,
'node': true
},
'rules': {
// Added since depending on src breaks blackbox testing
'no-restricted-imports': ['warn', {
'patterns': ['../src/*'],
}],
}
}]
};