syncpack icon indicating copy to clipboard operation
syncpack copied to clipboard

feat(cli): add lint and fix commands

Open JamieMason opened this issue 7 years ago • 4 comments
trafficstars

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.

JamieMason avatar Feb 05 '18 12:02 JamieMason

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.

LudovicSterlin avatar Feb 06 '23 08:02 LudovicSterlin

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)

JamieMason avatar May 30 '23 08:05 JamieMason

Awesome feature 🥇

joaopedrodcf avatar Jun 27 '23 17:06 joaopedrodcf

  • syncpack lint is finished in 12.3.0 as it lints versions, ranges, and now formatting.
  • syncpack fix shouldn't be too big a job now.

/cc @amitdahan, @joaopedrodcf, @LudovicSterlin, @abelmokadem, @danielpza, @LcTwisk, @rpeach, @gogoout, and @dbjorge (+1'd or referenced this issue).

JamieMason avatar Dec 30 '23 18:12 JamieMason