-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
linter: oxlint VSCode extension not show warn or error for rules like import/no-cycle
and import/no-duplicates
#7118
Comments
Could you share the diagnostics or a reproduction for this? I tried something to reproduce locally, but wasn’t able to reproduce although I’m not super familiar with these rules either. To get the diagnostics in the VS Code extension, set the “oxc-vscode.trace.server” setting to “verbose”. You’ll have to do this in the settings JSON, not the UI. The UI modifies an incorrect setting (issue for that is #7136). |
Today I have more time to debug traces: for
For
after that I turn off import/no-duplicates in eslint and just retest it, just diagnostic not comes from language server. how to test it:
export function a() {
}
export function b() {
}
import { a } from './test.ts';
import { b } from './test.ts'; |
for |
I was able to identify where the problem is, but I don't know what the resolution is. Somebody else may be able to review and fix this, my findings are below. The Here is where the
|
@nrayburn-tech you are correct, the cli takes the cwd and all the paths Line 133 in 9d6cc9d
Turning on the import plugin will hog memory and cpu as it needs to parse and store all ASTs and files. I'm not sure whether we should allow it. If we allow it, it must be project opt-in. And we also need to rearchitect the language server to make it read the whole workspace. |
I don't have any long term suggestions, but seeing different results between the CLI and the IDE is not a good user experience. It might be worthwhile to provide some sort of communication to the user when they are using an IDE plugin and have any import rules enabled. The IDE plugins could possibly
|
From my point of view: it's not a problem for oxlint run this rule every time in IDE, that rule very helpful for identifying circular imports and original rule import/no-cycle works with IDE, but we don't use them because in ci pipeline it gives us +10 mins of linting, but in IDE works well. For my project oxlint run less than in second, looks like not a problem and turning that will be helpful. Also import plugin not used by default, which not alter usual performance. |
@Boshen what do you think about it? Maybe we can add flag to vscode config for turning that on if you think it harm to performance (which is not in my opinion) but that helps a lot for identifying circular deps in IDE.
I prepare my project to isolatedModules (and then in future isolatedDeclarations), but some rules just not working in IDE. |
What version of Oxlint are you using?
0.11.0
What command did you run?
oxlint -c oxlintrc.json
What does your
.oxlint.json
config file look like?What happened?
Rule
import/no-commonjs
works perfectly, butimport/no-cycle
orimport/no-duplicates
not show any sign of error or warn. Maybe problem in multiple spans in rule diagnostic or maybe in incorrect in terms ofvscode
large help info that not correctly handled by VSCode extension?P. S. all rules works well in oxlint console output
The text was updated successfully, but these errors were encountered: