Skip to content

Commit

Permalink
ci: Add linting and formatting checks workflow (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixpereira authored Oct 15, 2024
1 parent d46314b commit 0586dfb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci-dev-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Development - Pull Request
on:
pull_request_target:
branches:
- main

jobs:
lint-format:
name: Linting and Formatting Checks
uses: ./.github/workflows/lint-and-format.yml
28 changes: 28 additions & 0 deletions .github/workflows/lint-and-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Linting and Formatting Checks
on:
workflow_call:

jobs:
es-lint:
name: ESLint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm install
- run: pnpm run lint

prettier:
name: Prettier
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm install
- run: pnpm run format:check
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"format": "prettier --write \"**/*.{js,ts,tsx,css,md,cjs,mjs,json,html}\"",
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,css,json,mjs,cjs,yml,yaml}\"",
"test": "vitest"
},
"dependencies": {
Expand Down

0 comments on commit 0586dfb

Please sign in to comment.