fix: repair pnpm run lint and gate it in CI - #119
Conversation
`pnpm run lint` has been broken here: `typescript: ^7.0.2` resolves to the native TypeScript 7 port, which no longer exposes the legacy compiler API that `ts-api-utils` (via `@typescript-eslint`) needs, so the shared config threw `Cannot read properties of undefined (reading 'Intrinsic')` at load and took the whole ESLint run down. Nothing caught it because lint was never wired into CI. - pin `typescript` to `~6.0.3` (satisfies the `>=4.8.4 <6.1.0` peer range) - bump `eslint-config-etherpad` to `^5.0.0` - add a reusable `lint.yml` workflow and call it from `test-and-release.yml`, with `lint` added to the `release` job's `needs:` so a lint failure blocks a release Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013S4pYSjwUsiZtdtMMpW7bw
Mechanical, behaviour-preserving output of `pnpm exec eslint . --fix`, kept in its own commit so the dependency/CI change above stays reviewable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013S4pYSjwUsiZtdtMMpW7bw
With `pnpm run lint` working again, ESLint reports real findings for the first time. These are mechanical, behaviour-preserving fixes: - `mocha/no-synchronous-tests`: mark the reported `it`/`before` callbacks `async`. Mocha awaits the returned promise, so a passing synchronous body still passes. - unused `require`s removed, over-long lines wrapped, and the small residue the rules left behind. No test expectation, hook or runtime behaviour is changed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013S4pYSjwUsiZtdtMMpW7bw
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoRestore ESLint compatibility and gate releases on lint
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
Add a job-level `permissions: contents: read` block to the lint job. The reusable workflow otherwise inherits the caller's contents:write and id-token:write token while running `eslint .`, which executes the repo's ESLint config and every installed ESLint plugin. Raise engines.node from >=18.0.0 to >=22.0.0. eslint-config-etherpad@5 pulls eslint-visitor-keys@5.0.1, which excludes Node 18, so the old declaration was a false claim; >=22.0.0 is the documented ether plugin floor. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013S4pYSjwUsiZtdtMMpW7bw
Problem
pnpm run lintis broken in this repo (and in ~80 otherether/*pluginrepos).
devDependencies.typescriptwas^7.0.2, which resolves to thenative TypeScript 7 port. TS 7 no longer exposes the legacy compiler API
that
ts-api-utils-- pulled in by@typescript-eslintviaeslint-config-etherpad-- depends on, so the config threw at load time:That takes the entire ESLint run down, so
pnpm run lintfailed beforelinting a single file. It went unnoticed because lint was never run in CI.
Changes
Dependencies + CI
typescriptpinned to~6.0.3.eslint-config-etherpad@5declares atypescript: ">=4.8.4 <6.1.0"peer range, so a future TypeScript majornow fails loudly at install time instead of silently breaking lint.
eslint-config-etherpadbumped to^5.0.0.pnpm-lock.yamlregenerated. The diff is large because TypeScript 7ships ~20 per-platform native binaries that TypeScript 6 does not.
.github/workflows/lint.yml, called fromtest-and-release.yml, withlintadded to thereleasejob'sneeds:list so lint failures block a release.Lint findings
With ESLint running again it reported 6 error(s), fixed in separate
commit(s) so the dependency change above stays reviewable:
eslint --fix(own commit):comma-dangleinstatic/js/index.js.mocha/no-synchronous-testsx4 in the backend specs: the reporteditcallbacks are nowasync; one signature is wrapped to stay undermax-len.no-unused-varsinindex.js: dropped the unusedeejsrequire. TheeejsBlock_*hooks in this file render throughep_plugin_helpers'template, not througheejsdirectly.All fixes are mechanical and behaviour-preserving -- no test expectation,
hook or runtime behaviour changes.
pnpm run lintnow exits 0.This matches the already-merged ether/ep_cursortrace#117,
ether/ep_clear_formatting#96 and ether/ep_git_commit_saved_revision#107.
🤖 Generated with Claude Code
https://claude.ai/code/session_013S4pYSjwUsiZtdtMMpW7bw