Skip to content

Commit 05f81d0

Browse files
authored
chore: setup ci lint job (#258)
1 parent b278112 commit 05f81d0

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.github/workflows/lint.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lint:
10+
name: Lint
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18.x'
21+
cache: 'npm'
22+
cache-dependency-path: '**/package-lock.json'
23+
- run: npm ci
24+
- name: Lint
25+
# github adds inline annotation for compact or stylish format
26+
# which is different than our default for local usage
27+
run: npm run lint -- --format=compact
28+
- name: Types
29+
run: npm run typecheck
30+
# we still want to check types if lint fails just to know everything
31+
# and not peel errors to uncover new ones of different type
32+
if: always()

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
"pretest": "node tests/prepare.mjs",
1919
"build": "node ./tools/build.js",
2020
"build:watch": "node ./tools/build.js --watch",
21-
"lint": "eslint --cache --format=codeframe --max-warnings=0 src/**/*.ts",
21+
"lint": "eslint --cache --format=codeframe --max-warnings=0 --ext .ts,.cts,.js src",
2222
"test": "vitest",
2323
"test:ci": "vitest run --reporter=default --retry=3",
24+
"typecheck": "tsc --noEmit",
2425
"e2e": "playwright test",
2526
"e2e:ci": "playwright test"
2627
},

0 commit comments

Comments
 (0)