Closed ghost closed 9 years ago
And upon fixing this for my linter plugin, I realized that there is a single global rules object. This basically makes it impossible to selectively enable/disable rules in a single process (e.g. without restarting node) without resorting to absurdly ugly hacks like changing rule[name].prototype.level
and then resetting it after the linter runs.
jadelint will have support for config objects in version 0.3
:+1:
I just release v0.3. The linter doesn't look up the tree for a .jadelintrc, but you can provide your own config object. I recommend looking at the API documentation. If you need help implementing the linter with the new API, I made a gitter room
Thanks, I don't think this issue should be closed though.
jadelint src/file.jade
doesn't work.
I just tried that locally, and it worked fine.
Can you run npm ls -g jadelint
and also tell me what OS you are on?
Okay, sorry -- it now works as long as the .jadelintrc
is in the same directory. That's not a very useful setup to me :) I currently have about 30 folders under one views
folder in a project. It's not feasible to copy the .jadelintrc
to every one
The linter working is a different piece.
I'm working on a linter that will move up the dir tree now
Can I suggest taking a look at eslint and maybe stealing code from it?
It does a very beautiful thing where it merges config files up the tree.
That functionality has been added. I haven't tested it on a windows machine, but it should work fine on a *nix device. Try it in v0.3.2
per d9d/atom-linter-jade#3, the linter only looks in the current directory for the
.jadelintrc
file. It should start from the file directory (not cwd) and walk up.This is also an issue from the command line if calling the linter on a file in a different directory, e.g.:
Alternatively, can you fork the config file loading code so that I can easily do something like
.setConfig(json|fileName)
and not have to duplicate this block of code: