Joezo / atom-jshint

Validate your JS against JSHint as you type, while using Atom
MIT License
39 stars 15 forks source link

Global JSHint settings #19

Open lukasoppermann opened 10 years ago

lukasoppermann commented 10 years ago

Expose option to disable expression warning in package options http://jshint.com/docs/options/#expr

Joezo commented 10 years ago

What exactly do you mean? This should be configurable in your .jshintrc file

lukasoppermann commented 10 years ago

I meant it would be nice to have it in the plugin settings panel, where I can set it to update on save or change, etc. But I set it the way you suggest (true in the jshintrc) I still get the error Expected an assignment or function call and instead saw an expression

Also will it overwrite my settings on update?

Joezo commented 10 years ago

I'm not sure if it will overwrite your settings on update i'm afraid, that's something that atom itself deals with.

In regards to your problem with the expression error, it may be that the package is not reloading the config when you've changed the .jshintrc file, to reload atom you can press ctrl+alt+cmd+L. If that doesn't work let me know!

Which reminds me, I need to raise an issue for that bug.

lukasoppermann commented 10 years ago

Neither this nor restarting atom completely helped. :(

Joezo commented 10 years ago

Is your .jshintrc file in the root of the project path?

lukasoppermann commented 10 years ago

Nope, I changed the default one in the packages. If I add one in my project it works, but I would like to set it for every project and not just for some.

Joezo commented 10 years ago

Ah okay, so a global jshintrc file. That's an interesting idea, going to rename this issue to be that. You'll have to workaround it the way you have until we do the work though i'm afraid. You might find that placing the .jshintrc file higher up the tree will solve it once the pending pull request is merged and released :)

adregan commented 10 years ago

I'll second the request for a global settings option. I want to enable laxcomma: true only once as I always intend to work this way.

Joezo commented 10 years ago

Now that the package tries to find a .jshintrc file higher up the tree do you think an acceptable solution to this would be 'just place a .jshintrc file in the directory you store your projects in'? Or would there be a reason to not just do that?

adregan commented 10 years ago

I'll certainly use that technique for now. Though I usually work in a canonical "project" directory, I'm not always that organized :wink: .

lukasoppermann commented 10 years ago

It works for me. :+1: