-
-
Notifications
You must be signed in to change notification settings - Fork 246
Remove typescript and tslint from peerDependencies #109
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
Conversation
If we want to remove it from peerDeps, we should add some checks (for typescript package and it's version) in the plugin code to inform user that typescript is not available and he has to install it to use this plugin. :) |
Isn't this what https://docs.npmjs.com/files/package.json#optionaldependencies is for? |
Unfortunately optionalDependencies don't work with peerDependencies, they have to be direct dependencies of this package and not its dependent, which isn't helpful. |
This isn't correct.
If you want to not get runtime errors, you will need to write something like this. let typescript;
try {
typescript = require('typescript');
} catch (err) {
console.warn('TypeScript needs to be installed for fork-ts-checker-webpack-plugin to do anything.');
}
// ...somewhere deep within the plugin...
if (typescript) {
// Conditionally decide what to do if it is installed here.
} |
... and this when using
I'm not using the tslint integration, and it even requires setting |
If you remove the I think what you're implicitly asking for is optional |
Closing because it was done in #201 |
Was also discussed in #102,
Our problem with those peerDeps, is that we optionally use typescript in our build process, so just by having this package in the dependencies, it throws the error
typescript is required
.It should be like ts-loader, typescript is required but it's up to the user to install it.
Thre README is fine since it says it explicitly to install also typescript.
Closes #102