Skip to content

Commit 4a1c408

Browse files
committed
chore: add workflow to format using prettier
1 parent 2784357 commit 4a1c408

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.github/workflows/format.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Format
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 18
17+
cache: 'npm'
18+
- run: npm ci
19+
- name: Format
20+
run: |
21+
npm run format

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"test:ci:changed": "nx affected -t test --base=origin/main --head=HEAD",
2121
"test-all-versions": "nx run-many -t test-all-versions",
2222
"changelog": "lerna-changelog",
23+
"format": "prettier --check $(git ls-files '*.ts')",
24+
"format:fix": "prettier --write $(git ls-files '*.ts')",
2325
"lint": "nx run-many -t lint && npm run lint:readme && npm run lint:markdown",
2426
"lint:fix": "nx run-many -t lint:fix && npm run lint:markdown:fix",
2527
"lint:deps": "npx --yes [email protected] --dependencies --production --tags=-knipignore",

0 commit comments

Comments
 (0)