Replies: 1 comment 2 replies
-
The reason for the inconsistency is historical: originally, we had Ideally, I'd like to phase out |
Beta Was this translation helpful? Give feedback.
-
The reason for the inconsistency is historical: originally, we had Ideally, I'd like to phase out |
Beta Was this translation helpful? Give feedback.
-
Let us consider a situation where both a local and a global
eslint
are present and see which one of them is used for different settings:null_ls.builtins.diagnostics.eslint
- local. Ok, perhaps. However, the presence ofprefer_local
in the documentation suggests to me that the default should be global, no? The reason is that thedynamic_command
is preferred overcommand
herenull-ls.nvim/lua/null-ls/helpers/generator_factory.lua
Lines 271 to 275 in ac5f450
dynamic_command
for eslint isnull-ls.nvim/lua/null-ls/builtins/diagnostics/eslint.lua
Line 45 in ac5f450
null_ls.builtins.diagnostics.eslint.with({prefer_local=false})
- local. Hmm, now that is strange. I would assume from the formulation that the globaleslint
should be used in this case. Is there a way to use the globaleslint
at all? In fact, settingprefer_local
to false has no effect whatsoever according to thisnull-ls.nvim/lua/null-ls/helpers/make_builtin.lua
Line 84 in ac5f450
null_ls.builtins.diagnostics.eslint.with({prefer_local=true})
- global. Now this is unexpected =) The reason are these linesnull-ls.nvim/lua/null-ls/helpers/make_builtin.lua
Lines 84 to 93 in ac5f450
prefix
in this context is nil and that's why the default (and correct for eslint)dynamic_command = cmd_resolver.from_node_modules()
is substituted bycmd_resolver.generic(nil)
.Similar behavior is also true for the
local_only
variable. In addition to that the situation is even more confusing wheneslint_d
uses the local version ofeslint
.It would be cool if the behavior was better defined.
Beta Was this translation helpful? Give feedback.
All reactions