-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
87 lines (87 loc) · 2.19 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
module.exports = {
env: {
commonjs: true,
browser: false,
node: true,
},
"parser": "babel-eslint",
extends: [
"eslint:recommended",
"plugin:node/recommended",
"plugin:security/recommended",
"plugin:mocha/recommended"
],
parserOptions: {
ecmaVersion: 7,
sourceType: "script",
ecmaFeatures: {
"jsx": false,
},
},
rules: {
quotes: [
"error",
"double",
{ avoidEscape: true, allowTemplateLiterals: true }
],
"no-unused-vars": "warn",
"no-var": "error",
"no-console": "warn",
"no-debugger": "error",
"no-plusplus": "off",
"no-shadow": "off",
"vars-on-top": "off",
"no-underscore-dangle": "off", // var _foo;
"func-names": "off", // setTimeout(function () {}, 0);
"prefer-template": "off",
"no-nested-ternary": "off",
"max-classes-per-file": "off",
"consistent-return": "off",
"no-restricted-syntax": ["off", "ForOfStatement"], // disallow specified syntax(ex. WithStatement)
"prefer-arrow-callback": "off", // Require using arrow functions for callbacks
"require-await": "error",
//"arrow-parens": ["error", "as-needed"], // a => {}
"no-param-reassign": ["error", { props: false }],
"no-unused-expressions": [
"error",
{
allowTernary: true, // a || b
allowShortCircuit: true, // a ? b : 0
allowTaggedTemplates: true,
}
],
indent: ["error", 2, { SwitchCase: 1 }],
semi: ["error", "always"],
"comma-dangle": [
"error",
{
arrays: "never",
functions: "never",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
}
],
"eol-last": ["error", "always"],
"key-spacing": [
"error",
{
beforeColon: false,
afterColon: true,
}
],
"object-curly-spacing": [2, "always"],
"keyword-spacing": "error",
"no-multiple-empty-lines": "warn",
"space-before-function-paren": [
"error",
{
anonymous: "always",
named: "never",
asyncArrow: "always",
}
],
"mocha/no-skipped-tests": "error",
"mocha/no-exclusive-tests": "error",
},
};