Open Qantas94Heavy opened 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.
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.
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.
@piotr-cz, just in case, the file should be called .jshintrc
, not .jshint
.
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
...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
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.
@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?
I honestly do not understand the issue here - reading a third time.
Ok now?
@Qantas94Heavy: As suggested I've just added #69, please look if this is what you mean. Anyway It's my case.
Support for extends
was added by #54 (looking at the code). @Qantas94Heavy, did you try it? Is it not working?
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"'.
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)?