Skip to content

Commit 5ccafa2

Browse files
Trottevanlucas
authored andcommittedMay 1, 2017
tools: replace custom ESLint timers rule
ESLint 3.19.0 allows the specification of selectors that represent disallowed syntax. Replace our custom rule for timer arguments with a pair of `no-restricted-syntax` option objects. PR-URL: #12162 Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 0c0241f commit 5ccafa2

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed
 

‎.eslintrc.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ rules:
101101
new-parens: 2
102102
no-mixed-spaces-and-tabs: 2
103103
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}]
104+
no-restricted-syntax: [2, {
105+
selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
106+
message: "setTimeout() must be invoked with at least two arguments."
107+
}, {
108+
selector: "CallExpression[callee.name='setInterval'][arguments.length<2]",
109+
message: "setInterval() must be invoked with at least 2 arguments"
110+
}]
104111
no-tabs: 2
105112
no-trailing-spaces: 2
106113
one-var-declaration-per-line: 2
@@ -135,7 +142,6 @@ rules:
135142
assert-fail-single-argument: 2
136143
assert-throws-arguments: [2, { requireTwo: false }]
137144
new-with-error: [2, Error, RangeError, TypeError, SyntaxError, ReferenceError]
138-
timer-arguments: 2
139145

140146
# Global scoped method and vars
141147
globals:

‎tools/eslint-rules/timer-arguments.js

-25
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.