-
Notifications
You must be signed in to change notification settings - Fork 176
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
bug: Help with eslint_d timeout #364
Comments
I had the same issue, adding |
Thanks I'll give that a try |
I think this fixed it, haven't seen it again since |
I'm facing the same issue, and I think the solution is not yet found. The problem is that eslint_d takes too much time to format when using conform.nvim. Although, we have workarounds like waiting for 10 seconds each save or using unstable async formatting. |
Same issue still, async workaround is buggy at best |
In what way is async formatting buggy? |
random timeouts mostly |
Timeouts? Async formatting doesn't have timeouts. Unless you're talking about eslint_d itself timing out? |
ya sorry, like the above comment from @Lippiece eslint_d timeouts, so is this whole issue eslint_d related and not related to conform? |
That's what it sounds like. If running the command directly on the command line doesn't time out, then maybe there's something we can do. |
Ok ill try to do some more isolated testing this weekend when i get time |
did you found solution? @jacobrreed |
Not sure if I am adding much to the conversation but
I personally find it sorrowingly hilarious that the solution meant to speed up eslint has chronic timeout issues and that we are considering an async solution. |
The way I solved this is I got rid of "eslint_d" entirely, I have only "eslint-lsp" installed and I've created autocmd which on PreWrite runs "EslintFixAll". It works like a charm for me - performance of save increased by magnitudes. That's how my current conform.lua looks like. return {
"stevearc/conform.nvim",
lazy = false,
config = function()
require("conform").setup({
format_on_save = {
timeout_ms = 500,
lsp_format = "fallback",
},
notify_no_formatters = true,
notify_on_error = true,
formatters_by_ft = {
lua = { "stylua" },
markdown = { "markdownlint" },
terraform = { "tflint" },
json = { "jsonlint", "prettierd" },
dockerfile = { "hadolint" },
javascript = { "prettierd" },
typescript = { "prettierd" },
svelte = { "prettierd" },
go = { "golines", "goimports", "golangci", "golangci_lint_ls", "golangci-lint" },
html = { "htmlbeautifier", "htmlhint" },
tmpl = { "htmlbeautifier", "htmlhint" },
},
})
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("EslintFixAll", { clear = true }),
pattern = { "*.tsx", "*.ts", "*.jsx", "*.js" },
command = "silent! EslintFixAll",
})
end,
} |
@dabrowskif If using the LSP for this, I recommend checking out On a side note, I wish this was supported: local options = {
formatters_by_ft = {
vue = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
formatters = {
eslint_d = {
format_on_save = { -- Can I change the config based on the formatter used?
timeout_ms = 1000,
lsp_fallback = true,
},
},
},
} |
Just adding some additional information, as it seems related to the issue I'm encountering. When eslint is enabled as the LSP and the format_after_save option is set with conform and the LSP fallback enabled, it causes the file to be recursively formatted. I don't believe using eslint for formatting is ideal, but I need a specific rule for organizing/sorting imports, which is why I installed it. I think @dabrowskif's suggested resolution might work (I haven't tested it yet), but since EslintFixAll works fine and the conform setup with eslint_d also works, it could be a good idea to implement a setting where, if both are enabled, this autocmd is triggered. That way, the issue could be avoided in such cases. conform_eslint_prettier_glitch.mp4 |
Hi all 👋🏼 cat ./index.js | eslint_d --fix-to-stdout --stdin |
Neovim version (nvim -v)
NVIM v0.10.0-dev-2258+g1405e5c8c
Operating system/version
MacOS 14.4.1
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
Describe the bug
I have a typescriptreact file, and for my formatters i have :
typescriptreact = { "prettier", "eslint_d" },
I also use https://github.com/pmizio/typescript-tools.nvim
My format_on_save function:
but I also have an autocmd setup because of tstools:
this autocmd is setup because on save I want TSTools to add missing imports, remove unused imports, then call conforms format
The funny thing is, the eslint_d seems to format on save, but then says it times out after
What is the severity of this bug?
breaking (some functionality is broken)
Steps To Reproduce
Expected Behavior
I expect eslint_d to not timeout
Minimal example file
Any typescript react file seems to do this
Minimal init.lua
Additional context
No response
The text was updated successfully, but these errors were encountered: