-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
81 lines (81 loc) · 1.98 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
module.exports = {
rules: {
'max-len': [2, { code: 120, tabWidth: 2 }],
indent: [2, 'tab', { SwitchCase: 1, offsetTernaryExpressions: true }],
'no-nested-ternary': [2],
quotes: [2, 'single', { allowTemplateLiterals: true, avoidEscape: true }],
'linebreak-style': [2, 'unix'],
'no-unused-vars': [2, { vars: 'all', args: 'none' }],
'comma-dangle': [
'error',
{
arrays: 'never',
objects: 'never',
imports: 'never',
exports: 'never',
functions: 'never'
}
],
'eol-last': [2],
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }],
'no-trailing-spaces': [2],
'no-extra-parens': [2, 'functions'],
'comma-spacing': [2],
'space-infix-ops': [2],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}
],
'key-spacing': [2],
'keyword-spacing': [2],
curly: [2],
'brace-style': [2],
semi: ['error', 'always'],
eqeqeq: 1, // ===
'no-mixed-operators': 2, // + *
'class-methods-use-this': 2,
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
'no-restricted-syntax': 2, // for in
'guard-for-in': 2, // for in
'prefer-destructuring': 1,
'no-console': 2,
'no-restricted-globals': 2, // isNaN
'one-var': ['error', 'never'],
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 1,
'arrow-parens': ['error', 'always'],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
'prettier/prettier': [
'error',
{
useTabs: true,
trailingComma: 'none',
singleQuote: true,
printWidth: 120,
tabWidth: 2,
arrowParens: 'always'
}
]
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
es2020: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:security/recommended',
'plugin:node/recommended'
],
plugins: ['security', 'node', 'prettier']
};