@@ -16,103 +16,62 @@ ecmaFeatures:
16
16
17
17
rules:
18
18
# Possible Errors
19
- # list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
20
- ## Disallow Use of __proto__
21
- no-proto: 2
22
- ## disallow control characters in regular expressions
19
+ # https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
23
20
no-control-regex: 2
24
- ## check debugger sentence
25
21
no-debugger: 2
26
- ## check duplicate arguments
27
22
no-dupe-args: 2
28
- ## check duplicate object keys
29
23
no-dupe-keys: 2
30
- ## check duplicate switch-case
31
24
no-duplicate-case: 2
32
- ## disallow the use of empty character classes in regular expressions
33
25
no-empty-character-class: 2
34
- ## disallow assignment of exceptional params
35
26
no-ex-assign: 2
36
- ## disallow extra boolean casts
37
27
no-extra-boolean-cast : 2
38
- ## disallow superfluous semicolons
39
28
no-extra-semi: 2
40
- ## validate regular expressions
41
29
no-invalid-regexp: 2
42
- ## forbid weird whitespace characters
43
30
no-irregular-whitespace: 2
44
- ## avoid unexpected multiline expressions
31
+ no-proto: 2
45
32
no-unexpected-multiline: 2
46
- ## disallow unreachable code
47
33
no-unreachable: 2
48
- ## require valid typeof compared string like typeof foo === 'strnig'
49
34
valid-typeof: 2
50
35
51
36
# Best Practices
52
- # list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
53
- ## require falls through comment on switch-case
37
+ # https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
54
38
no-fallthrough: 2
55
- ## disallow declaring the same variable more than once
56
39
no-redeclare: 2
57
40
58
41
# Stylistic Issues
59
- # list: https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
60
- ## add space after comma
42
+ # https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
61
43
comma-spacing: 2
62
- ## require newline at end of files
63
44
eol-last: 2
64
- ## 2 space indentation
65
45
indent: [2, 2, {SwitchCase: 1}]
66
- ## max 80 length
67
46
max-len: [2, 80, 2]
68
- ## require parens for Constructor
69
47
new-parens: 2
70
- ## disallow mixed spaces and tabs for indentation
71
48
no-mixed-spaces-and-tabs: 2
72
- ## max 2 consecutive empty lines
73
49
no-multiple-empty-lines: [2, {max: 2}]
74
- ## no trailing spaces
75
50
no-trailing-spaces: 2
76
- ## use single quote, we can use double quote when escape chars
77
51
quotes: [2, "single", "avoid-escape"]
78
- ## put semi-colon
79
52
semi: 2
80
- ## require space after keywords, eg 'for (..)'
81
53
space-after-keywords: 2
82
- ## require space before blocks, eg 'function() {'
83
54
space-before-blocks: [2, "always"]
84
- ## no space before function, eg. 'function()'
85
55
space-before-function-paren: [2, "never"]
86
- ## no leading/trailing spaces in parens
87
56
space-in-parens: [2, "never"]
88
- ## require spaces operator like var sum = 1 + 1;
89
57
space-infix-ops: 2
90
- ## require spaces return, throw, case
91
58
space-return-throw-case: 2
92
- ## no spaces with non-word unary operators, require for word unary operators
93
59
space-unary-ops: 2
94
60
95
61
# ECMAScript 6
96
- # list: http://eslint.org/docs/rules/#ecmascript-6
97
- ## Suggest using 'const' wherever possible
98
- prefer-const: 2
99
- ## Enforce parens around arrow function arguments
62
+ # http://eslint.org/docs/rules/#ecmascript-6
100
63
arrow-parens: [2, "always"]
101
- ## Require a space on each side of arrow operator
102
64
arrow-spacing: [2, {"before": true, "after": true}]
103
- ## Prevent using => in a condition where <= is intended
104
65
no-arrow-condition: 2
66
+ prefer-const: 2
105
67
106
68
# Strict Mode
107
- # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
108
- ## 'use strict' on top
69
+ # https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
109
70
strict: [2, "global"]
110
71
111
72
# Variables
112
- # list: https://github.com/eslint/eslint/tree/master/docs/rules#variables
113
- ## disallow use of undefined variables (globals)
73
+ # https://github.com/eslint/eslint/tree/master/docs/rules#variables
114
74
no-undef: 2
115
- ## disallow declaration of variables that are not used in the code
116
75
no-unused-vars: [2, {"args": "none"}]
117
76
118
77
# Custom rules in tools/eslint-rules
0 commit comments