Commit 4ee366f
committed
Add pull request CI and a working lint setup
Closes #46.
The repository had no CI for pull requests. Only publish.yml existed, triggered by tags, so a change was first executed by a machine other than the author's at release time. #48 is a 908-line contribution from outside, and reviewing it without an automated build was the immediate reason to fix this.
The new workflow runs on pull requests and on pushes to main: npm ci, lint, build, test, then a check that the build actually produced something. `npm ci` rather than `npm install`, so a pull request whose lockfile disagrees with package.json fails instead of silently resolving something else.
The matrix is Node 18 and 24. 18 is the floor declared in engines, 24 is what publish.yml releases with. Testing only one of them would let through a release that satisfies neither its own engines field nor its own publish path.
The final step verifies dist/cli.js, dist/mcp.js, dist/remote-helper.js and dist/index.js are non-empty and that `node dist/cli.js --version` runs. tsc exiting zero does not prove entry points were emitted, and dist is the entire published package.
test/e2e*.sh are deliberately not run. They drive a real Overleaf account through login, pull, push and compile against a live project. `npm test` globs test/*.test.ts, so the shell suites are already outside it, and the workflow says so in a comment to keep someone from widening the glob later.
eslint.config.js is flat config for eslint 9, with typescript-eslint recommended and without type-checked rules. Those need a TypeScript program per run and would turn lint into a second type checker with its own opinions; tsc already runs in CI and is the authority there.
`no-explicit-any` is a warning rather than an error, and the count is the reason. 58 occurrences remain, all pre-existing, concentrated in client.ts and cli.ts where untyped JSON comes back from Overleaf. Overleaf publishes no schema for those responses, so each one is a typing decision rather than a mechanical fix. As an error, CI would be red on main from the day it is switched on, which teaches everyone to ignore it. As a warning it stays visible and blocks nothing. Worth revisiting once the count is small enough to clear in one pass.
Verified locally: lint, build and test each exit zero, and the workflow parses as YAML.1 parent 8f02339 commit 4ee366f
4 files changed
Lines changed: 1481 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments