Skip to content

fix: repair pnpm run lint and gate it in CI - #208

Merged
JohnMcLear merged 4 commits into
masterfrom
ci/repair-lint
Sep 21, 2026
Merged

JohnMcLear merged 4 commits into
masterfrom
ci/repair-lint

Conversation

@JohnMcLear

Copy link
Copy Markdown
Member

Problem

pnpm run lint is broken in this repo (and in ~80 other ether/* plugin
repos). devDependencies.typescript was ^7.0.2, which resolves to the
native TypeScript 7 port. TS 7 no longer exposes the legacy compiler API
that ts-api-utils -- pulled in by @typescript-eslint via
eslint-config-etherpad -- depends on, so the config threw at load time:

Cannot read properties of undefined (reading 'Intrinsic')

That takes the entire ESLint run down, so pnpm run lint failed before
linting a single file. It went unnoticed because lint was never run in CI.

Changes

Dependencies + CI

  • typescript pinned to ~6.0.3. eslint-config-etherpad@5 declares a
    typescript: ">=4.8.4 <6.1.0" peer range, so a future TypeScript major
    now fails loudly at install time instead of silently breaking lint.
  • eslint-config-etherpad bumped to ^5.0.0.
  • pnpm-lock.yaml regenerated. The diff is large because TypeScript 7
    ships ~20 per-platform native binaries that TypeScript 6 does not.
  • New reusable .github/workflows/lint.yml, called from
    test-and-release.yml, with lint added to the release job's
    needs: 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): implicit-arrow-linebreak in static/tests/backend/specs/filemenu.js.
  • mocha/no-synchronous-tests x5: the reported it/before callbacks are now async.
  • max-len: the render helper's arguments are wrapped onto a second line.

All fixes are mechanical and behaviour-preserving -- no test expectation,
hook or runtime behaviour changes.

pnpm run lint now 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

JohnMcLear and others added 3 commits September 20, 2026 18:50
`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-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Restore ESLint and gate releases on lint success

🐞 Bug fix ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Restores ESLint by aligning TypeScript with the shared configuration's supported peer range.
• Adds a reusable lint workflow that blocks releases on lint failures.
• Applies behavior-preserving fixes to newly surfaced test lint violations.
Diagram

graph TD
  EVENT["Workflow trigger"] --> PIPELINE["Test release workflow"] --> LINT["Reusable lint workflow"] --> INSTALL["pnpm install"] --> ESLINT["ESLint"] -->|success required| RELEASE["Release job"]
  TOOLCHAIN["Pinned toolchain"] --> INSTALL
Loading
High-Level Assessment

The current approach is appropriate: pinning TypeScript within the shared configuration's declared peer range repairs the immediate incompatibility, while the reusable workflow prevents recurrence from going unnoticed. Upgrading the lint stack for TypeScript 7 or using package overrides would add risk and obscure compatibility constraints without improving this fix.

Files changed (5) +311 / -481

Tests (1) +7 / -7
filemenu.jsResolve file menu test lint violations +7/-7

Resolve file menu test lint violations

• Reformats the render helper to satisfy line-break and line-length rules. Marks synchronous Mocha hooks and tests as async to satisfy the restored shared lint configuration without changing assertions.

static/tests/backend/specs/filemenu.js

Other (4) +304 / -474
lint.ymlAdd reusable ESLint workflow +35/-0

Add reusable ESLint workflow

• Adds a callable GitHub Actions workflow that installs Node.js, pnpm, cached dependencies, and runs the repository lint script.

.github/workflows/lint.yml

test-and-release.ymlGate releases on the lint workflow +4/-0

Gate releases on the lint workflow

• Invokes the reusable lint workflow alongside backend and frontend tests. Adds lint completion to the release job's required dependencies.

.github/workflows/test-and-release.yml

package.jsonAlign the ESLint configuration and TypeScript versions +2/-2

Align the ESLint configuration and TypeScript versions

• Upgrades eslint-config-etherpad to version 5 and pins TypeScript to the supported 6.0 minor line, preventing the TypeScript 7 compiler API incompatibility.

package.json

pnpm-lock.yamlRegenerate the compatible lint dependency graph +263/-472

Regenerate the compatible lint dependency graph

• Resolves eslint-config-etherpad 5.0.2 with TypeScript 6.0.3 and updates the associated TypeScript ESLint packages and plugins. Removes TypeScript 7's platform-specific native packages.

pnpm-lock.yaml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Pull request events skip lint checks 🐞 Bug ≡ Correctness
Description
lint.yml exposes only workflow_call, and its new caller in test-and-release.yml is triggered
only by push and workflow_dispatch. Opening, reopening, or synchronizing a pull request
therefore does not invoke this lint path, particularly leaving fork contributions without a
base-repository lint run.
Code

.github/workflows/test-and-release.yml[R17-18]

+  lint:
+    uses: ./.github/workflows/lint.yml
Evidence
The parent workflow declares only push and workflow_dispatch, while the added lint job calls a
reusable workflow whose only trigger is workflow_call; no workflow in this path subscribes to
pull_request.

.github/workflows/test-and-release.yml[1-9]
.github/workflows/test-and-release.yml[17-19]
.github/workflows/lint.yml[3-4]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly connected lint workflow is only reached from a caller that handles pushes and manual dispatches, so pull request events do not invoke lint in the base repository.
## Fix Focus Areas
- .github/workflows/test-and-release.yml[1-9]
- .github/workflows/test-and-release.yml[17-19]
## Recommended Fix
Add a `pull_request` trigger to `test-and-release.yml` so its lint job runs for pull request activity while the existing branch condition continues to prevent releases outside the default branch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/workflows/test-and-release.yml
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
@JohnMcLear
JohnMcLear merged commit 9c3a59b into master Sep 21, 2026
6 checks passed
@JohnMcLear
JohnMcLear deleted the ci/repair-lint branch September 21, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant