Remove typescript and tslint from peerDependencies#109
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