Closed havenchyk closed 4 years ago
I actually inline eslint plugins because of peerDependency issues (https://github.com/sheerun/prettier-standard/tree/master/src/vendor) so for sure I don't want to make prettierx peerDependency. I can inline it instead, as well as typescript.
By inline I mean vendor
@sheerun tbh, I didn't get how that "vendors" folder works, iirc I had to install all those packages manually, so it worked like peerDependencies
It's not something standard. Before I publish this package I go do vendor folder to install packages to vendor/node_modules
. This way there are packages within prettier-standard itself and don't need to be installed separately as peerDependencies
My advise for @brodybits would be to remove typescript as peerDependency, because it gives annoying warning when someone does not need it. Instead you can use something like require.resolve
to check if typescript is available and require it conditionally only then.
use something like
require.resolve
to check if typescript is available and require it conditionally only then
brodybits/prettierx#63
No promises but I will take a look at this idea.
I think the ultimate solution would be to use TypeScript from an external plugin, see https://github.com/brodybits/prettier-plugin-prettierx-typescript for an example.
I just fixed prettierx
to use peerDependenciesMeta for typescript package, like they did in typescript-estree (see https://github.com/brodybits/prettierx/issues/63#issuecomment-558351490) and just published new release 0.11.0. There are still some warning messages due to other packages, now tracked in brodybits/prettierx#65.
@sheerun upgraded prettierx to 0.11 with bugfix I want to include. what do you think about peerDependenciesMeta?
now it's fine, I've updated it already on master branch, but I'm unable to publish.. something is wrong with npm it seems
I've contacted npm support, let's wait for them to respond
@sheerun seems you already did all the necessary changes, so I'm closing this PR and waiting for new version on npm. Thanks!
@havenchyk I've just published 16.0.0, can you check if it works for you?
@sheerun checked, works like a charm. Thank you! (but I use TypeScript and have typescript package as a dependency) 😄
Hey @sheerun
I see there is a breaking change in this update because prettierx dropped typescript from the bundle and expects it as a peerDependency as far as I understand.
Also my goal is to upgrade prettierx to the next version that will be published (after
0.10.0
- current latest version).This PR is mostly a question, what's the best way to deal with typescript, I don't think that having it as a dependency of
prettier-standard
makes much sense, so maybe it's better to have it as a peerDependency instead?Relates to #89