Added condition to null-ls eslint to enable if eslint config file is present

This commit is contained in:
Josean Martinez 2022-10-23 01:20:11 -04:00
parent 8a46b3b703
commit ceb94f555d

View file

@ -19,7 +19,12 @@ null_ls.setup({
-- "formatting.prettier.with({disabled_filetypes: {}})" (see null-ls docs)
formatting.prettier, -- js/ts 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
on_attach = function(current_client, bufnr)