Skip to content

Commit 3a8fdbb

Browse files
committed
ci: add a prettier check
Prettier becomes a devDependency with a lockfile, so the check is reproducible: npm ci installs the pinned version and npm run format:check enforces it. Markdown stays outside Prettier's scope through .prettierignore, since its prose and table reflow churns docs without improving consistency. The check runs on the same triggers as the test and benchmark jobs. Signed-off-by: Bryan English <bryan@bryanenglish.com>
1 parent 3150eec commit 3a8fdbb

5 files changed

Lines changed: 52 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,13 @@ jobs:
3232
with:
3333
node-version: latest
3434
- run: npm run bench
35+
36+
prettier:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v7
40+
- uses: actions/setup-node@v7
41+
with:
42+
node-version: latest
43+
- run: npm ci
44+
- run: npm run format:check

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

‎.prettierignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.md

‎package-lock.json‎

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
},
2828
"scripts": {
2929
"test": "node --test 'test/test-*.js'",
30-
"bench": "node --experimental-bench --bench 'benchmark/*.bench.js'"
30+
"bench": "node --experimental-bench --bench 'benchmark/*.bench.js'",
31+
"format:check": "prettier --check ."
32+
},
33+
"devDependencies": {
34+
"prettier": "3.9.10"
3135
}
3236
}

0 commit comments

Comments
 (0)