ricardofbarros / linter-js-standard

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

Does not read env specified in package.json #171

Closed aeruhxi closed 7 years ago

aeruhxi commented 7 years ago

I am running the latest version 3.9.0 of the plugin. I have specified env for jest in package.json

  "standard": {
    "env": [ "jest" ]
  },

If I use standard regularly on shell, it works as expected. But the plugin still shows warning in atom like

'describe' is not defined.at line 3 col 1
'it' is not defined.at line 4 col 3
AlecRust commented 7 years ago

I have the same problem, with mocha.

"standard": {
  "env": [ "mocha" ]
}

screenshot

dereke commented 7 years ago

I think you can fix this by changing this

      settings.env = {}
      Object.keys(styleSettings.env).forEach(function (key) {
        settings.env[key] = styleSettings.env[key]
      })

to this:

      settings.env = [].concat(styleSettings.env || [])

as standard uses an array of env values rather than a hash. I don't actually use atom though so am hesitant to submit a PR for this!

AlecRust commented 7 years ago

That works great! Opening a PR.

epeterson320 commented 7 years ago

Is this deployed yet? I'm still getting these errors in my editor, when running Standard from the CLI returns no errors.

AlecRust commented 7 years ago

I don't think so - @ricardofbarros?

ricardofbarros commented 7 years ago

Sorry @epeterson320 and @AlecRust it wasn't. It is published now 3.9.1, thanks

sonicdoe commented 7 years ago

It seems like this was unintentionally reopened.