syncpack
syncpack copied to clipboard
feat(cli): add lint and fix commands
Based on some configuration and a glob for package.json files, exits with 0 or 1 based on whether the files match the configuration. Could be used in CI and/or hooks.
EDIT: create a lint command and a fix command which each combine the existing commands which either list issues or fix them.
As a workaround, waiting for this feature, I use the command below in my CI:
npx syncpack@$(node -pe "require('./package').devDependencies.syncpack") list-mismatches
Which exit with a 0 code when there are no mismatches and 1when there
Posting it here in case anyone is searching to use syncpack in his CI pipelines.
syncpack lint added in 10.1.0. A fix command will follow at a later date.
/cc @abelmokadem, @LcTwisk, @amitdahan, @joaopedrodcf, @rpeach, @LudovicSterlin, @gogoout (👍🏻'd this issue)
Awesome feature 🥇
syncpack lintis finished in 12.3.0 as it lints versions, ranges, and now formatting.syncpack fixshouldn't be too big a job now.
/cc @amitdahan, @joaopedrodcf, @LudovicSterlin, @abelmokadem, @danielpza, @LcTwisk, @rpeach, @gogoout, and @dbjorge (+1'd or referenced this issue).