-
Hi everyone! I used eslint LSP for long time. As for now, it doesn't respect the new eslint flat config format. I tried to debug it within vscode because as far as I know, mason eslint lsp use the vscode eslint lsp. And yeah, it can't find eslint.config.js while .eslintrc.js finds just fine CleanShot.2024-03-14.at.14.49.13-converted.mp4I managed to get it to work with vscode by adding return {
'neovim/nvim-lspconfig',
-- other settings removed for brevity
opts = {
---@type lspconfig.options
servers = {
eslint = {
settings = {
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
workingDirectories = { mode = 'auto' },
experimental = {
-- allows to use flat config format
useFlatConfig = true,
},
}
},
},
}
} But it doesn't work for whatever reason. Has anyone configured the eslint flat config to work with eslint LSP or with eslint_d? P.S. Does anyone know any plugin that helps to see debug logs per each LSP? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
I did a quick test, and it just works. I use the "extras.linting.eslint" rule. Maybe you could be more speficic what is "not working"? |
Beta Was this translation helpful? Give feedback.
-
Related issue with latest version of vscode-langservers-extracted: microsoft/vscode-eslint#1839 |
Beta Was this translation helpful? Give feedback.
-
I spent two hours before finding the solution by @Demianeen. Wondering what's the best solution for this since it's been a month now. Maybe lazyvim should have a warning in the readme (I can help with this)? Or mention this to Mason devs so they can use 4.8.0 as latest? Not sure what's the best way to spare lazyvim users this problems since there is no error message to figure out. |
Beta Was this translation helpful? Give feedback.
-
Yesterday |
Beta Was this translation helpful? Give feedback.
Thanks @madflow! Thanks to you I figured out that the issue was the eslint config itself. It is strange because it worked fine with the same configuration with .eslintrc 😅
It is also super strange that there were no error in lsp debug log about error with starting eslint