cfjedimaster / brackets-jshint

Adds JSHint support to Brackets
MIT License
131 stars 41 forks source link

Global .jshintrc file? #9

Closed thefirstofthe300 closed 10 years ago

thefirstofthe300 commented 11 years ago

It seems rather curious that a JSHint extension would not have its own .jshintrc for linting. Is it possible to add one so that users who want to contribute (namely me) know what kind of options I should pay attention to?

cfjedimaster commented 11 years ago

I'm still not sure what makes sense for 'default' options. Frankly the defaults for JSHint seem too easy. That being said, I'll take any suggestions.

ghost commented 11 years ago

Here are my thoughts, as requested :-)

I would definitely set "unused" to true as well, and possibly disable all environments except for "browser", "devel", and "worker". Here are my settings for the JSHint extension in Sublime: http://pastebin.com/cfeUMYQD

Most of this boils down to personal preference, tho. As an example, I'm in the habit of not using semicolons in my JS code now so I have "asi" set to true, but a lot of people still frown upon the lack of semicolons in JS and would probably complain if the "asi" option was true by default in this Brackets extension.

dvdln commented 10 years ago

I would prefer the extension load a .jshint file if it finds on in the root of the current project. Otherwise, use sane defaults; perhaps matching (most of) the default JSLint options?

cfjedimaster commented 10 years ago

Unfortunately I no longer check for jshint files in the project. Currently Bracket's Linting API doesn't support asynch operations.

On Thu, Oct 10, 2013 at 1:02 PM, David Lane notifications@github.comwrote:

I would prefer the extension load a .jshint file if it finds on in the root of the current project. Otherwise, use sane defaults; perhaps matching (most of) the default JSLint options?

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-jshint/issues/9#issuecomment-26076496 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

busykai commented 10 years ago

@cfjedimaster See the pull request #16 . I'm not sure what's been done before, but this works for me. Some improvements might be needed though to make sure JSHint does not run before the config is loaded.

cfjedimaster commented 10 years ago

The issue is that your config load will happen after the initial lint. So I open project X and file Y. JSHint runs immediately and returns, let's say, 5 items. Your load of the config stuff happens async and when it is done, the new config stuff is ready. You switch to file Z, then back to Y, and where there had been 5 items, there are now 10.

To be clear, this isn't horrible per se, but do you see why it concerns me?

On Mon, Oct 21, 2013 at 5:03 AM, busykai notifications@github.com wrote:

@cfjedimaster https://github.com/cfjedimaster See the pull request #16https://github.com/cfjedimaster/brackets-jshint/pull/16. I'm not sure what's been done before, but this works for me. Some improvements might be needed though to make sure JSHint does not run before the config is loaded.

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-jshint/issues/9#issuecomment-26705084 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

busykai commented 10 years ago

Yeah, I know. Like I said -- it should be fixed. Better than nothing though.

busykai commented 10 years ago

@cfjedimaster See the PR. Now it works always.

cfjedimaster commented 10 years ago

I did see the PR... and honestly, I didn't test it yet, but I'm confused as to how this will work always. Can you explain how it would work on first run?

On Mon, Oct 21, 2013 at 6:31 AM, busykai notifications@github.com wrote:

@cfjedimaster https://github.com/cfjedimaster See the PR. Now it works always.

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-jshint/issues/9#issuecomment-26709603 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

busykai commented 10 years ago

I've just amended it. Would be much better if we have this discussion in the PR, would you agree?

cfjedimaster commented 10 years ago

Switching my comments there...

On Mon, Oct 21, 2013 at 6:38 AM, busykai notifications@github.com wrote:

I've just amended it. Would be much better if we have this discussion in the PR, would you agree?

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-jshint/issues/9#issuecomment-26709904 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

dvdln commented 10 years ago

Seeing as most linters should support an optional config file, it makes sense to me to hold off implementing this in an extension and add (or open an issue to request they add) the functionality to Brackets' linting API. Once it's a part of the API it could be used here.

cfjedimaster commented 10 years ago

You see - that's my feel kinda too. I'd like to support this feature, but part of me feels like I should avoid a hack.

Flip side is - it would be easy to yank it out too. ;)

On Mon, Oct 21, 2013 at 9:03 AM, David Lane notifications@github.comwrote:

Seeing as most linters should support an optional config file, it makes sense to me to hold off implementing this in an extension and add (or open an issue to request they add) the functionality to Brackets' linting API. Once it's a part of the API it could be used here.

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-jshint/issues/9#issuecomment-26719395 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

busykai commented 10 years ago

I have no intention to insist this is a permanent solution. Right now, for any project that has/uses .jshintrc file (Brackets included), this extension provides irrelevant information. If you want to keep it that way -- fine, I just wanted to resolve it for myself and share with others. :)

EvHaus commented 10 years ago

What is the current status of this request? I see the a project-level .jshintrc file is still not being picked up. Is there an open ticket with Brackets to add support for this in the Linting API?

cfjedimaster commented 10 years ago

I thought I pulled it in. On the road now so a bit behind.

On Sun, Nov 24, 2013 at 2:37 PM, Globex Designs, Inc < notifications@github.com> wrote:

What is the current status of this request? I see the a project-level .jshintrc file is still not being picked up. Is there an open ticket with Brackets to add support for this in the Linting API?

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-jshint/issues/9#issuecomment-29165314 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster