lint rule: no-cycle #4187
Replies: 2 comments
-
Maybe rome could approach this rule in a performant manner ? The eslint rule is really slow. in rome it seems like every file is treated in a separate thread and results are collected at the end So maybe we could build the dependency graph during the linting and sequentially find the cycles at the end ? The issue I see with that is that it would be difficult to expose the diagnostic at the file level, and maybe IDE integration rely on that ( I really dont know I only spent an afternoon reading the code base ) or maybe it relies on the rome server to get the information on a specific file An other approach would be to stagger the threads while the graph is built, to collect the dependency cycle diagnostics from the leafs up, Anyway I am sure this rule is a must have for most projects, and IDE integration of this rule is rather important as it helps to drive the design of the software, but I am unsure whether rome should tackle that or we should wait for another tool for "project-wide" lint |
Beta Was this translation helpful? Give feedback.
-
I just spotted this discussion and think it might be something that could be implemented on top of the I will first attempt to build an MVP of that rule which wouldn’t yet need knowledge of the full project layout and its imports, but at least some of the other options I’m considering for that rule would also benefit from knowledge that would reside in other files, so being able to gather “project-wide” knowledge seems desirable for that rule in any case. Not yet sure exactly how to solve it within Rome, but if it seems feasible, I might pick this up as well. |
Beta Was this translation helpful? Give feedback.
-
I miss this rule from eslint: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
Circular dependencies are hell, this plugin helped a lot rooting them out.
Is it on the roadmap?
Beta Was this translation helpful? Give feedback.
All reactions