-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (39 loc) · 1.1 KB
/
Copy pathlint.yml
File metadata and controls
49 lines (39 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Lint & Format Check
on:
pull_request:
push:
branches:
- prod
- development
jobs:
lockfile-check:
name: Lockfile Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check for package-lock.json
run: |
if [ -f "package-lock.json" ]; then
echo "::error::package-lock.json detected! This project uses Yarn v1. Please remove package-lock.json and use 'yarn install' instead of 'npm install'."
exit 1
fi
echo "✓ No package-lock.json found. Using Yarn as expected."
lint:
name: ESLint & Prettier
runs-on: ubuntu-latest
needs: lockfile-check
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run ESLint
run: yarn lint
- name: Check Prettier formatting
run: yarn format:check