Skip to content

Commit

Permalink
feat: add lint as github action
Browse files Browse the repository at this point in the history
  • Loading branch information
yjose committed Sep 16, 2024
1 parent b3bd49c commit f4fe07a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

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

- name: Run linting
run: pnpm run lint:ci
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"astro": "astro",
"test": "vitest",
"test:ci": "vitest --coverage.enabled true",
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\""
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\"",
"lint:ci": "eslint \"src/**/*.{js,ts,jsx,tsx,astro}\""
},
"dependencies": {
"@astro-utils/context": "^1.1.15",
Expand Down

0 comments on commit f4fe07a

Please sign in to comment.