diff options
author | Rich Trott <rtrott@gmail.com> | 2017-04-01 23:06:31 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-04-04 10:24:15 -0700 |
commit | f637703b8693d86b56edc4e6894eefde3e8fc0d4 (patch) | |
tree | 7d1e837ab7bcd60d34599829c701737462c6dd44 /.eslintrc.yaml | |
parent | 316665235c5a0f5b4aa4e74b6b23e862357635ab (diff) | |
download | node-new-f637703b8693d86b56edc4e6894eefde3e8fc0d4.tar.gz |
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to '.eslintrc.yaml')
-rw-r--r-- | .eslintrc.yaml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 4ad11a1ffd..f4809c0fc9 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -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 @@ -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 no-unescaped-regexp-dot: 2 # Global scoped method and vars |