-
Notifications
You must be signed in to change notification settings - Fork 38
/
.eslintrc.json
101 lines (97 loc) · 3.24 KB
/
.eslintrc.json
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
{
"env": {
"browser": true,
"amd": true,
"jquery": true
},
"rules": {
//Possible Errors
"no-console": "error",
"no-unreachable-loop": "error",
//Best Practices
"complexity": "error",
"consistent-return": "error",
"curly": "error",
"default-case": "error",
"dot-location": ["warn", "property"],
"dot-notation": "warn",
"eqeqeq": ["error", "always"],
"guard-for-in": "error",
"no-alert": "error",
"no-caller": "error",
"no-else-return": "error",
"no-empty-function": "error",
"no-eval": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-magic-numbers": ["warn", { "ignore": [-1, 0, 1], "ignoreArrayIndexes": true }],
"no-new-wrappers": "error",
"no-return-assign": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-warning-comments": "warn",
"radix": ["error", "always"],
"wrap-iife": ["error", "any"],
"yoda": "error",
// strict mode
"strict": ["error", "safe"],
//Variables
"no-label-var": "error",
"no-unused-vars": "warn",
//Stylistic
"array-bracket-newline": ["warn", "consistent"],
// "array-bracket-spacing": ["error", "always", { "singleValue": false }],
"block-spacing": "warn",
"brace-style": "warn",
"camelcase": "warn",
"comma-spacing": "warn",
"comma-style": "warn",
"eol-last": "warn",
"func-call-spacing": "warn",
//maybe not the best idea ?:/
"func-name-matching": "warn",
"func-names": ["warn", "as-needed"], //would be nice to debug without anonymous
"id-denylist": ["warn", "data", "err", "e", "callback"],
"indent": "warn",
"key-spacing": "warn",
"keyword-spacing": "warn",
"linebreak-style": "warn",
"max-depth": "warn",
"max-len": "warn",
// "max-lines-per-function" seems only to be usefull to find long functions ...
// "max-lines-per-function": "off",
"max-nested-callbacks": ["warn", 3],
"max-statements-per-line": ["warn", { "max": 1 }],
"newline-per-chained-call": ["warn", {"ignoreChainWithDepth": 1}],
"no-array-constructor": "warn",
"no-lonely-if": "warn",
"no-mixed-operators": "warn",
"no-multi-assign": "warn",
"no-multiple-empty-lines": "warn",
"no-negated-condition": "warn",
"no-new-object": "warn",
"no-trailing-spaces": "warn",
"no-unneeded-ternary": "warn",
"no-whitespace-before-property": "warn",
"object-curly-newline": ["error", {
"ObjectExpression": {"consistent": true},
"ObjectPattern": { "consistent": true },
"ImportDeclaration": "never",
"ExportDeclaration": { "multiline": true, "minProperties": 3 }
}],
"object-curly-spacing":["warn", "never"],
"operator-linebreak": "warn",
"quote-props": ["warn", "consistent"], //should be "as-needed"
"quotes": ["warn", "single", { "avoidEscape": true }],
"semi": ["warn", "always", { "omitLastInOneLineBlock": true}],
"semi-style": "warn",
"space-before-blocks": "warn",
"space-before-function-paren": "warn",
"space-infix-ops": "warn",
"space-unary-ops": "error"
}
}