Open unlocomqx opened 1 week ago
i get this with a react/ typescript project, its super annoying, and only started happening since the last update for me
i get this with a react/ typescript project, its super annoying, and only started happening since the last update for me
Same.
Here's a repro
This happened to me a while back for react projects, and it drives me nuts. I am back to vscode until this issue is solved
This is tagged as relating to svelte. if any react guys can provide a repro, it would also be helpful to verify the issue.
Same with react / js project and prettier rules comments
Same.
Here's a repro
Thanks for that repo!
I cannot reproduce it though.
Here's what I did:
pnpm install
in it+page.svelte
file to remove the commentsCode is formatted.
I then edited the ESLint config to add another rule:
diff --git a/eslint.config.js b/eslint.config.js
index b5b7d9b..310e012 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -32,6 +32,7 @@ export default [
},
{
rules: {
+ 'prefer-const': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'@typescript-eslint/no-unused-vars': 'warn',
'no-restricted-syntax': [
When I then hit save, ESLint fixes the let
to const
but inserts no comments.
https://github.com/zed-industries/zed/assets/1185253/2062fc74-0fe0-4bc5-982d-24fd02aeae19
Here's the Zed settings.json
that I was using:
{
"languages": {
"Svelte": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
},
"TSX": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
},
"Vue.js": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
},
"JavaScript": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
}
},
"vim_mode": true
}
A similiar issue has occured with my tsx file, but it seemed like it occures more often when I had my settings page open as a tab. And for me it happened when I had two many line (for example two lines and I hit save, and then it adds a comment to ignore an eslint rule)
@mrnugget I tried with these settings and the issue went away
"languages": {
"Svelte": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
}
}
Can you try without that setting to see if you can reproduce it?
Thanks
I am experiencing the same issue in a Typescript project.
I noticed that this is only happening when I have source.organizeImports
enabled. So removing the following snippet from my configuration makes the issue dissapear.
"code_actions_on_format": {
"source.organizeImports": true
},
The issue is also reproducible in the example repo when the setting is enabled.
Here is my Log
2024-07-04T17:36:36-03:00 [INFO] Language server with id 22 sent unhandled notification eslint/status:
{
"uri": "file:///Users/eulke/development/mpfc-balance-frontend/app/components/OpenFinance/Totalizator/TotalAmount/index.js",
"state": 1,
"validationTime": 69
}
2024-07-04T17:36:36-03:00 [INFO] Language server with id 22 sent unhandled notification eslint/openDoc:
{
"url": "https://github.com/prettier/eslint-plugin-prettier#options"
}
Is true that if i comment source.organizeImports
that issue dissapear
"languages": {
"JavaScript": {
"formatter": {
"code_actions": {
"source.fixAll.eslint": true
// "source.organizeImports": true
}
}
}
},
But i want to be able of have both things
Is true that if i comment
source.organizeImports
that issue dissapear"languages": { "JavaScript": { "formatter": { "code_actions": { "source.fixAll.eslint": true // "source.organizeImports": true } } } },
But i want to be able of have both things
Yes, same here, if I comment this, it doesn't happen
"code_actions_on_format": {
"organize_imports": true
},
So it's a language server that adds these comments then? Which language server is that? Is there a way to disable that behaviour? Or is it about the order of the code actions?
So it's a language server that adds these comments then? Which language server is that? Is there a way to disable that behaviour? Or is it about the order of the code actions?
Must be the eslint ls
Check for existing issues
Describe the bug / provide steps to reproduce it
Simple Repro
I have a few custom eslint rules
When I have code inside a svelte file that triggers an eslint warning or error, I get an eslint-disable comment that is inserted automatically
It also happens for other svelte rules, not just custom rules
Environment
Zed: v0.141.2 (Zed) OS: macOS 14.5.0 Memory: 16 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.Zed.log