-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
fork-ts-checker-webpack-plugin tried to access typescript, but it isn't declared in its dependencies #497
Comments
Hi! Thanks for reporting this issue. I'm afraid that even if we add typescript, there will be the same situation with eslint. And we don't want to have eslint in the peerDependencies as it's optional. Maybe we could add typescript and eslint to |
I read a little bit more about We combine typescript checking and eslint linting in one package. Because of that, we can't use peerDependencies for eslint. Also, there is an open PR to make typescript path configurable. This means we will resolve typescript path dynamically anyway. Is there any option to disable this warning for a certain use-case? |
What I do to resolve this issue is to instruct packageExtensions:
fork-ts-checker-webpack-plugin@*:
peerDependencies:
typescript: '*' That silences the warning, but does not solve the issue. The thing is you do depend on typescript but you do not explicitly mention that... |
Not really - we can disable typescript and use only eslint. It was declared as a peerDependency before, but it was also an issue when you use it in a "config-only" packages (see #201). We will not change it, as it would show unwanted warnings for other packages, like create-react-app. |
It can be declared as an optional peer dependency using |
Following that documentation, only in combination with it being a |
Also, "optional" just means "don't throw an error if it cannot be installed", not "do not install by default". |
Both npm and pnpm support it for a while. Also
It means both, since peer dependencies aren't being installed by default (though that might change in npm v7) |
Not sure the closing of the issue without taking into account the clarification on peerDependenciesMeta is justified. |
Current behavior
When using fork-ts-checker-webpack-plugin as a dependency with strict package managers such as yarn berry, the following warning/error is issued:
This is actually due to the fact that fork-ts-checker-webpack-plugin does import 'typescript' but does not declare it in its peerDependencies.
Expected behavior
fork-ts-checker-webpack-plugin package.json should explicitly add
typescript
as a peer dependency.Environment
The text was updated successfully, but these errors were encountered: