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

Configuring linter with .eslintrc #77

Closed allochi closed 8 years ago

allochi commented 8 years ago

Hi,

I'm sorry to bother you with this question, I really tried my best to find an answer to this and I couldn't.

I installed eslint, and installed this package to atom, used eslint --init to setup styles, and have a .eslintrc file at the project root with the package.json, but I don't know how to make this to work with the your package. Could you please give a detailed setup?

Thanks!

abraxxa commented 8 years ago

I'd also need help setting it up as my .eslintrc.json where I defined ExtJS as a global seems to be ignored.

despairblue commented 8 years ago

@allochi @abraxxa I think you are looking for linter-eslint

Standard style is not supposed to be configurable, see this.

@ricardofbarros I think this issue can be closed.

ricardofbarros commented 8 years ago

Yes @despairblue is right, those questions are related to linter-eslint

abraxxa commented 8 years ago

My believe that it supports setting global variables also in an .eslintrc.json file came from hopping from one link to the next until I ended up there http://eslint.org/docs/user-guide/configuring. I don't want to modify any 'standard' rules but only define 'Ext' as a global variable because I use Sencha ExtJS in this project. Maybe you could add a sentence that configuration is only supported via package.json which works like a charm.

despairblue commented 8 years ago

@abraxxa you're right, the readme could link to https://github.com/feross/standard#i-use-a-library-that-pollutes-the-global-namespace-how-do-i-prevent-variable-is-not-defined-errors

Would you mind to opening a PR?

abraxxa commented 8 years ago

Is using comments like in the linked example also supported in addition to the globals config in package.json?

abraxxa commented 8 years ago

I've sent the pull-request, feel free to extend it regarding configuration with comments.

despairblue commented 8 years ago

Yes. Comments work as well. I'd prefer comments over the package.json since they make it obvious to you that you are using globals in that file. There are exceptions to this rule of course.

abraxxa commented 8 years ago

Thanks! As each ExtJS class is a separate file having the comment in each would be annoying. Is 'Ext' really a global variable? Isn't it a namespace?

despairblue commented 8 years ago

Wouldn't a rose by any other name smell as sweet? :smiley:

You can call a global variable a namespace. Just be sure to know that you don't get any of the securities that languages supporting namespaces would give you. Like that you cannot redefine namespaces or their content.