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

bug: return.5 #873

Closed
Eljay-Adobe opened this issue May 2, 2017 · 6 comments

Comments

@Eljay-Adobe
Copy link

commented May 2, 2017

// standard 10.0.2
standard --fix --stdin <goof.js

// contents of goof.js
function goof() {
return.5
}

...becomes...

function goof() {
return0.5
}

@LinusU

This comment has been minimized.

Copy link
Member

commented May 2, 2017

It seems like you have written return.5 (notice the dot), this does indeed return 0.5 when being run.

screen shot 2017-05-02 at 23 23 16

Did you mean to write:

function goof () {
  return 5
}

@LinusU LinusU closed this May 2, 2017

@Eljay-Adobe

This comment has been minimized.

Copy link
Author

commented May 3, 2017

No, the example is return.5 which does indeed return 0.5.

But standard reforms the statement to return0.5 which is a bug, since return0 is undefined and u.5 (for undefined u) is a syntax error.

@dcousens dcousens added the bug label May 3, 2017

@dcousens dcousens reopened this May 3, 2017

@dcousens

This comment has been minimized.

Copy link
Member

commented May 3, 2017

This should be filed upstream to ESLint... but, return.5... JS, honestly.

@LinusU

This comment has been minimized.

Copy link
Member

commented May 3, 2017

Ah, my bad, sorry about that :)

@not-an-aardvark

This comment has been minimized.

Copy link

commented May 21, 2017

This was fixed in eslint/eslint@2754141.

@dcousens dcousens closed this May 22, 2017

@Eljay-Adobe

This comment has been minimized.

Copy link
Author

commented May 24, 2017

In my defense, it wasn't my JS code. I was using standard to make the horribly formatted code legible. Because... standard rocks!

Thanks for fixing the bug. /hugs

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.