diff --git a/.config/nvim/lua/josean/plugins/lsp/null-ls.lua b/.config/nvim/lua/josean/plugins/lsp/null-ls.lua index bff4f20..ba24920 100644 --- a/.config/nvim/lua/josean/plugins/lsp/null-ls.lua +++ b/.config/nvim/lua/josean/plugins/lsp/null-ls.lua @@ -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)