cfjedimaster / brackets-jshint

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

Support extends in .jshintrc #57

Open Qantas94Heavy opened 10 years ago

Qantas94Heavy commented 10 years ago

It's good that .jshintrc files now don't have to be in the project root, but when I try to place one in a subfolder, that becomes the only file used. Could we change this to match the behaviour of the JSHint CLI, which implements this sort of thing (jshint/jshint#1314)?

cfjedimaster commented 10 years ago

So to be clear, you want to support extends? If so - I'm ok with that. Don't know when I'd have time though but I'd accept a PR.

piotr-cz commented 9 years ago

I'd be happy with just searching for the .jshint file up the directory tree.

For example within the project we have all frotend-related assets in /resources folder and that's where I've placed the file.

busykai commented 9 years ago

Supposedly, #55 implements it (enabled by default). Is it broken?

EDIT: ah, I see. @Qantas94Heavy, you mean supporting extends in .jshintrc. Sorry #55 is not applicable then. @cfjedimaster, perhaps it makes sense to update the title to clearly indicate the issue.

busykai commented 9 years ago

@piotr-cz, just in case, the file should be called .jshintrc, not .jshint.

piotr-cz commented 9 years ago

I made a typo in comment, I'm having .jshintrc. If I'm not mistaken,#55 does not apply when a .jshintrc is inside a projects subdirectory

project root:
/assets
  /js
    /.jshintrc
    /scripts.js

See JSHint documentation

...In case of .jshintrc, JSHint will start looking for this file in the same directory as the file that's being linted. If not found, it will move one level up the directory tree all the way up to the filesystem root.

it's not about supporting extends

ajssd commented 9 years ago

Inheritance would be nice. For example, in my 'test' directory, I would like to have

{ jasmine: true, mocha: true }

in my test directory, but not necessarily in my src (or root) directory.

busykai commented 9 years ago

@piotr-cz, .jshintrc should apply to scripts.js files in your example. It will not apply to any files outside the assets/js directory. Please file another issue if you still have questions, this one is about supporting extends option.

@Qantas94Heavy or @cfjedimaster, could you please correct the title to indicate clearly what's being requested?

cfjedimaster commented 9 years ago

I honestly do not understand the issue here - reading a third time.

cfjedimaster commented 9 years ago

Ok now?

piotr-cz commented 9 years ago

@Qantas94Heavy: As suggested I've just added #69, please look if this is what you mean. Anyway It's my case.

busykai commented 9 years ago

Support for extends was added by #54 (looking at the code). @Qantas94Heavy, did you try it? Is it not working?

Qantas94Heavy commented 9 years ago

Sorry about all the confusion caused here @cfjedimaster , I was indeed referring to extends.

@busykai I tried this again with a .jshintrc in the root with globalstrict enabled and another .jshintrc in a subdirectory with some globals, but without any globalstrict property set, but the files in the subdirectory were still getting 'Use the function form of "use strict"'.