Skip to content

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

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): comma-dangle in static/js/index.js.
  • mocha/no-synchronous-tests x4 in the backend specs: the reported it callbacks are now async; one signature is wrapped to stay under max-len.
  • no-unused-vars in index.js: dropped the unused eejs require. The eejsBlock_* hooks in this file render through ep_plugin_helpers' template, not through eejs directly.

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 compatibility and gate releases on lint

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

Grey Divider

AI Description

• Pin TypeScript and upgrade Etherpad ESLint configuration to restore lint execution.
• Run reusable lint checks in CI and require them before releases.
• Resolve newly surfaced lint errors without changing runtime or test behavior.
Diagram

graph TD
  A["Push or dispatch"] --> B["Test workflow"] --> C["Lint workflow"] --> D["Dependency install"] --> E["ESLint check"] --> H["Release job"]
  B --> F["Backend tests"] --> H
  B --> G["Frontend tests"] --> H
Loading
High-Level Assessment

The current approach is appropriate: pinning TypeScript within eslint-config-etherpad's declared peer range fixes the underlying compatibility failure, while the reusable lint workflow prevents recurrence from reaching a release. Suppressing the peer incompatibility or bypassing TypeScript-aware linting would preserve a fragile toolchain and provide weaker protection.

Files changed (8) +328 / -498

Bug fix (1) +0 / -1
index.jsRemove the unused eejs import +0/-1

Remove the unused eejs import

• Drops an unused 'eejs' require surfaced by the repaired ESLint run. Template rendering continues through 'ep_plugin_helpers' without runtime changes.

index.js

Refactor (1) +1 / -1
index.jsApply ESLint comma formatting +1/-1

Apply ESLint comma formatting

• Removes a trailing comma from the final argument in the injected toolbar style call. This is a mechanical, behavior-preserving lint correction.

static/js/index.js

Tests (2) +23 / -22
background_fix.jsMake toolbar background checks lint-compliant +21/-20

Make toolbar background checks lint-compliant

• Marks two Mocha test callbacks as async to satisfy the shared 'mocha/no-synchronous-tests' rule. Wraps the longer callback signature without changing assertions or expectations.

static/tests/backend/specs/background_fix.js

main_toolbar_preserved.jsMake toolbar preservation checks async +2/-2

Make toolbar preservation checks async

• Marks both regression test callbacks as async to satisfy the updated Mocha lint rules. Test logic and expectations remain unchanged.

static/tests/backend/specs/main_toolbar_preserved.js

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

Add a reusable ESLint workflow

• Adds a callable GitHub Actions workflow that installs Node.js, pnpm, cached dependencies, and runs 'pnpm run lint'. This makes linting independently reusable by repository workflows.

.github/workflows/lint.yml

test-and-release.ymlRequire lint success before release +4/-0

Require lint success before release

• Invokes the new reusable lint workflow alongside backend and frontend tests. Adds lint to the release job dependencies so lint failures block publication.

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

package.jsonAlign the ESLint and TypeScript toolchain +2/-2

Align the ESLint and TypeScript toolchain

• Upgrades 'eslint-config-etherpad' to version 5 and pins TypeScript to the compatible 6.0 release line. The constrained TypeScript range prevents incompatible future major upgrades.

package.json

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

Regenerate the lint dependency graph

• Resolves eslint-config-etherpad 5, TypeScript 6.0.3, and the updated TypeScript ESLint ecosystem. Removes TypeScript 7's platform-specific native packages and records the compatible peer graph.

pnpm-lock.yaml

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

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 3c95104 into master Sep 21, 2026
4 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