Skip to content

Commit

Permalink
🤖 add github workflow (lint and format)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzear committed Oct 11, 2024
1 parent 65c20c0 commit 08c771d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint and Format

on:
push:
branches: ['*']
pull_request:
branches: ['*']

jobs:
lint-and-format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.yarn-cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Run Linter
run: yarn lint

- name: Run Formatter
run: yarn format
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"clean": "turbo run clean && del-cli \"**/.turbo\" -d",
"purge": "yarn clean && del-cli \"**/node_modules\" node_modules -d",
"dev": "turbo run dev --no-cache --parallel --continue",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"format": "prettier --write \"**/*.{ts,tsx,md,yml}\"",
"lint": "turbo run lint --parallel --",
"lintall": "eslint . --quiet --fix --ext .js,.ts,.jsx,.tsx,.html,.vue,.md,.json,.sql,.mjs,.cjs",
"ncu": "npx npm-check-updates --workspaces --upgrade --root",
Expand Down

0 comments on commit 08c771d

Please sign in to comment.