mirror of
https://github.com/josean-dev/dev-environment-files.git
synced 2025-01-08 17:21:23 +01:00
Added condition to null-ls eslint to enable if eslint config file is present
This commit is contained in:
parent
8a46b3b703
commit
ceb94f555d
1 changed files with 6 additions and 1 deletions
|
@ -19,7 +19,12 @@ null_ls.setup({
|
||||||
-- "formatting.prettier.with({disabled_filetypes: {}})" (see null-ls docs)
|
-- "formatting.prettier.with({disabled_filetypes: {}})" (see null-ls docs)
|
||||||
formatting.prettier, -- js/ts formatter
|
formatting.prettier, -- js/ts formatter
|
||||||
formatting.stylua, -- lua formatter
|
formatting.stylua, -- lua formatter
|
||||||
diagnostics.eslint_d, -- js/ts linter
|
diagnostics.eslint_d.with({ -- js/ts linter
|
||||||
|
-- only enable eslint if root has .eslintrc.js (not in youtube nvim video)
|
||||||
|
condition = function(utils)
|
||||||
|
return utils.root_has_file(".eslintrc.js")
|
||||||
|
end,
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
-- configure format on save
|
-- configure format on save
|
||||||
on_attach = function(current_client, bufnr)
|
on_attach = function(current_client, bufnr)
|
||||||
|
|
Loading…
Reference in a new issue