anchore / scan-action

Anchore container analysis and scan provided as a GitHub Action
MIT License
202 stars 75 forks source link

chore: switch from pretty-quick to lint-staged #266

Closed willmurphyscode closed 8 months ago

willmurphyscode commented 8 months ago

pretty-quick was broken by version 3 of prettier in July, but has had no update. Switch to using lint-staged as the runner to lint staged changes based on the docs at https://prettier.io/docs/en/precommit.html. See also https://github.com/azz/pretty-quick/issues/164 and https://stackoverflow.com/a/76628485.

Previously, the pre-commit hook would fail with:

  TypeError: _prettier.resolveConfig.sync is not a function
      at /home/runner/work/scan-action/scan-action/node_modules/pretty-quick/dist/isSupportedExtension.js:12:30
      at Array.filter (<anonymous>)
      at _default (/home/runner/work/scan-action/scan-action/node_modules/pretty-quick/dist/index.js:53:157)
      at Object.<anonymous> (/home/runner/work/scan-action/scan-action/node_modules/pretty-quick/bin/pretty-quick.js:17:27)

(for example at https://github.com/anchore/scan-action/actions/runs/7444244946/job/20250341194#step:5:69 )