Skip to content

Commit 46477f0

Browse files
authored
feat(acts): Create lint.yml
1 parent d630317 commit 46477f0

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# .github/workflows/lint.yml
2+
3+
name: Code Quality Checks (Lint & Format)
4+
5+
on:
6+
pull_request: # Runs when a Pull Request is opened or updated
7+
branches:
8+
- main # Change 'main' to 'prod' if that's your base branch name
9+
push:
10+
branches:
11+
- main # Also runs on direct pushes to the main branch
12+
13+
jobs:
14+
lint-and-format:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: ⬇️ Checkout Repository
18+
uses: actions/checkout@v4
19+
20+
- name: 🛠️ Setup Node.js Environment
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20.x
24+
cache: 'npm' # Uses cache for faster dependency installation
25+
26+
- name: 📦 Install Dependencies
27+
# This installs eslint and prettier, which you correctly added
28+
run: npm ci
29+
30+
- name: 🔎 Run ESLint (JavaScript Linting)
31+
# Executes the script defined below
32+
run: npm run lint:js
33+
34+
- name: 🎨 Run Prettier (Format Check)
35+
# Executes the script defined below. Fails the workflow if code is not formatted.
36+
run: npm run format:check

0 commit comments

Comments
 (0)