Skip to content

[Feature] dpdm.config.ts #65

Description

@kachkaev

Is your feature request related to a problem? Please describe.

I'm using dpdm in a monorepo and it works well. There is a small problem that I have encountered. Configuring dpdm for each workspace is a bit repetitive and brittle: I have to add this pretty long command to package.jsons:

    "lint:dpdm": "dpdm --exit-code circular:1 --tree false --transform --warning false '**/*.{ts,tsx}'",

Describe the solution you'd like

If there was a way to define an ESM-first dpdm.config.ts (like vite.config.ts, eslint.config.ts), that could improve the situation. I could have a base config in a corresponding namespace and re-export it in other workspace. Composing configs would become easier too. The same config type could be passed down to dmdm via API its JS API.

Describe alternatives you've considered

Crafting a config using args in package.json scripts, but that can't be autocompleted or linted. Took a bit of time to set up the args.

Additional context

Ultimately, I would also like to see some form of 'allow list' for circular dependencies. Similar config options exist in knip.config.ts for ignoring dependencies etc. Not all circular dependencies are easy to fix. If few tough ones a remaining, adding them to a config as exceptions can help with further codebase development. It will be possible to fail dmdm if new kinds of cycles are created, but the existing ones are tolerable until the opportunity shows up. We use this trick in Knip for 'orphan' files that are no longer used but cannot be deleted just yet for various reasons.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions