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

Typescript types not available in setup with Yarn PnP, Yarn VS Code SDK #1192

Open
marvinruder opened this issue Feb 7, 2023 · 2 comments · May be fixed by #1285
Open

Typescript types not available in setup with Yarn PnP, Yarn VS Code SDK #1192

marvinruder opened this issue Feb 7, 2023 · 2 comments · May be fixed by #1285
Labels
bug there is a bug in the way jimp behaves

Comments

@marvinruder
Copy link

marvinruder commented Feb 7, 2023

Expected Behavior

Yarn types are available in IDE and used by Typescript for type-checking.

Current Behavior

Types are not available, IDE shows (alias) type Jimp = any. Typescript does not throw an error at Jimp.thisFunctionDoesNotExist();.

Failure Information (for bugs)

Steps to Reproduce

  1. git clone git@github.com:marvinruder/jimp-no-types-available.git && cd jimp-no-types-available
  2. yarn
  3. yarn build
  4. yarn start
  5. When using VS Code, hovering over import Jimp from "jimp"; shows (alias) type Jimp = any

Screenshots

image

Context

Context is given in marvinruder/jimp-no-types-available and was briefly mentioned in #1189.

  • Jimp Version: 0.22.4
  • Operating System: macOS 13.2 (build 22D49)
  • Node version: 19.6.0
@marvinruder
Copy link
Author

marvinruder commented Feb 7, 2023

Already tried yarn unplug jimp, has no effect, type Jimp is still resolved to any.

In tsconfig.json, "skipLibCheck": true appears to be required, removing it throws 27 errors: error TS2307: Cannot find module '@jimp/core' or its corresponding type declarations. Might be worth looking into as well.

@marvinruder marvinruder added the bug there is a bug in the way jimp behaves label Feb 7, 2023
@MikuZZZ
Copy link

MikuZZZ commented Oct 24, 2023

Add these lines to .yarnrc.yml should solve this problem

packageExtensions:
  jimp@*:
    dependencies:
      '@jimp/core': '*'

@hipstersmoothie hipstersmoothie linked a pull request Mar 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug there is a bug in the way jimp behaves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants