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
Update: add fixer for no-floating-decimal (fixes #7070) #7081
Conversation
@not-an-aardvark, thanks for your PR! By analyzing the annotation information on this pull request, we identified @vitorbal, @ilyavolodin and @nzakas to be potential reviewers |
LGTM |
Not sure why CI failed; it seems like it was a timeout issue unrelated to this change. |
Restarted CI manually. LGTM, that's was an easy fix:-) |
LGTM, just waiting another day for others to look. |
context.report({ | ||
node, | ||
message: "A trailing decimal point can be confused with a dot.", | ||
fix: fixer => fixer.insertTextAfter(node, "0") |
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.
Hmm. Though it's not related to this PR, this rule seems to miss 2.e+3
-like notation originally.
Is it a bug?
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'm not sure it is-- the rule is specifically about decimal points being confused for dot operators, I think, and so a decimal point in the middle of a numeric literal (even if it is on the trailing each of the mantissa) should be okay.
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 got it, thank you for the explanation!
LGTM.
What issue does this pull request address?
#7070
What changes did you make? (Give an overview)
This adds an autofixer for the
no-floating-decimal
rule.Is there anything you'd like reviewers to focus on?
Nothing in particular. #7070 has not been marked as accepted yet, so this PR should not be merged before that happens.