-
-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use npm installed linter when available #519
Comments
Hello! I achieved this behavior by reusing some code of the You can select how a linter behaves by modifying its properties in your configuration file for the plugin. An example for standard: local lint = require("lint")
local binary_name = "standard"
local cmd_string = function()
local local_binary = vim.fn.fnamemodify("./node_modules/.bin/" .. binary_name, ":p")
return vim.loop.fs_stat(local_binary) and local_binary or binary_name
end
-- Use always local standard
local standardjs = lint.linters.standardjs
standardjs.cmd = cmd_string() Simply add this code to your configuration function and I will try to add a PR that integrates the utils method of |
Hey! thanks for all this work, I have been using your repo for a few days and I really like it!
I am trying to work with a js project which uses a specific version of
standardjs
, I noticed that it nvim-lint was not picking that one but the one installed system wide instead..For formatting I am using conform.nvim which I think handles this correctly through a util method:
here is the code that sets up
standardjs
as formatter, to parse the command to use it uses this util method.I thought this might come in handy for a few linters in your project and maybe worth including.. I am not very experienced in lua, I mainly just use it to set up neovim.. If you don't have the time or don't think this is a priority I can try adding it myself and open a PR
The text was updated successfully, but these errors were encountered: