explicit-timer-delay: Add rule#2814
Conversation
8a05b7f to
e1c0b10
Compare
|
Ping |
setTimeout((callback));Expected fix: setTimeout((callback), 0);Actual fix result: setTimeout((callback, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));The fixer inserts inside the parentheses, so the call still has one argument and ESLint keeps re-fixing it until the pass limit. This is definitley not safe for
setTimeout(callback, (0));Expected fix: setTimeout(callback);Actual fix result: setTimeout(callback));This leaves invalid syntax (extra |
|
|
||
| ```js | ||
| // ❌ | ||
| setTimeout(() => console.log('Hello')); |
There was a problem hiding this comment.
Please see other rules for formatting here. Whenever possible, show fail/pass cases together.
|
Match the common options style used in other docs.
|
e1c0b10 to
704256a
Compare
|
@sindresorhus Thanks for the review! I've fixed your comments! |
|
A few more things:
|
a99744d to
2c5fd38
Compare
|
@sindresorhus Fixed ✅ |
|
|
@sindresorhus Fixed ✅ |
|
@sindresorhus Fixed ✅ |
|
Found 2 issues:
eslint-plugin-unicorn/rules/explicit-timer-delay.js Lines 112 to 131 in f60546b
|
b284281 to
85768e6
Compare
|
Thanks. I've fixed both issues! |
|
|
Some tests to add:
|
|
Done |
ee4565f to
9141823
Compare
814b622 to
0e023e3
Compare
Close #2809