Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
tools: add number-isnan eslint rule#17556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
maclover7 commented Dec 8, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
apapirovski commented Dec 8, 2017
This might be a bit finicky since it would catch |
Trott commented Dec 8, 2017
No objections, but one question and one observation. Question: What's the reason for avoiding the Observation: I think this can probably be implemented using |
maclover7 commented Dec 9, 2017
For personal reasons, I think it's more clear to use
Interesting -- refactored down to use no-restricted-syntax |
apapirovski left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this won't work as it overrides all the no-restricted-syntax rules declared within .eslintrc.yaml in the root directory.
Trott commented Dec 10, 2017
Oh, yeah, I assumed it was a lint rule we'd want for the entire code base... |
apapirovski commented Dec 10, 2017
Yeah, I think we could do that? I don't see any reason why we would be stricter about this in |
Trott commented Dec 10, 2017
Are we sure we want to necessarily encourage people to change isNaN('a string is not a nubmer');//trueNumber.isNaN('a string is not a number');// false |
apapirovski commented Dec 10, 2017
|
maclover7 commented Dec 11, 2017
updated @apapirovski@Trott For context, I was initially hesitant to add the rule to |
Trott commented Dec 11, 2017
@maclover7 Sorry to make this tedious, but this is what I'd recommend:
|
Trott commented Dec 11, 2017
(And yeah, had I not said anything, first bullet point would have happened and all of this would have been avoided. Sorry!) |
lib/events.js Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the typeof n !== 'number' check is redundant if Number.isNaN is being used.
lib/readline.js Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the typeof historySize !== 'number' check is redundant if Number.isNaN is being used.
maclover7 commented Dec 14, 2017
updated @Trott, PTAL |
maclover7 commented Dec 18, 2017
maclover7 commented Dec 19, 2017
Will land tomorrow unless any objections |
maclover7 commented Dec 19, 2017
Landed in e554bc8 |
PR-URL: #17556 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #17556 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #17556 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #17556 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: #17556 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
tools, test