You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
I achieved this behavior by reusing some code of the eslint linter configuration in this project.
You can select how a linter behaves by modifying its properties in your configuration file for the plugin. An example for standard:
locallint=require("lint")
localbinary_name="standard"localcmd_string=function()
locallocal_binary=vim.fn.fnamemodify("./node_modules/.bin/" ..binary_name, ":p")
returnvim.loop.fs_stat(local_binary) andlocal_binaryorbinary_nameend-- Use always local standardlocalstandardjs=lint.linters.standardjsstandardjs.cmd=cmd_string()
Simply add this code to your configuration function and nvim-lint will start using standardjs from local node_modules if possible, if not it will fallback to system wide installation.
I will try to add a PR that integrates the utils method of conform and uses it for standardjsin that project.
A PR that adapts standardjs to use the same pattern as eslint would be welcome.
But I'm starting wo wonder if this use-case wouldn't be in general better solved by adjusting your $PATH to something like $PATH=./node_modules/.bin/:$PATH - then you've consistend behavior across terminal and nvim-lint
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: