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

Webstorm doesn't respect 'globals' in package.json #559

Closed
Alexsey opened this issue Jul 7, 2016 · 3 comments

Comments

@Alexsey
Copy link

commented Jul 7, 2016

If you mentioned some variables in package.json like

{
  "standard": {
    "globals": [ "myVar1", "myVar2" ]
  }
}

Webstorm will still consider their usage as error. Test of file from the command line will find no errors (as it should be), so it's some lack of configuration. Unfortunately I don't know what should be configured.

Did any one solved this problem?

@Alexsey

This comment has been minimized.

Copy link
Author

commented Jul 7, 2016

Temporary solution is to add names of global variables you would like to use both to package.json and in Webstorm options Languages & Frameworks > JavaScript > Code Quality Tools > ESLint > Extra eslint options: line --global myVar1,myVar2

But it's a crutch and normal solution still wanted

@feross

This comment has been minimized.

Copy link
Member

commented Jul 12, 2016

This is because WebStorm doesn't really support Standard natively -- it just supports ESLint. ESLint does not look for options in package.json using the "standard" property.

I suggest that you use /* global myVar */ comments at the top of each file, as that's better documentation anyway and ESLint will pick those up.

You can also vote for native standard support in WebStorm via an issue that another user already opened: https://youtrack.jetbrains.com/oauth?state=%2Fissue%2FWEB-17331

@feross feross added the question label Jul 12, 2016

@feross feross closed this Jul 12, 2016

@Alexsey

This comment has been minimized.

Copy link
Author

commented Jul 13, 2016

Ya, but not in case when you have "hundreds of files" :(

@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.
2 participants
You can’t perform that action at this time.