mfussenegger / nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
GNU General Public License v3.0
1.76k stars 191 forks source link

Ppass cwd to linter command #605

Open thunderer199 opened 1 week ago

thunderer199 commented 1 week ago

Node.js linters (eslint, stylelint, etc) run binary from relative node_modules that depend on the working directory. But not always working directory has node_modules, in the case of monorepo it can be some sub-folder.

The lint run command already has cwd option, but doesn't pass it to cmd command. The fix is passing opts to linter cmd to properly calculate the path to node_modules if it's not in working directory.