-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
117 lines (112 loc) · 3.88 KB
/
.eslintrc
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"root": true,
"parserOptions": {
"ecmaVersion": 6,
"impliedStrict": true,
"parser": "babel-eslint",
"sourceType": "module"
},
"env": {
"browser": true,
"jquery": true,
"node": true
},
"globals": {},
"extends": ["eslint:recommended", "plugin:compat/recommended"],
"rules": {
"strict": ["error", "safe"],
/* possible errors */
"no-cond-assign": ["error", "except-parens"], // recommended
// "no-debugger": "error", // recommended
"no-empty": ["error", { "allowEmptyCatch": true }], // recommended
"no-unsafe-negation": "error",
"valid-jsdoc": "error",
/* best practice */
"curly": ["error", "all"],
"dot-location": ["warn", "property"],
"dot-notation": ["error", { "allowKeywords": true }],
"eqeqeq": ["warn", "smart"],
"guard-for-in": "error",
"no-alert": "warn",
"no-caller": "error",
"no-eq-null": "off",
"no-eval": "off",
"no-floating-decimal": "error",
"no-loop-func": "error",
"no-multi-spaces": ["error", { "exceptions": { "VariableDeclarator": true } }],
"no-multi-str": "error",
"no-param-reassign": "warn",
"no-script-url": "off",
"no-sequences": "error",
"no-unused-expressions": "warn",
"no-useless-call": "error",
"no-useless-escape": "error",
"no-useless-return": "error",
"no-void": "error",
"require-await": "warn",
"vars-on-top": "error",
"wrap-iife": ["error", "inside"],
"yoda": "error",
/* variables */
// "init-declarations": ["error", "never", { "ignoreForLoopInit": true }],
"no-undef": "error", // recommended
"no-undef-init": "error",
"no-undefined": "off",
"no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }], // recommended
"no-use-before-define": ["error", { "functions": false }],
/* Code Style */
"array-bracket-spacing": ["error", "never", {}],
"block-spacing": "error",
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": ["warn", { "properties": "always" }],
"comma-dangle": ["error", "never"],
"comma-spacing": ["error", { "before": false, "after": true }],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"eol-last": "error",
"func-call-spacing": ["error", "never"],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"keyword-spacing": ["error", {}],
"linebreak-style": ["error", "unix"],
"max-lines": ["warn", { "max": 500, "skipBlankLines": true, "skipComments": true }],
"max-nested-callbacks": ["warn", 10],
"max-params": ["warn", 5],
"new-parens": "error",
"no-bitwise": "error",
"no-lonely-if": "error",
"no-multiple-empty-lines": "error",
"no-plusplus": "off",
"no-trailing-spaces": "error",
"no-whitespace-before-property": "error",
"one-var": ["error", "never"],
"one-var-declaration-per-line": ["error", "always"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"require-jsdoc": [
"error",
{ "require": { "FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": true } }
],
"semi": ["error", "always"],
"semi-spacing": ["error", { "before": false, "after": true }],
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["warn", { "anonymous": "always", "named": "never" }],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": false, "nonwords": false }],
"spaced-comment": ["error", "always"],
"template-tag-spacing": "error",
"wrap-regex": "error",
/* ECMAScript 6 */
"arrow-body-style": ["error", "always"],
"arrow-parens": ["error", "always"],
"arrow-spacing": "error",
"no-duplicate-imports": "error",
"no-new": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-var": "warn",
"no-with": "error",
"prefer-const": "error",
"sort-imports": ["error", { "ignoreCase": true }],
"template-curly-spacing": "error"
}
}