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

Madge is not detecting the right version of Typescript and incorrect warning #416

Open
AddictArts opened this issue Apr 18, 2024 · 2 comments

Comments

@AddictArts
Copy link

My root package.json

`"typescript": "5.2.2",

No other file has "typescript" in it. My global npm

`"typescript": "5.2.2",

I checked the node_modules/typescript/package.json

I also used qnm

qnm typescipt

qnm typescript
typescript 5.4.5 ↰ 1 week ago
├── 5.2.2 ⇡ 7 months ago
└─┬ config-file-ts
  └── 4.9.5 ⇡ 1 year ago

5.2.2 is installed. I ripgrep for 5.4.5 and nothing. I can't determine how madge thinks I have 5.4.5.

I still get

⠋ Finding files=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.4.5

Please only submit bug reports when using the officially supported version.

=============
Processed 45 files (674ms) (2 warnings)
@tetedacier
Copy link

If you run npm ls typescript @typescript-eslint/typescript-estree you should be able to find the dependencies tree related to your problem.

Lately, I run into a similar issues and forces those packages version package.json overrides mechanism:

{
   ...
   "overrides": {
       ...
       "@typescript-eslint/eslint-plugin": "7.7.0",
       "@typescript-eslint/utils": "7.7.0",
       "@typescript-eslint/parser": "7.7.0",
       ...
       "typescript": "5.4.5",
       ...
   },
   ...
}

The issue you mentioned disappeared and my project was still operational 😎

@AddictArts
Copy link
Author

AddictArts commented Apr 19, 2024

@tetedacier thanks, I cannot use overrides, but I tested and it didn't eliminate the warning from madge.

❯ npm ls typescript @typescript-eslint/typescript-estree
[email protected] D:\something
+-- @something/[email protected] -> .\apps\electron
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
|       `-- [email protected]
+-- @typescript-eslint/[email protected]
| +-- @typescript-eslint/[email protected]
| | `-- @typescript-eslint/[email protected] deduped
| +-- @typescript-eslint/[email protected]
| | `-- @typescript-eslint/[email protected] deduped
| `-- [email protected]
|   `-- [email protected] deduped
+-- @typescript-eslint/[email protected]
| `-- @typescript-eslint/[email protected]
`-- [email protected]

I downgraded to 5.1.6. It is not identifying typescript version correctly.

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

2 participants