Skip to content
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

[Question] IDE integration #272

Closed
tmtron opened this issue Mar 5, 2020 · 3 comments
Closed

[Question] IDE integration #272

tmtron opened this issue Mar 5, 2020 · 3 comments

Comments

@tmtron
Copy link

tmtron commented Mar 5, 2020

Is there a way to show dependency errors directly in IDEs (e.g. IntelliJ)?

I woud be great if the checks could be run in background and the IDE could show the errors directly in the editor on the fly - e.g. like TsLint/EsLint checks

Or maybe these checks could even be called via an EsLint rule (e.g. like the eslint-plugin-import plugin)

@sverweij
Copy link
Owner

Hi @tmtron - that is a cool idea! I don't know of the existence of any IDE integration (IntelliJ or otherwise) at this time that shows dependency errors in a fashion akin to linter plugins. Dependency-cruiser does have a documented API, though. With some acuity in the IDE's plugin system it shouldn't be too hard to write such an integration. Enterprising folks have made e.g. an integration with vscode, and other folks have used it for server side integrations.

B.t.w. if you're into the JetBrain's tool chain - the output format teamcity was made for Team City.

eslint plugin

Also a good suggestion. To the best of my knowledge that doesn't exist yet.

I did consider writing an eslint plugin before, but at the time rejected the idea. Time lacked, but there were other considerations as well. Dependency-cruiser already supported 4 languages, eslint at the time only one. I also didn't see how to do checks that run over more than one dependency (reachable, circular) while remaining decently performant.

I've been looking into writing an eslint plugin again recently, though (for different purposes), and with some pragmatism it should be possible to have rule configurations checked with an eslint plugin. It will still require quite a time investment, though...

@tmtron
Copy link
Author

tmtron commented Mar 11, 2020

Thanks @sverweij for the answer and especially for links to the external tools.

@tmtron tmtron closed this as completed Mar 11, 2020
@namoscato
Copy link

namoscato commented Apr 26, 2024

👋🏻 @sverweij, thank you for this great project!

I was curious if there has been any update on an IDE integration or if you are aware of any ESLint plugins? We heavily rely on ESLint's early development feedback in IDEs, which would be great to maintain ahead of opening pull requests / CI checks.

Edit: Per #529, eslint-plugin-dependency-cruiser is an option / starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants