.luacheckrc in parent hierarchy · Issue #33 · mpeterv/luacheck (original) (raw)

A lot of linters (jshint, jscs, scss-lint, coffeelint) that allow configuration via a .rc file look for it in the folder of the file being linted, but will also look in all parent folders until either a .rc file is found or the root of the filesystem is reached.

I see no reason why luacheck couldn't do the same thing. The performance impact is minimal and has the added benefit of being familiar with the above mentioned linters, which is nice for web projects that use lua either as a backend, or to leverage Redis' scripting functionality.

In my opinion, the decision of looking for .luacheckrc in the current working directory is questionable at best; the whole point of the config file is to be coupled with the source tree (for example to add per-project globals), whereas if using absolute paths, you'll get different behavior depending on where exactly you're running luacheck from. I fail to see a use case when this is what you want.