Proposal: Prefer Number methods to their Global counterparts
See original GitHub issuePlease describe what the rule should do:
This rule will enforce the use of the modularized versions of parseInt
, parseFloat
and isNaN
.
What category of rule is this? (place an “X” next to just one item)
[ ] Enforces code style [x] Warns about a potential error [ ] Suggests an alternate way of doing something [ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
isNaN(foo); // warn
parseInt(foo); // warn
parseFloat(foo); // warn
Number.isNaN(foo); // fine
Number.parseInt(foo); // fine
Number.parseFloat(foo); // fine
Why should this rule be included in ESLint (instead of a plugin)? From MDN: The purpose of Number.parseInt and Number.parseFloat is “modularization of globals”. At the same time Number.NaN is “more robust”. This rule should be part of the Ecmascript 6 rules subset.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Basic components of a proposal | Foundation Relations
Basic components of a proposal · Show your budget in table form and use a budget narrative to explain each item. · Only...
Read more >Change the Way You Persuade - Harvard Business Review
In our experience, people can vastly improve their chances of having their proposals succeed by determining who the chief decision maker is among...
Read more >43 RFP Statistics on Win Rates & Proposal Management
Wondering how to become a top-performing responder? Here are 43 benchmarks to help you win more bids and improve your process.
Read more >Unit 7 Proposals – Professional and Technical Writing
Employ your writing and reasoning skills to make a difference in the world. View samples and write a proposal to conduct research, develop...
Read more >Advice on Writing Proposals - particularly to NSF
It includes some guidelines on how to write an NSF proposal and how to get ... you are calling about a proposal or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also this rule might be auto “fixable”.
@kirly-af By the way,
no-restricted-globals
now supports custom messages, so you could use it and specify whatever message you want. Hope this helps!