Skip to content

enfore the format in the ci, script to fail locally if version are di…#354

Open
Yostra wants to merge 1 commit intomainfrom
enfore_formatting
Open

enfore the format in the ci, script to fail locally if version are di…#354
Yostra wants to merge 1 commit intomainfrom
enfore_formatting

Conversation

@Yostra
Copy link
Copy Markdown
Collaborator

@Yostra Yostra commented May 2, 2026

Summary

This PR strictly enforces Prettier formatting in CI and locks the Prettier version to prevent local drift.

Changes

  • Enforced formatting in CI: Removed continue-on-error: true from the formatting check step in .github/workflows/ci.yml.
  • Pinned Prettier version: Updated package.json to pin prettier exactly to 3.6.2 (removing the ^) to prevent accidental version drift.
  • Added Prettier version check: Created a scripts/check-prettier-version.js script that validates the locally installed Prettier version against the exact resolution in pnpm-lock.yaml as a part of the pnpm format and pnpm format:check scripts. If a local version is out of sync, the script will immediately exit with an error, prompting you to run pnpm install.

Testing

I've tested locally by installing a different version of prettier and running pnpm format, this resulted in an error:


❌ ERROR: Installed Prettier version (3.5.3) does not match the expected locked version in pnpm-lock.yaml (3.6.2).
   Please run 'pnpm install' to sync your local environment with CI and prevent formatting drift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant