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

JSDoc style comments (/**) not allowed on Windows #185

Closed
skkeeper opened this issue Jul 13, 2015 · 13 comments

Comments

@skkeeper
Copy link

commented Jul 13, 2015

Not sure if this is an issue or just me not being able to figure out how to format this properly. For the following code, standard is telling me:

c:\tmp\example.js:1:0: Expected space or tab after /* in comment.
/**
 * Totally not an example function
 * @return {Boolean}
 */
function isFireflyAwesome () {
  return true
}

console.log(isFireflyAwesome())

Is this type of docstring not allowed?

@Flet

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

This snippet is not throwing any errors for me using the latest version of standard.

Could you try npm install -g standard and see if that fixes it? I know the spaced-comment rule was recently tweaked a little bit in eslint-config-standard.

@skkeeper

This comment has been minimized.

Copy link
Author

commented Jul 13, 2015

I made sure I was running the latest version, but I ran npm install -g just to be sure. Still got the same issue.

c:\tmp
λ standard --version
4.5.3

c:\tmp
λ standard example.js
standard: Use JavaScript Standard Style (https://github.com/feross/standard)
  c:\tmp\example.js:1:0: Expected space or tab after /* in comment.
@skkeeper

This comment has been minimized.

Copy link
Author

commented Jul 13, 2015

So I did a clean install on a Linux VPS and the issue went away.

After that I removed standard from my dev machine (Windows 7 x64) and re-installed it and I still get the same warning there.

This seems to be ether specific to my windows machine or to the OS version itself.

@Flet what OS did you use to run the sample code?

@Flet

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

Ah, I validated it on Ubuntu.

Yep... I the same error in Windows:

C:\dev>standard skkeeper.js
standard: Use JavaScript Standard Style (https://github.com/feross/standard)
  C:\dev\blah.js:1:0: Expected space or tab after /* in comment.

Really strange!

I don't see the * as an exception in the spaced-comment rule in eslint-config-standard, so the Windows behavior may be more correct :)

That being said, it may be prudent to add * to the exception list for spaced-comment.

@Flet

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

Some workarounds (in case this is blocking you):
Adding a space between the * on the first line makes the error go away (/* *)

Or adding this hint at the top of the file will disable the rule:

/* eslint-disable spaced-comment */
@skkeeper

This comment has been minimized.

Copy link
Author

commented Jul 13, 2015

I'll keep the workarounds in mind, thanks for looking into this. Cheers!

@feross

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

@Flet eslint is supposted to automatically support jsdoc-style comments (/**) without needing to specify * in the exception list.

I filed a bug on eslint: eslint/eslint#2987

@feross

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

@Flet Also, manually adding * to the exception list doesn't seem to work. We'll have to wait for eslint.

@feross feross changed the title Multiline /** comments not allowed? JSDoc style comments (/**) not allowed on Windows Jul 13, 2015

@Flet

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

Cool, looks like we might be pointing to a hash again :)

@feross

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

It'll be a bit more work to do that this time, it seems. The fix we want is on the master branch, while the current version of eslint is cut from the 0.x branch. So there are probably breaking changes in master (in prep for their 1.0 release) that would need to be handled as well :)

@feross

This comment has been minimized.

Copy link
Member

commented Jul 13, 2015

Hm, there are actually 3 open issues on standard right now that would be fixed by upgrading to master so maybe it's worth it. If anyone's interested, I'd merge a PR that upgraded eslint to point to master (if it doesn't introduce any new eslint bugs that cause new tests to fail).

@feross

This comment has been minimized.

Copy link
Member

commented Jul 17, 2015

This will be fixed in eslint 1.0.0 and standard 5.0.0. #192

@skkeeper

This comment has been minimized.

Copy link
Author

commented Jul 20, 2015

This looks fixed on my end with the new 5.0.0-2.

@feross feross closed this Jul 23, 2015

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

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