Skip to content

chore(package): typescript 6 as peer optional - #460

Open
furcan wants to merge 1 commit into
pahen:masterfrom
furcan:chore/typescript-6
Open

chore(package): typescript 6 as peer optional#460
furcan wants to merge 1 commit into
pahen:masterfrom
furcan:chore/typescript-6

Conversation

@furcan

@furcan furcan commented Apr 7, 2026

Copy link
Copy Markdown

Context

First of all, great tool, thank you very much for this library.

Continuing, with the TypeScript 6 projects,
PNPM does handle this with graceful warnings but native NPM is complaining.

Note

I am also not sure why TypeScript is a peer dependency for this package, do we really need this?
Overall, this a JavaScript library and I did not see a use in lib code as TS, its JS.
But, if I am missing something, please update the PR.


Yes, I was missing something, its in use as an api for reading the optional tsConfig prop for madge to read/merge the given tsconfig.json for path analysis/resolution.

And this is opening another door that, "typescript is a direct dependency" for this library by the package management aspect. The optional use case in the code itself does not make a package as peer optional.

Overall, adding TypeScript 6 as peer due to current package.json/project structure still valid, and the following comment can mitigate the issue.

Changes

  • Add TypeScript 6 as peer optional

@Milad

Milad commented Apr 23, 2026

Copy link
Copy Markdown

Would love to see this merged.

@Jean-Dum

Jean-Dum commented May 8, 2026

Copy link
Copy Markdown

Hello! Could this PR be merged?
This is one of the packages blocking the update to typescript 6, so indeed removing typescript from peer dependencies could be a great idea!

@furcan

furcan commented May 8, 2026

Copy link
Copy Markdown
Author

I tried to contact with the owner of this project, but couldn't get any answer yet (I hope they are doing well)

So, for PNPM, it handles this with graceful warnings, but for NPM, it will block the processes,

And due to unblocking your CI/CD, for NPM, you can use the following overrides config in your package.json

What is overrides?

Mitigation:

"overrides": {
    "madge": {
      "typescript": "$typescript",
      "precinct": {
        "detective-typescript": {
          "typescript": "$typescript"
        },
        "detective-vue2": {
          "typescript": "$typescript"
        }
      }
    }
  }

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

Successfully merging this pull request may close these issues.

3 participants