Skip to content

Commit c4c941a

Browse files
committed
ci: add ESLint and Prettier checks to CI workflow
- Add lint script to run ESLint on all source files - Add format script to check Prettier formatting - Update CI workflow to run lint and format checks on PRs - Format check is non-blocking (continue-on-error) due to existing code style
1 parent 634b1a1 commit c4c941a

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
CI: true
3939

4040
lint:
41-
name: Lint
41+
name: Lint & Format
4242
runs-on: ubuntu-latest
4343

4444
steps:
@@ -54,5 +54,12 @@ jobs:
5454
- name: Install dependencies
5555
run: npm ci
5656

57-
- name: Build
57+
- name: Build (required for type-aware linting)
5858
run: npm run build
59+
60+
- name: Run ESLint
61+
run: npm run lint
62+
63+
- name: Check Prettier formatting
64+
run: npm run format
65+
continue-on-error: true # Existing code has formatting issues

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"publish": "lerna publish",
66
"build": "lerna run build",
77
"test": "lerna run test",
8+
"lint": "eslint --ext .ts ts-cache/src storages/*/src",
9+
"lint:fix": "eslint --ext .ts ts-cache/src storages/*/src --fix",
10+
"format": "prettier --check \"**/*.{ts,js,json,md}\" --ignore-path .gitignore",
11+
"format:fix": "prettier --write \"**/*.{ts,js,json,md}\" --ignore-path .gitignore",
812
"release": "lerna publish",
913
"prepublishOnly": "npm run test",
1014
"check-package-updates": "ncu -u && gulp updatePackages"

0 commit comments

Comments
 (0)