Skip to content

Commit ee47e66

Browse files
committed
ci: add format check
1 parent 69f811d commit ee47e66

6 files changed

Lines changed: 17 additions & 0 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# https://stackoverflow.com/questions/61958231/github-actions-prettier-finds-errors-only-on-windows-latest
2+
* text=auto eol=lf

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656
- name: Build
5757
run: npm run build:test
5858

59+
- name: Format
60+
run: npm run format
61+
5962
- name: Lint
6063
run: npm run lint
6164

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"dev": "pnpm -r --filter ./packages --parallel run dev",
66
"build": "pnpm -r --filter ./packages run build",
77
"build:test": "pnpm -r --filter ./packages run build:test",
8+
"format": "prettier --check \"packages/*/src/**/*.{ts,js}\"",
89
"lint": "eslint --ext .js,.ts packages/*/src/**",
910
"test": "jest --clearCache && cross-env jest --runInBand",
1011
"test:coverage": "jest --clearCache && jest --runInBand --coverage=true",
@@ -49,6 +50,7 @@
4950
"lint-staged": "^11.0.0",
5051
"minimist": "^1.2.5",
5152
"playwright-chromium": "^1.12.3",
53+
"prettier": "^2.3.2",
5254
"prompts": "^2.4.1",
5355
"rimraf": "^3.0.2",
5456
"semver": "^7.3.5",

pnpm-lock.yaml

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

scripts/publish.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const distTag = args['dist-tag']
88
async function main() {
99
await fs.copyFile('README.md', 'packages/vite-plugin-checker/README.md')
1010
await $`pnpm i`
11+
await $`npm run format`
1112
await $`npm run lint`
1213
await $`npm run type-check`
1314
await $`npm run build`

scripts/release.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const sleep = (millisecond) =>
4343

4444
async function preCheck() {
4545
cd('../../')
46+
await $`npm run format`
4647
await $`npm run lint`
4748
await $`npm run type-check`
4849
await sleep(0) // don't know why

0 commit comments

Comments
 (0)