cfjedimaster / brackets-jshint

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

Use .jshintrc which is not in root directory #69

Closed piotr-cz closed 9 years ago

piotr-cz commented 9 years ago

GIven as structure

/ (project root)
/assets
    /.jshintrc
    /components
        /dashboard.js
/tests
    /.jshintrc
    /components
        /dashboard.js

The .jshintrc files are not being loaded in Brackets-JSHint extension.

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.

cfjedimaster commented 9 years ago

So in this example, assets/components/dashboard.js would use the .jshintrc in assets, right?

piotr-cz commented 9 years ago

Yes, it's supposed to but doesn't.

busykai commented 9 years ago

Ok. I just went through debug and it loads first .jshintrc it finds in the directory tree. @piotr-cz, how do you decide it does not work? In other words, what is that you see in the output does not match your expectations? JSHint since version 2.5.0 does not report any formatting error. Do you expect it to?

piotr-cz commented 9 years ago

I'll check again. I was declaring 'angular' as a global in the .jshintrc file but I've got errors about it not being declared.

piotr-cz commented 9 years ago

Okay, I had an invalid json structure (coma at the last objects' property). Feature seems to work completely fine.

Maybe there could be a note in the Problems tab like: cannot load .jshintrc file: invalid json format or something alike