-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format on save doesn't work #92
Comments
If ur case is
|
I'm experiencing something similar to @lili21, but in my case is that neither prettier nor eslint format when saving (or assigning it to any key). I'm on windows, with nvim 0.8.2 |
Same issue here, anyone found workarounds? |
Hey @AlvaroAquijeDiaz and @lili21, you both are on windows? Take a look at this jose-elias-alvarez/null-ls.nvim#1118 |
I'm on macOS but will check as well and update if found some workaround |
@AlvaroAquijeDiaz, There is an error in null-ls regarding the path of the language server executable, specifically those coming from npm. However I managed to solve my eslint problem by adding null_ls.setup {
sources = {
null_ls.builtins.formatting.prettierd,
null_ls.builtins.formatting.eslint_d, -- Here
null_ls.builtins.diagnostics.eslint_d.with({
diagnostics_format = '[eslint] #{m}\n(#{c})'
}),
null_ls.builtins.diagnostics.fish
},
...
} I hope it helps you |
@Pkcarreno great news, however I haven't had the chance to look at the other link you mentioned but will update when I do it |
In the null-ls.rc.lua, just rewrite -- inside null.ls.setup()
sources = {
null_ls.builtins.formatting.prettier,
-- null_ls.builtins.diagnostics.eslint_d.with({
-- diagnostics_format = '[eslint] #{m}\n(#{c})'
-- }),
null_ls.builtins.diagnostics.zsh,
null_ls.builtins.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") -- change file extension if you use something else
end,
}),
null_ls.builtins.code_actions.eslint_d
},
|
this commit delete the
prettier.rc.lua
file. which maybe the reason.I put the file back, and now it works.
The text was updated successfully, but these errors were encountered: