bcomnes / npm-run-all2

A CLI tool to run multiple npm-scripts in parallel or sequential. (Maintenance fork)
MIT License
250 stars 12 forks source link

Prettier plugin `prettier-plugin-packagejson` fails when switching to this package #129

Closed viceice closed 8 months ago

viceice commented 8 months ago

Renovate is now suggesting to replace the npm-run-all with npm-run-all2 which is good, but on some repos prettier starts failing. I also tried the latest v6 with no difference. Any idea?

diff --git a/package.json b/package.json
index 9090468..58a787e 100644
--- a/package.json
+++ b/package.json
@@ -7,8 +7,8 @@
   "author": "Michael Kriese <michael.kriese@visualon.de>",
   "type": "module",
   "scripts": {
-    "lint": "run-s prettier",
     "postinstall": "husky install",
+    "lint": "run-s prettier",
     "prettier": "prettier \"{**/*,*}.*\" --check --ignore-unknown",
     "prettier:fix": "prettier \"{**/*,*}.*\" --write --ignore-unknown"
   },
viceice commented 8 months ago

Seeing it on yarn v3 and pnpm v8, so seems unrelated to package manager

kachkaev commented 8 months ago

Should be fixed when https://github.com/keithamus/sort-package-json/pull/309 is released.

bcomnes commented 8 months ago

Add numbers to your script names to ensure the desired sort order if it is sort dependent. Thanks for the additional context @kachkaev.