Skip to content

Commit

Permalink
Add prettier to project and actions (#85)
Browse files Browse the repository at this point in the history
* Install prettier

* Rework github actions:

- Add prettier-check action
- Add caching
- Rename pnpm command
  • Loading branch information
Seismix authored Feb 5, 2025
1 parent 8eb6f9a commit 75945bf
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/css-selectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
version: 10

- name: Setup node.js
uses: actions/setup-node@v4
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/prettier-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Prettier Check

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run Prettier check
run: pnpm run format:check
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"build:chrome": "TARGET=chrome vite build",
"test": "playwright test --reporter=list",
"test:ui": "playwright test --ui",
"test:detailed": "playwright test"
"test:detailed": "playwright test",
"format": "prettier --write src/",
"format:check": "prettier --check src/"
},
"repository": {
"type": "git",
Expand All @@ -42,6 +44,7 @@
"@types/firefox-webext-browser": "^120.0.4",
"@types/node": "^22.13.1",
"@types/webextension-polyfill": "^0.12.1",
"prettier": "^3.4.2",
"typescript": "^5.7.3",
"web-ext": "^8.3.0",
"webextension-polyfill": "^0.12.0"
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 75945bf

Please sign in to comment.