File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments