Skip to content

💡 Tracking circular dependencies #1734

Description

@kachkaev

Suggest an idea for Knip

👋 webpro and folks!

At the moment, knip docs mention circular dependency tracking as something that's out of scope of knip.

https://knip.dev/reference/related-tooling#circular-dependencies

## Circular dependencies
Knip has no issues with circular dependencies, and does not report them. Tools
that do support this include [DPDM][5], [Madge][6] and [skott][7].

I wonder if that's a strategic decision or a feature that can be eventually added at some point.

I use knip in a couple of projects and it's a really useful source of feedback. Since exports are already tracked, knip must have already built an import graph that could be used for searching cycles in it. The existing config system is a perfect fit for exceptions, if necessary.

I am currently using dpdm to fill in the gap and it works, but feels to occupy in the same linting niche as knip. Unfortunately, dpdm cannot be configured via dpdm.config.ts (acrazing/dpdm#65) and there is no way to define a list of known exceptions.

WDYT of including circular dependency scanning into knip?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions