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: #12504
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
Trott authored and MylesBorins committed Apr 26, 2017
1 parent 9bfbe11 commit cf26d15
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 @@ -100,6 +100,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
operator-linebreak: [2, after, {overrides: {'?': ignore, ':': ignore}}]
Expand Down Expand Up @@ -132,7 +139,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 cf26d15

Please sign in to comment.