Skip to content

Commit 4580d10

Browse files
committed
Set up CI
1 parent c62c78f commit 4580d10

4 files changed

Lines changed: 800 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
# Cancel in-progress runs for the same ref when a new commit lands.
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
check:
15+
name: Typecheck, lint, build, test
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 20
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up pnpm
23+
# Reads the pnpm version from package.json#packageManager.
24+
uses: pnpm/action-setup@v4
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "24"
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Typecheck
36+
run: pnpm typecheck
37+
38+
- name: Lint
39+
run: pnpm lint
40+
41+
- name: Build
42+
run: pnpm build
43+
44+
- name: Test
45+
# Integration tests reach out to wss://sync3.automerge.org; the cap
46+
# keeps a stuck network call from holding the runner indefinitely.
47+
run: pnpm test
48+
timeout-minutes: 15

eslint.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Minimal ESLint flat config for pushwork.
2+
//
3+
// Goal: catch genuine bugs (undeclared bindings, unreachable code, etc.) without
4+
// nitpicking existing style — formatting belongs to Prettier (.prettierrc).
5+
//
6+
// Most stylistic rules from typescript-eslint's `recommended` set are toned down
7+
// here so this can run green on the existing codebase. Tighten over time.
8+
import tseslint from "typescript-eslint";
9+
10+
export default tseslint.config(
11+
{
12+
ignores: ["dist/**", "node_modules/**", "coverage/**", "**/*.d.ts"],
13+
},
14+
...tseslint.configs.recommended,
15+
{
16+
rules: {
17+
"@typescript-eslint/ban-ts-comment": "off",
18+
"@typescript-eslint/no-empty-object-type": "off",
19+
"@typescript-eslint/no-explicit-any": "off",
20+
"@typescript-eslint/no-non-null-assertion": "off",
21+
"@typescript-eslint/no-require-imports": "off",
22+
"@typescript-eslint/no-unused-expressions": "off",
23+
"@typescript-eslint/no-unused-vars": [
24+
"warn",
25+
{
26+
argsIgnorePattern: "^_",
27+
varsIgnorePattern: "^_",
28+
caughtErrorsIgnorePattern: "^_",
29+
},
30+
],
31+
"no-empty": ["warn", { allowEmptyCatch: true }],
32+
"prefer-const": "warn",
33+
},
34+
},
35+
);

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"test:bail": "jest --bail",
1717
"test:watch": "jest --watch",
1818
"test:coverage": "jest --coverage",
19-
"lint": "eslint src --ext .ts",
20-
"lint:fix": "eslint src --ext .ts --fix",
19+
"lint": "eslint src",
20+
"lint:fix": "eslint src --fix",
2121
"clean": "rm -rf dist",
2222
"prepack": "pnpm run build",
2323
"start": "node dist/cli.js",
@@ -61,12 +61,14 @@
6161
"@types/node": "^20.0.0",
6262
"@types/tmp": "^0.2.4",
6363
"babel-jest": "^30.2.0",
64+
"eslint": "^9.18.0",
6465
"fast-check": "^4.3.0",
6566
"jest": "^29.7.0",
6667
"tmp": "^0.2.1",
6768
"ts-jest": "^29.1.0",
6869
"tsx": "^4.19.2",
69-
"typescript": "^5.2.0"
70+
"typescript": "^5.2.0",
71+
"typescript-eslint": "^8.20.0"
7072
},
7173
"jest": {
7274
"preset": "ts-jest",

0 commit comments

Comments
 (0)