Skip to content

Commit 7d7da98

Browse files
refackaddaleax
authored andcommitted
tools: eslint - use error and off
PR-URL: #14061 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent f393304 commit 7d7da98

File tree

6 files changed

+138
-138
lines changed

6 files changed

+138
-138
lines changed

.eslintrc.yaml

+97-97
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,39 @@ parserOptions:
1313
rules:
1414
# Possible Errors
1515
# http://eslint.org/docs/rules/#possible-errors
16-
no-control-regex: 2
17-
no-debugger: 2
18-
no-dupe-args: 2
19-
no-dupe-keys: 2
20-
no-duplicate-case: 2
21-
no-empty-character-class: 2
22-
no-ex-assign: 2
23-
no-extra-boolean-cast: 2
24-
no-extra-parens: [2, functions]
25-
no-extra-semi: 2
26-
no-func-assign: 2
27-
no-invalid-regexp: 2
28-
no-irregular-whitespace: 2
29-
no-obj-calls: 2
30-
no-template-curly-in-string: 2
31-
no-unexpected-multiline: 2
32-
no-unreachable: 2
33-
no-unsafe-negation: 2
34-
use-isnan: 2
35-
valid-typeof: 2
16+
no-control-regex: error
17+
no-debugger: error
18+
no-dupe-args: error
19+
no-dupe-keys: error
20+
no-duplicate-case: error
21+
no-empty-character-class: error
22+
no-ex-assign: error
23+
no-extra-boolean-cast: error
24+
no-extra-parens: [error, functions]
25+
no-extra-semi: error
26+
no-func-assign: error
27+
no-invalid-regexp: error
28+
no-irregular-whitespace: error
29+
no-obj-calls: error
30+
no-template-curly-in-string: error
31+
no-unexpected-multiline: error
32+
no-unreachable: error
33+
no-unsafe-negation: error
34+
use-isnan: error
35+
valid-typeof: error
3636

3737
# Best Practices
3838
# http://eslint.org/docs/rules/#best-practices
39-
dot-location: [2, property]
40-
eqeqeq: [2, smart]
41-
no-fallthrough: 2
42-
no-global-assign: 2
43-
no-multi-spaces: [2, {ignoreEOLComments: true}]
44-
no-octal: 2
45-
no-proto: 2
46-
no-redeclare: 2
39+
dot-location: [error, property]
40+
eqeqeq: [error, smart]
41+
no-fallthrough: error
42+
no-global-assign: error
43+
no-multi-spaces: [error, {ignoreEOLComments: true}]
44+
no-octal: error
45+
no-proto: error
46+
no-redeclare: error
4747
no-restricted-properties:
48-
- 2
48+
- error
4949
- object: assert
5050
property: deepEqual
5151
message: Use assert.deepStrictEqual().
@@ -59,71 +59,71 @@ rules:
5959
message: __defineGetter__ is deprecated.
6060
- property: __defineSetter__
6161
message: __defineSetter__ is deprecated.
62-
no-self-assign: 2
63-
no-throw-literal: 2
64-
no-unused-labels: 2
65-
no-useless-call: 2
66-
no-useless-concat: 2
67-
no-useless-escape: 2
68-
no-useless-return: 2
69-
no-void: 2
70-
no-with: 2
62+
no-self-assign: error
63+
no-throw-literal: error
64+
no-unused-labels: error
65+
no-useless-call: error
66+
no-useless-concat: error
67+
no-useless-escape: error
68+
no-useless-return: error
69+
no-void: error
70+
no-with: error
7171

7272
# Strict Mode
7373
# http://eslint.org/docs/rules/#strict-mode
74-
strict: [2, global]
74+
strict: [error, global]
7575

7676
# Variables
7777
# http://eslint.org/docs/rules/#variables
78-
no-delete-var: 2
79-
no-undef: 2
80-
no-unused-vars: [2, {args: none}]
81-
no-use-before-define: [2, {classes: true,
82-
functions: false,
83-
variables: false}]
78+
no-delete-var: error
79+
no-undef: error
80+
no-unused-vars: [error, {args: none}]
81+
no-use-before-define: [error, {classes: true,
82+
functions: false,
83+
variables: false}]
8484

8585
# Node.js and CommonJS
8686
# http://eslint.org/docs/rules/#nodejs-and-commonjs
87-
no-mixed-requires: 2
88-
no-new-require: 2
89-
no-path-concat: 2
90-
no-restricted-modules: [2, sys]
87+
no-mixed-requires: error
88+
no-new-require: error
89+
no-path-concat: error
90+
no-restricted-modules: [error, sys]
9191

