ci: check pull requests keep prettier formatting

This commit is contained in:
Nathan Muir
2025-08-19 12:27:18 +12:00
committed by Nathan Muir
parent 0ac2ecf89b
commit 0a8c471a6c
2 changed files with 18 additions and 1 deletions

13
.github/workflows/prettier.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: check formatting
on:
pull_request:
jobs:
fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: 'latest'
- run: npm install
- run: npm run fmt:check

View File

@@ -35,6 +35,8 @@
"start": "npm run test:watch", "start": "npm run test:watch",
"compile": "npm run clean && npm run tsc && cp ./src/index-types.d.ts ./lib/index-types.d.ts && npm run rollup", "compile": "npm run clean && npm run tsc && cp ./src/index-types.d.ts ./lib/index-types.d.ts && npm run rollup",
"build": "npm run compile && cp ./src/index-types.d.ts ./lib && gulp build && node ./rename-imports.mjs", "build": "npm run compile && cp ./src/index-types.d.ts ./lib && gulp build && node ./rename-imports.mjs",
"fmt": "prettier --write .",
"fmt:check": "prettier --check .",
"test:import": "npm run build && node ./test/import-test.cjs && node ./test/import-test.mjs", "test:import": "npm run build && node ./test/import-test.cjs && node ./test/import-test.mjs",
"test": "npm run test:browser && npm run test:node && npm run test:import", "test": "npm run test:browser && npm run test:node && npm run test:import",
"test:build": "PARCEL_WORKER_BACKEND=process parcel build ./test/unit-tests.html --dist-dir ./test-build --target none --public-url ./ --no-source-maps", "test:build": "PARCEL_WORKER_BACKEND=process parcel build ./test/unit-tests.html --dist-dir ./test-build --target none --public-url ./ --no-source-maps",
@@ -100,6 +102,7 @@
"mocha": "10.2.0", "mocha": "10.2.0",
"mocha-headless-chrome": "^4.0.0", "mocha-headless-chrome": "^4.0.0",
"parcel": "2.13.3", "parcel": "2.13.3",
"prettier": "^3.6.2",
"process": "^0.11.10", "process": "^0.11.10",
"rollup": "^4.46.2", "rollup": "^4.46.2",
"rollup-plugin-typescript2": "^0.36.0", "rollup-plugin-typescript2": "^0.36.0",
@@ -116,7 +119,8 @@
"html5" "html5"
], ],
"prettier": { "prettier": {
"singleQuote": true "singleQuote": true,
"trailingComma": "es5"
}, },
"bugs": { "bugs": {
"url": "https://github.com/konvajs/konva/issues" "url": "https://github.com/konvajs/konva/issues"