standard / semistandard

:icecream: All the goodness of `standard/standard` with semicolons sprinkled on top.
MIT License
1.41k stars 123 forks source link

Semistandard 12.0.0 globals exclude doesn't work #232

Closed cbranca closed 6 years ago

cbranca commented 6 years ago

With version 10.0.0 if I wanted to exclude global variables like "angular" or "$" I had to put this in package.json: "semistandard": { "globals": ["angular","$"] }, But after the 12.0.0 update I keep getting "[semistandard] angular (or $) is not defined.. (no-undef)" instead of excluding "angular" and "$" global variables. Is it a bug?

Flet commented 6 years ago

Huh, strange! Looking into it

Flet commented 6 years ago

After tinkering a bit, It looks like it works when running via command line but its not working in my editor (VS Code with the standard plugin). Could you confirm that running semistandard via terminal works?

Are you experiencing the same issue in your editor? What are you using?

I suspect the issue is happening due to some standard-engine changes: https://github.com/standard/standard-engine/blob/master/index.js#L60

By default, using lintText will not use package.json values. So, if editor plugins are using this function they will not include values defined under the semistandard key in package.json (including globals).

Can you test to see if any of this is true for your setup?

cbranca commented 6 years ago

Hi Flet, the problem occurs within editors. I tried both Sublime Text 3 and Visual Studio Code.

Flet commented 6 years ago

Thanks to @feross, this was fixed in standard-engine.

I updated semistandard to 12.0.1 which should fix this issue. Could you give it a try?

cbranca commented 6 years ago

Hi @Flet , sorry for the delay of my answer. I tried version 12.0.1 just now and it works. Thank you 💯