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 21152a4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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: Build ESLint Config
run: yarn workspace @ubahnchen/eslint-plugin build

- name: Run Linter
run: yarn lint

- name: Run Formatter
run: yarn prettier -c
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}\"",
"prettier": "prettier \"**/*.{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 21152a4

Please sign in to comment.