Skip to content

Commit

Permalink
chore: add workflow to format using prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Nov 20, 2024
1 parent d0fb135 commit e534082
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Format

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
- name: Format
run: |
npm run format
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"test:ci:changed": "nx affected -t test --base=origin/main --head=HEAD",
"test-all-versions": "nx run-many -t test-all-versions",
"changelog": "lerna-changelog",
"format": "prettier --check $(git ls-files '*.ts')",
"format:fix": "prettier --write $(git ls-files '*.ts')",
"lint": "nx run-many -t lint && npm run lint:readme && npm run lint:markdown",
"lint:fix": "nx run-many -t lint:fix && npm run lint:markdown:fix",
"lint:deps": "npx --yes [email protected] --dependencies --production --tags=-knipignore",
Expand Down

0 comments on commit e534082

Please sign in to comment.