keithamus/sort-package-json

Doesn't handle betterScripts correctly

Open

#399 geöffnet am 29. Jan. 2026

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (101 Forks)github user discovery
bughelp wanted

Repository-Metriken

Stars
 (913 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

The sripts and betterScripts fields are treated as strings, but the betterScripts format supports objects. Because of this, the script crashes with an error if betterScripts is an object.

"better-scripts": { "dev": { "alias": "🧑🏻‍💻 Dev", "command": "react-scripts start", "desc": "Start a development server" } }

TypeError: command.includes is not a function at isSequentialScript (file:sort-package-json/index.js:261:11) at file:sort-package-json/index.js:273:35 at Array.some (<anonymous>) at hasSequentialScript (file:sort-package-json/index.js:273:18) at file:sort-package-json/index.js:321:8 at file:sort-package-json/index.js:22:24 at file:sort-package-json/index.js:67:34 at file:sort-package-json/index.js:12:32 at Array.reduce (<anonymous>) at file:sort-package-json/index.js:12:9 at file:sort-package-json/index.js:555:14 at file:sort-package-json/index.js:22:24 at editStringJSON (file:sort-package-json/index.js:524:22) at sortPackageJson (file:sort-package-json/index.js:536:10)

Contributor Guide