trivago / prettier-plugin-sort-imports

A prettier plugin to sort imports in typescript and javascript files by the provided RegEx order.
Apache License 2.0
3.28k stars 129 forks source link

Fix prepare script, consumers should not need to have yarn to be able to install package as a git dependency in package.json #256

Closed scmx closed 8 months ago

scmx commented 1 year ago

Currently when installing the package it will crash if yarn isn't installed. Because the prepare script runs on consumers machines after install.

Suggested solution: Run tsc directly instead.


Thanks for this nice package by the way! 🎉

scmx commented 1 year ago

Had a hard time reproducing this myself. But apparently we had this in package json when the problem occurred (leftover since some earlier point when a problem was fixed in main but not yet published). "@trivago/prettier-plugin-sort-imports": "github:trivago/prettier-plugin-sort-imports", and got: npm ERR! sh: yarn: command not found Changing to direct npm version solves it. Or installing yarn. With docker node image yarn is available so no problem there. 🤷