Skip to content

Commit

Permalink
tools: replace custom ESLint timers rule
Browse files Browse the repository at this point in the history
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 <teddy.katz@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Trott authored and evanlucas committed May 1, 2017
1 parent 0c0241f commit 5ccafa2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ rules:
new-parens: 2
no-mixed-spaces-and-tabs: 2
no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}]
no-restricted-syntax: [2, {
selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
message: "setTimeout() must be invoked with at least two arguments."
}, {
selector: "CallExpression[callee.name='setInterval'][arguments.length<2]",
message: "setInterval() must be invoked with at least 2 arguments"
}]
no-tabs: 2
no-trailing-spaces: 2
one-var-declaration-per-line: 2
Expand Down Expand Up @@ -135,7 +142,6 @@ rules:
assert-fail-single-argument: 2
assert-throws-arguments: [2, { requireTwo: false }]
new-with-error: [2, Error, RangeError, TypeError, SyntaxError, ReferenceError]
timer-arguments: 2

# Global scoped method and vars
globals:
Expand Down
25 changes: 0 additions & 25 deletions tools/eslint-rules/timer-arguments.js

This file was deleted.

0 comments on commit 5ccafa2

Please sign in to comment.