Repository navigation
chore(lint): make eslint . exit 0 so the blocking Lint gate passes - #112
Merged
Merged
Conversation
Close the three configuration gaps and fix the 64 remaining errors that were hidden behind the parser-project failure. Config: ignore generated TypeDoc output under docs/source/_static/api/, give scripts/**/*.js a CommonJS/Node globals block, and give the TS block plus the docs-site Nuxt package real lint-only tsconfig projects. Code: replace require() calls in tests with ESM imports, replace bare Function callback types with (response: any) => void, and clear the three unused-vars errors without any eslint-disable. eslint . now exits 0: 0 errors, 36 pre-existing src/ no-explicit-any warnings. No src/ runtime change, no workflow change, no dependency or version change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chore(lint): make
eslint .exit 0 so the blocking Lint gate stops failing CIWhy
mainCI run37273713053fails on both matrix legs (22.xand24.x) at step 6Run linting, which skipsBuild project,Run testsandUpload test coverage.publish.yml'spublish-npmandpublish-gprjobs declareneeds: build, andbuildrunsthat same lint step — so creating the
v2.2.1release today would fail thebuildjob at lintand skip both publish jobs.
This PR is what unblocks the
v2.2.1release. The gate itself is already blocking onmain(PR #110 removed
continue-on-error) and stays blocking; nothing is reintroduced or softened here.Result
pnpm run lintexits 0, reported as✖ 36 problems (0 errors, 36 warnings).The 36 warnings are the pre-existing
@typescript-eslint/no-explicit-anyinsrc/(33 in
IOServer.ts, 3 inBaseClasses.ts). They are permitted byAGENTS.md,eslint .hasno
--max-warnings, and they are still present and un-suppressed — the errors were fixedrather than muted.
Config gaps, each proven with a real
eslint .countMeasured on a scratch copy of
origin/develop(bbab5ba, same tree asmain7b39dc9),Node 22.22.1, pnpm 12.9.1. Each stage is generated from the untouched upstream config with only
the change that stage names applied to it, so no block can leak in unobserved.
eslint .exitignores: ['docs/source/_static/api/**']— generated TypeDoc outputscripts/**/*.jstsconfig.eslint.jsonfor the**/*.tsblocktests/**/*.ts+examples/**/*.tsdocs-site/tsconfig.eslint.json+ Nuxt auto-import globalsStage 2 → 3 rises from 54 to 100 problems, which is the whole point: closing the parser gap
turns 18 unparseable files into lintable ones, exposing the errors that were hidden behind the
parse failure. Stages 0 → 3 reproduce this card's inventory exactly — 269 problems, 233 errors,
and then 34
no-undef+ 13no-require-imports+ 11no-unsafe-function-type+ 3 parser + 3no-unused-vars= the 64 errors it listed.*.jsin a flat-configignoreslist is not recursive. Probingignores: ['*.js']alonestill lints
scripts/gpr.js,scripts/gpr-restore.jsanddocs/source/_static/api/assets/*.js, while the root-leveljest.config.jsand.eslintrc.jsare skipped. That — not a malformed config — is why
scripts/gpr*.jswas linted despite theexisting pattern. Confirmed with a direct
eslint .run, not by inspection.The 64 errors: how each family was closed
no-undefrequire/moduleandsetTimeout/setInterval/clear*references intests/andexamples/are genuine host-provided CommonJS/Node globals (those files execute under ts-jest and ts-node), so they get an ambient globals block — the same root cause as thescripts/gap, which the card itself flags. The 34th isfailintests/unit/IOServerError.test.ts: not a global at all (see below), fixed in code.@typescript-eslint/no-require-importsrequire()calls intests/e2e/chat-app.e2e.test.ts,tests/integration/IOServer.integration.test.ts(7),tests/performance/performance.test.ts(3),tests/unit/IOServer.static.test.tsreplaced with real ESM imports (import supertest from "supertest",import { io } from "socket.io-client"), and the redundant per-testconst io = require(...)lookups deleted.@typescript-eslint/no-unsafe-function-typecallback?: Functionbecamecallback?: (response: any) => void— 6 inexamples/chat-app/services/ChatService.ts, 1 inexamples/simple.ts, 4 intests/integration/IOServer.integration.test.ts. The signatures are only ever called with a plain object payload, so the behaviour is unchanged: these are widened parameter types, never narrowed ones, andtests/e2e/chat-app.e2e.test.ts(which drives those files) stays green.Parsing error: "parserOptions.project"underdocs-site/tsconfig.eslint.jsonprojects are new, lint-only files.@typescript-eslint/no-unused-vars(_, i)→(_, _unused)intests/performance/performance.test.ts;catch (error)→ barecatch {}intests/unit/IOServer.test.ts; the unusedcallbackparameter ofChatService.typing()renamed to_callback, matching the already-configuredargsIgnorePattern: '^_'.Net split: 28 errors fixed in code, 36 closed by configuration (33 ambient globals that the
card classes as the same root cause as the
scripts/gap, plus 3 parser-project errors).No rule was turned off, no global rule override was added, and there is not a single
eslint-disablein the diff — files or lines.The
fail()global — a latent broken test, not a suppressiontests/unit/IOServerError.test.tscalled Jasmine'sfail(), which jest-circus does not provide:that branch could never have fired, so the test was silently passing without ever asserting
anything. It is replaced by a real assertion
(
expect(error).toBeInstanceOf(IOServerError)followed by the two property checks), which isstrictly stronger and needs no new global.
docs-site/— decision and justificationDecision:
docs-site/gets a real parser project (docs-site/tsconfig.eslint.json) and staysin the lint scope — it is not excluded.
docs-site/is a separate, private Nuxt package (ioserver-docs@1.0.0) thatpublish.ymldoesnot publish and that commits no
tsconfig.jsonat all, so its three source files failed withThe file was not found in any of the provided project(s). That is a configuration defect, not afalse positive: excluding them would have silenced three real source files to avoid writing one
small tsconfig. The project is lint-only (
noEmit,types: []) and declares the three Nuxtauto-imports (
defineNuxtConfig,defineAppConfig,defineEventHandler) as ambient globals,because the Nuxt build injects them without an import.
Verification — clean room (
rm -rf node_modulesfirst), Node 22.22.1, pnpm 12.9.1bbab5ba/7b39dc9)pnpm install --frozen-lockfilepnpm run lint0 errors, 36 warningspnpm run buildpnpm testpnpm run test:coveragetests/e2e/chat-app.e2e.test.ts— the suite that exercises the rewrittenFunctionsignatures —passes. Lint results are not Node-version-specific: the CI failure is identical on both
22.xand24.xand the fix contains nothing version-dependent.Scope guard
continue-on-erroranywhere —grep -c continue-on-error .github/workflows/*.yml→0/0/0.AGENTS.mduntouched (protected, out of scope).package.jsonversionstays2.2.1; no dependency, lockfile or Action change.src/untouched — verified byte-identical againstorigin/develop; none of the 64 errorswere in
src/, and nosrc/file is in the diff. The 36no-explicit-anywarnings insrc/remain as-is.
Files changed (11)
eslint.config.js— generated-output ignore; ambient globals fortests/+examples/and forscripts/**/*.js; parser projects for the**/*.tsblock and fordocs-site/.tsconfig.eslint.json(new) — lint-only, extendstsconfig.json, widensincludetosrc+tests+examples,noEmit: true.docs-site/tsconfig.eslint.json(new) — lint-only project for the Nuxt docs package.tests/e2e/chat-app.e2e.test.ts,tests/integration/IOServer.integration.test.ts,tests/performance/performance.test.ts,tests/unit/IOServer.static.test.ts,tests/unit/IOServer.test.ts,tests/unit/IOServerError.test.tsexamples/simple.ts,examples/chat-app/services/ChatService.tsRollback
One revert commit. The change is lint configuration plus lint hygiene only: no published-package
behaviour change, no runtime path in
src/, no CI workflow edit. Reverting restores the previous(failing) lint gate. Both
tsconfig.eslint.jsonfiles arenoEmitlint-only projects and are notreferenced by
pnpm run build,pnpm testortypedoc.json.Merge
Opening only — do not merge. The merge and the
v2.2.1tag/release are the operator's steps.