-
-
Notifications
You must be signed in to change notification settings - Fork 601
/
.eslintrc.yaml
113 lines (105 loc) · 2.87 KB
/
.eslintrc.yaml
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
extends:
- "eslint:recommended"
- "jquery"
- "plugin:prettier/recommended"
# Accept `window`, etc.
env:
browser: true
# Known globals (`false`: read-only)
globals:
define: false
require: false
module: false
jQuery: false
# Custom rules (see https://eslint.org/docs/rules/ )
# 0:off, 1:warn, 2:error
rules:
# --- Best Practices ---------------------------------------------------------
block-scoped-var: warn
# complexity: [warn, 20]
# consistent-return: warn
no-alert: error
no-caller: error
guard-for-in: warn
# linebreak-style: warn
no-else-return: warn
# no-empty-function: warn
no-extend-native: error
no-eval: error
no-floating-decimal: error
no-implied-eval: error
# no-invalid-this: warn
no-labels: warn
no-lone-blocks: warn
no-loop-func: warn
no-new: error
no-new-func: warn
no-new-wrappers: warn
no-octal-escape: warn
no-return-assign: warn
no-script-url: warn
no-self-compare: warn
no-sequences: warn
no-throw-literal: error
no-unmodified-loop-condition: warn
no-unused-expressions: error
# Not enabled because we want to allow `self._superApply(self, args)`:
# no-useless-call: warn
no-useless-catch: warn
no-useless-return: warn
no-with: warn
prefer-promise-reject-errors: warn
radix: error
# vars-on-top: warn
wrap-iife:
- error
- any
yoda: warn
# --- Strict Mode ------------------------------------------------------------
# strict: error
# --- Variables --------------------------------------------------------------
# init-declarations: ["warn", "always"]
no-label-var: error
# no-shadow: warn
no-shadow-restricted-names: error
no-undef: error
no-undef-init: warn
# no-undefined: warn
no-use-before-define: error
# - error
# - functions: false
# --- Stylistic Issues -------------------------------------------------------
camelcase: error
# Not enabled because sometimes we set `node = this`:
# consistent-this: [warn, self] # use `self = this`
func-name-matching: warn
new-cap:
- error
- { "capIsNewExceptionPattern": "^\\$\\.." } # Allow `d = $.Deferred()`
no-bitwise: error
# no-multi-assign: warn
no-negated-condition: warn
no-unneeded-ternary: warn
no-new-object: error
one-var: # see also no-use-before-define
- warn
- consecutive
# one-var-declaration-per-line: warn
# --- Possible Errors --------------------------------------------------------
curly: error
eqeqeq: ["error", "always", {"null": "ignore"}]
no-cond-assign:
- error
- except-parens
no-constant-condition:
- error
- { "checkLoops": false }
no-empty:
- error
- {allowEmptyCatch: true}
# no-extra-parens: [warn, all, {conditionalAssign: false }]
no-nested-ternary: warn
no-unused-vars:
- error
# Allow unused vars in catch() and if start with '_'
- {args: none, caughtErrors: none, varsIgnorePattern: "^_" }