9292
# Stylistic Issues
9393
# http://eslint.org/docs/rules/#stylistic-issues
94-
block-spacing: 2
95-
brace-style: [2, 1tbs, {allowSingleLine: true}]
96-
comma-dangle: [2, only-multiline]
97-
comma-spacing: 2
98-
comma-style: 2
99-
computed-property-spacing: 2
100-
eol-last: 2
101-
func-call-spacing: 2
102-
func-name-matching: 2
103-
func-style: [2, declaration, {allowArrowFunctions: true}]
104-
# indent: [2, 2, {ArrayExpression: first,
94+
block-spacing: error
95+
brace-style: [error, 1tbs, {allowSingleLine: true}]
96+
comma-dangle: [error, only-multiline]
97+
comma-spacing: error
98+
comma-style: error
99+
computed-property-spacing: error
100+
eol-last: error
101+
func-call-spacing: error
102+
func-name-matching: error
103+
func-style: [error, declaration, {allowArrowFunctions: true}]
104+
# indent: [error, error, {ArrayExpression: first,
105105
# CallExpression: {arguments: first},
106106
# FunctionDeclaration: {parameters: first},
107107
# FunctionExpression: {parameters: first},
108108
# MemberExpression: off,
109109
# ObjectExpression: first,
110110
# SwitchCase: 1}]
111-
indent-legacy: [2, 2, {ArrayExpression: first,
111+
indent-legacy: [error, 2, {ArrayExpression: first,
112112
CallExpression: {arguments: first},
113113
MemberExpression: 1,
114114
ObjectExpression: first,
115115
SwitchCase: 1}]
116-
key-spacing: [2, {mode: minimum}]
117-
keyword-spacing: 2
118-
linebreak-style: [2, unix]
119-
max-len: [2, {code: 80,
116+
key-spacing: [error, {mode: minimum}]
117+
keyword-spacing: error
118+
linebreak-style: [error, unix]
119+
max-len: [error, {code: 80,
120120
ignoreRegExpLiterals: true,
121121
ignoreUrls: true,
122122
tabWidth: 2}]
123-
new-parens: 2
124-
no-mixed-spaces-and-tabs: 2
125-
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}]
126-
no-restricted-syntax: [2, {
123+
new-parens: error
124+
no-mixed-spaces-and-tabs: error
125+
no-multiple-empty-lines: [error, {max: 2, maxEOF: 0, maxBOF: 0}]
126+
no-restricted-syntax: [error, {
127127
selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
128128
message: "setTimeout() must be invoked with at least two arguments."
129129
}, {
@@ -133,43 +133,43 @@ rules:
133133
selector: "ThrowStatement > CallExpression[callee.name=/Error$/]",
134134
message: "Use new keyword when throwing an Error."
135135
}]
136-
no-tabs: 2
137-
no-trailing-spaces: 2
138-
one-var-declaration-per-line: 2
139-
operator-linebreak: [2, after]
140-
quotes: [2, single, avoid-escape]
141-
semi: 2
142-
semi-spacing: 2
143-
space-before-blocks: [2, always]
144-
space-before-function-paren: [2, {
136+
no-tabs: error
137+
no-trailing-spaces: error
138+
one-var-declaration-per-line: error
139+
operator-linebreak: [error, after]
140+
quotes: [error, single, avoid-escape]
141+
semi: error
142+
semi-spacing: error
143+
space-before-blocks: [error, always]
144+
space-before-function-paren: [error, {
145145
"anonymous": "never",
146146
"named": "never",
147147
"asyncArrow": "always"
148148
}]
149-
space-in-parens: [2, never]
150-
space-infix-ops: 2
151-
space-unary-ops: 2
152-
unicode-bom: 2
149+
space-in-parens: [error, never]
150+
space-infix-ops: error
151+
space-unary-ops: error
152+
unicode-bom: error
153153

154154
# ECMAScript 6
155155
# http://eslint.org/docs/rules/#ecmascript-6
156-
arrow-parens: [2, always]
157-
arrow-spacing: [2, {before: true, after: true}]
158-
constructor-super: 2
159-
no-class-assign: 2
160-
no-confusing-arrow: 2
161-
no-const-assign: 2
162-
no-dupe-class-members: 2
163-
no-new-symbol: 2
164-
no-this-before-super: 2
165-
prefer-const: [2, {ignoreReadBeforeAssign: true}]
166-
rest-spread-spacing: 2
167-
template-curly-spacing: 2
156+
arrow-parens: [error, always]
157+
arrow-spacing: [error, {before: true, after: true}]
158+
constructor-super: error
159+
no-class-assign: error
160+
no-confusing-arrow: error
161+
no-const-assign: error
162+
no-dupe-class-members: error
163+
no-new-symbol: error
164+
no-this-before-super: error
165+
prefer-const: [error, {ignoreReadBeforeAssign: true}]
166+
rest-spread-spacing: error
167+
template-curly-spacing: error
168168

169169
# Custom rules in tools/eslint-rules
170-
align-multiline-assignment: 2
171-
assert-throws-arguments: [2, { requireTwo: true }]
172-
no-unescaped-regexp-dot: 2
170+
align-multiline-assignment: error
171+
assert-throws-arguments: [error, { requireTwo: true }]
172+
no-unescaped-regexp-dot: error
173173

174174
# Global scoped method and vars
175175
globals:

benchmark/.eslintrc.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
rules:
44
# Stylistic Issues
55
# http://eslint.org/docs/rules/#stylistic-issues
6-
indent: [2, 2, {ArrayExpression: first,
7-
CallExpression: {arguments: first},
8-
FunctionDeclaration: {parameters: first},
9-
FunctionExpression: {parameters: first},
10-
MemberExpression: off,
11-
ObjectExpression: first,
12-
SwitchCase: 1}]
13-
indent-legacy: 0
6+
indent: [error, 2, {ArrayExpression: first,
7+
CallExpression: {arguments: first},
8+
FunctionDeclaration: {parameters: first},
9+
FunctionExpression: {parameters: first},
10+
MemberExpression: off,
11+
ObjectExpression: first,
12+
SwitchCase: 1}]
13+
indent-legacy: off

doc/.eslintrc.yaml

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
## Docs-specific linter rules
22

33
rules:
4-
object-curly-spacing: [2, always]
4+
object-curly-spacing: [error, always]
55

66
# ease some restrictions in doc examples
7-
no-restricted-properties: 0
8-
no-undef: 0
9-
no-unused-vars: 0
10-
strict: 0
7+
no-restricted-properties: off
8+
no-undef: off
9+
no-unused-vars: off
10+
strict: off
1111

1212
# add new ECMAScript features gradually
13-
no-var: 2
14-
prefer-const: 2
15-
prefer-rest-params: 2
13+
no-var: error
14+
prefer-const: error
15+
prefer-rest-params: error
1616

1717
# use stricter indent over indent-legacy
18-
indent-legacy: 0
19-
indent: [2, 2, {ArrayExpression: first,
20-
CallExpression: {arguments: first},
21-
FunctionDeclaration: {parameters: first},
22-
FunctionExpression: {parameters: first},
23-
MemberExpression: off,
24-
ObjectExpression: first,
25-
SwitchCase: 1}]
18+
indent-legacy: off
19+
indent: [error, 2, {ArrayExpression: first,
20+
CallExpression: {arguments: first},
21+
FunctionDeclaration: {parameters: first},
22+
FunctionExpression: {parameters: first},
23+
MemberExpression: off,
24+
ObjectExpression: first,
25+
SwitchCase: 1}]

lib/.eslintrc.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rules:
22
# Custom rules in tools/eslint-rules
3-
require-buffer: 2
4-
buffer-constructor: 2
5-
no-let-in-for-declaration: 2
3+
require-buffer: error
4+
buffer-constructor: error
5+
no-let-in-for-declaration: error

test/.eslintrc.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
rules:
44
# ECMAScript 6
55
# http://eslint.org/docs/rules/#ecmascript-6
6-
no-var: 2
7-
prefer-const: 2
6+
no-var: error
7+
prefer-const: error
88

99
# Custom rules in tools/eslint-rules
10-
prefer-assert-iferror: 2
11-
prefer-assert-methods: 2
12-
prefer-common-mustnotcall: 2
10+
prefer-assert-iferror: error
11+
prefer-assert-methods: error
12+
prefer-common-mustnotcall: error
1313
## common module is mandatory in tests
14-
required-modules: [2, common]
14+
required-modules: [error, common]

tools/.eslintrc.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
rules:
44
# Stylistic Issues
55
# http://eslint.org/docs/rules/#stylistic-issues
6-
indent: [2, 2, {ArrayExpression: first,
7-
CallExpression: {arguments: first},
8-
FunctionDeclaration: {parameters: first},
9-
FunctionExpression: {parameters: first},
10-
MemberExpression: off,
11-
ObjectExpression: first,
12-
SwitchCase: 1}]
13-
indent-legacy: 0
6+
indent: [error, 2, {ArrayExpression: first,
7+
CallExpression: {arguments: first},
8+
FunctionDeclaration: {parameters: first},
9+
FunctionExpression: {parameters: first},
10+
MemberExpression: off,
11+
ObjectExpression: first,
12+
SwitchCase: 1}]
13+
indent-legacy: off

0 commit comments

Comments
 (0)