ricardofbarros / linter-js-standard

Atom linter plugin for JavaScript, using JavaScript Standard Style
https://atom.io/packages/linter-js-standard
MIT License
99 stars 48 forks source link

does not recognize globals #75

Closed brandon-collins closed 8 years ago

brandon-collins commented 8 years ago

The linter does not seem to recognize globals automatically when 'honor style settings' is true. In my main package.json I have

{ "standard": { "globals": [ "blah", "blah" ] } }

When I open a file with these globals used I get warnings where those globals are used. Oddly though, when I ^ + alt f (standard formatter plugin command) The warnings go away. However when I check the 'honor style settings' to true in the preferences I don't get the warning messages automatically. Seems like there is a little bug here and/or the documentation needs to clarify the intended behavior. This is not an interaction issue between the linter plugin and the standard-formatter plugin because it is still present without the standard-formatter plugin.

Thanks for your work on the linter plugin, it's great!

linter-js-standard v3.2.1 standard-formatter v1.2.1 atom 1.3.2

kilianc commented 8 years ago

+1 it's not clear form the docs what honor style settings does, but when it's on it stops working when it's off globals is ignored.

kilianc commented 8 years ago

@brandon-collins my problem was missing babel-eslint as global install. It works now. We definitively need to output an error if the parser is missing.

leo commented 8 years ago

This is the correct syntax:

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

... and not ...

{ "standard": "globals": [ "blah", "blah" ] }

It also might not be part of the documentation of this linter, but it's explained here.

brandon-collins commented 8 years ago

ya, that is actually what I have in my package.json. I had a typo typing here in the tracker. thanks @leo