-
Notifications
You must be signed in to change notification settings - Fork 42
/
.eslintrc.js
103 lines (102 loc) · 2.35 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
103
// https://eslint.org/docs/user-guide/configuring
module.exports = {
ignorePatterns: ['node_modules/', 'dist/', 'e2e'],
extends: [
'eslint:recommended',
'plugin:node/recommended-script',
'plugin:jest/recommended',
],
rules: {
'semi': ['error', 'always'],
'indent': ['error', 2],
'no-var': 0,
'prefer-rest-params': 0,
'prefer-spread': 0,
'prefer-const': 0,
'node/no-unpublished-require': 0,
'node/no-unpublished-import': 0,
'camelcase': 2,
'complexity': [2, 7],
'curly': 2,
'dot-notation': 0,
'guard-for-in': 2,
'new-cap': [2, { 'properties': false }],
'no-caller': 2,
'no-empty': 2,
'no-eval': 2,
'no-implied-eval': 2,
'no-multi-str': 0,
'no-new': 2,
'no-plusplus': 0,
'no-undef': 2,
'no-unused-expressions': [2, { 'allowShortCircuit': true, 'allowTernary': true }],
'no-unused-vars': 2,
'max-depth': [2, 3],
'max-len': [2, 150],
'max-params': [2, 5],
'max-statements': [2, 25],
'quotes': [2, 'single', { 'allowTemplateLiterals': true }],
'strict': 0,
'wrap-iife': [2, 'any'],
},
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: { 'jsx': true },
sourceType: 'module',
project: 'types/tsconfig.json'
},
env: {
es6: true,
node: false
},
plugins: ['@typescript-eslint'],
rules: {
'node/no-unsupported-features/es-syntax': 0,
'node/no-unsupported-features/node-builtins': 0
}
},
{
// ES6 processed by Babel
files: [
'*.js',
'*.test.js'
],
plugins: [
'node',
'jest',
],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
env: {
es6: true,
node: false
},
rules: {
'node/no-unsupported-features/es-syntax': 0,
'node/no-unsupported-features/node-builtins': 0
}
},
{
// Jest specs
files: ['*.test.js'],
plugins: [
'node',
'jest',
],
env: {
jest: true
}
}
]
};