This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 660
feat(rome_js_analyze): Implement prefer-numeric-literals lint #3558
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for docs-rometools ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
nvm. It was bug in the logic. |
@MichaReiser I am getting the below error on the below test case. Can you please help? Number.parseInt('17', 8)in foo Error:
|
MichaReiser
reviewed
Nov 5, 2022
crates/rome_js_analyze/src/analyzers/style/prefer_numeric_literals.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/analyzers/style/prefer_numeric_literals.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/analyzers/style/prefer_numeric_literals.rs
Outdated
Show resolved
Hide resolved
crates/rome_js_analyze/src/analyzers/style/prefer_numeric_literals.rs
Outdated
Show resolved
Hide resolved
95th
commented
Nov 5, 2022
crates/rome_js_analyze/src/analyzers/nursery/use_numeric_literals.rs
Outdated
Show resolved
Hide resolved
MichaReiser
reviewed
Nov 9, 2022
/// Return the string value if the given expression is | ||
/// 1. A string literal | ||
/// 2. A template literal with no substitutions | ||
pub fn as_string_or_no_substitution_template(&self) -> Option<String> { |
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.
It would be great to have doctest for all public facing methods.
MichaReiser
reviewed
Nov 10, 2022
MichaReiser
approved these changes
Nov 14, 2022
Thank you so much @95th for this contribution. Looking all good. Can you rebase your changes to resolve the merge conflicts, and we're good to |
jeysal
added a commit
to jeysal/rometools
that referenced
this pull request
Nov 14, 2022
* upstream/main: (45 commits) website(docs): set `color-scheme` on the root element (rome#3721) feat(rome_analyze): add a warning for unused suppression comments (rome#3718) feat(rome_js_analyze): Implement prefer-numeric-literals lint (rome#3558) feat(rome_js_formatter): jestEach template literals rome#3308 (rome#3582) doc(website): Add context about Romes philosophy (rome#3714) fix(rome_js_formatter): Single-line comment below a JSX prop triggers… (rome#3641) test(rome_js_formatter): update prettier tests (rome#3684) fix(rome_js_parser): improve await handling in non-async context (rome#3573) fix(rome_js_parser): improve yield parsing in non generator function (rome#3622) More playground polish Fix backgrounds Fix height Align docs.rome.tools with rome.tools Reenable compression Add missing width website(docs): More playground IDE features (rome#3711) fix(rome_js_formatter): new expression attribute (rome#3686) docs(website): added checkbox to toggle linter in playground (rome#3699) website(docs): More website tweaks (rome#3707) website(docs): Add default layout property (rome#3705) ...
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements:
prefer-numeric-literals
#3360Summary
Support prefer-numeric-literals lint rule
Test Plan
added unit tests for lint.