Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from Jan 8, 2024

Conversation

willmurphyscode
Copy link
Contributor

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 prettier/pretty-quick#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 )

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.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
Signed-off-by: Will Murphy <will.murphy@anchore.com>
Signed-off-by: Will Murphy <will.murphy@anchore.com>
@willmurphyscode willmurphyscode merged commit b24ddc2 into main Jan 8, 2024
15 checks passed
@willmurphyscode willmurphyscode deleted the chore/fix-precommit-hook branch January 8, 2024 14:30
@willmurphyscode willmurphyscode added the dependencies Pull requests that update a dependency file label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants