Skip to content
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

Merged
merged 1 commit into from Sep 9, 2016

Conversation

not-an-aardvark
Copy link
Member

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.

@mention-bot
Copy link

@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

@eslintbot
Copy link

LGTM

@kaicataldo kaicataldo added do not merge This pull request should not be merged yet evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed do not merge This pull request should not be merged yet labels Sep 8, 2016
@not-an-aardvark
Copy link
Member Author

Not sure why CI failed; it seems like it was a timeout issue unrelated to this change.

@ilyavolodin
Copy link
Member

Restarted CI manually. LGTM, that's was an easy fix:-)

@nzakas
Copy link
Member

nzakas commented Sep 8, 2016

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")
Copy link
Member

@mysticatea mysticatea Sep 8, 2016

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?

Copy link
Member

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.

Copy link
Member

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.

@nzakas nzakas merged commit cec65e3 into eslint:master Sep 9, 2016
@nzakas nzakas removed the evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion label Sep 9, 2016
@not-an-aardvark not-an-aardvark deleted the issue7070 branch September 9, 2016 19:12
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants