mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-04-15 00:58:37 +00:00
languages: apply workaround for eslint_d errors
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Validate flake & check formatting / Validate Flake (push) Waiting to run
Validate flake & check formatting / Formatting via Alejandra (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Check for typos in the source tree / check-typos (push) Waiting to run
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Validate flake & check formatting / Validate Flake (push) Waiting to run
Validate flake & check formatting / Formatting via Alejandra (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Check for typos in the source tree / check-typos (push) Waiting to run
Skip attaching to buffer to get diagnostics if the eslint config is missing.
This commit is contained in:
parent
bc978c4fad
commit
02ee4ccb96
4 changed files with 42 additions and 0 deletions
|
@ -72,6 +72,17 @@
|
|||
ls_sources,
|
||||
null_ls.builtins.diagnostics.eslint_d.with({
|
||||
command = "${getExe pkg}",
|
||||
condition = function()
|
||||
return has_eslint_config({
|
||||
".eslintrc",
|
||||
".eslintrc.cjs",
|
||||
".eslintrc.js",
|
||||
".eslintrc.json",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.js",
|
||||
"eslint.config.mjs",
|
||||
})
|
||||
end,
|
||||
})
|
||||
)
|
||||
'';
|
||||
|
|
|
@ -72,6 +72,17 @@
|
|||
ls_sources,
|
||||
null_ls.builtins.diagnostics.eslint_d.with({
|
||||
command = "${getExe pkg}",
|
||||
condition = function()
|
||||
return has_eslint_config({
|
||||
".eslintrc",
|
||||
".eslintrc.cjs",
|
||||
".eslintrc.js",
|
||||
".eslintrc.json",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.js",
|
||||
"eslint.config.mjs",
|
||||
})
|
||||
end,
|
||||
})
|
||||
)
|
||||
'';
|
||||
|
|
|
@ -123,6 +123,17 @@
|
|||
ls_sources,
|
||||
null_ls.builtins.diagnostics.eslint_d.with({
|
||||
command = "${getExe pkg}",
|
||||
condition = function()
|
||||
return has_eslint_config({
|
||||
".eslintrc",
|
||||
".eslintrc.cjs",
|
||||
".eslintrc.js",
|
||||
".eslintrc.json",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.js",
|
||||
"eslint.config.mjs",
|
||||
})
|
||||
end,
|
||||
})
|
||||
)
|
||||
'';
|
||||
|
|
|
@ -28,7 +28,16 @@ in {
|
|||
local null_ls = require("null-ls")
|
||||
local null_helpers = require("null-ls.helpers")
|
||||
local null_methods = require("null-ls.methods")
|
||||
local null_utils = require("null-ls.utils")
|
||||
local ls_sources = {}
|
||||
|
||||
-- HACK: provide an obscure, but useful helper function for some null-ls
|
||||
-- builtins to start *conditionally* if the plugin can find a config file
|
||||
-- for the relevant diagnostics service. This should not be provided here
|
||||
-- haphazardly, but null-ls is candidate for removal anyway.
|
||||
local function has_eslint_config(files)
|
||||
return null_utils.root_has_file(files)
|
||||
end
|
||||
'';
|
||||
|
||||
# null-ls setup
|
||||
|
|
Loading…
Add table
Reference in a new issue