Skip to content

replace ESLint 8 + Prettier with Biome, and gate lint/typecheck in CI - #11

Merged
Ashniu123 merged 3 commits into
masterfrom
add-lint-type-checks-1
Aug 4, 2026
Merged

replace ESLint 8 + Prettier with Biome, and gate lint/typecheck in CI#11
Ashniu123 merged 3 commits into
masterfrom
add-lint-type-checks-1

Conversation

@Ashniu123

Copy link
Copy Markdown
Contributor

The repo already had a linter; what it lacked was enforcement. ESLint and
Prettier were configured and wired into the codegen script, but there was no
lint script, .husky/pre-commit called npx lint-staged which was never
installed, and CI ran only build and test. Nothing kept the tree clean.

Standing put was not an option either: ESLint 8.56 has been EOL since October
2024 and typescript-eslint 7 is a major behind, so either path was a migration.
That is what makes Biome the better trade here rather than merely the trendier
one:

  • There was almost no config to lose. eslint-plugin-react was installed in a
    Node HTTP client with no React, eslint-plugin-jest was never extended, and
    eslint-plugin-import was pulled in only for plugin:import/typescript, which
    contributes resolver settings and zero rules.
  • Speed lands where it hurts. A full ESLint pass took 4.4s, 4.0s of which was
    the two generated files -- and npm run generate paid that twice, once for
    Prettier and once for ESLint. Biome checks all 23 files in ~85ms.
  • Nine devDependencies collapse to one.

The accepted cost: noFloatingPromises and noMisusedPromises are the
highest-value rules for a library where every public method returns a Promise,
and in Biome 2.5 both are still nursery. They are enabled explicitly, and a
floating promise was confirmed to actually trip the rule rather than trusting
the config.

files.maxSize is raised to 4 MiB. src/types.generated.ts is ~1 MiB and silently
exceeds Biome's 1 MiB default, which skipped the largest file in the repo
without reporting a failure.

Also adds npm run typecheck, closing a separate hole: nothing typechecked
test/**. tsconfig-build.json compiles only src/, and @swc/jest strips types
without checking them, so a type error in a test was invisible. Verified by
introducing one -- tsc fails, jest still passes.

Removes importHelpers: true from tsconfig.json. It required tslib, which was
only ever present as a hoisted transitive dep of the ESLint stack, so removing
those packages surfaced it. tsconfig-build.json already sets it to false, so
published output was never affected and no dependency needs adding.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

Ashniu123 and others added 3 commits August 5, 2026 00:50
…k in CI

The repo already had a linter; what it lacked was enforcement. ESLint and
Prettier were configured and wired into the codegen script, but there was no
`lint` script, `.husky/pre-commit` called `npx lint-staged` which was never
installed, and CI ran only build and test. Nothing kept the tree clean.

Standing put was not an option either: ESLint 8.56 has been EOL since October
2024 and typescript-eslint 7 is a major behind, so either path was a migration.
That is what makes Biome the better trade here rather than merely the trendier
one:

- There was almost no config to lose. eslint-plugin-react was installed in a
  Node HTTP client with no React, eslint-plugin-jest was never extended, and
  eslint-plugin-import was pulled in only for `plugin:import/typescript`, which
  contributes resolver settings and zero rules.
- Speed lands where it hurts. A full ESLint pass took 4.4s, 4.0s of which was
  the two generated files -- and `npm run generate` paid that twice, once for
  Prettier and once for ESLint. Biome checks all 23 files in ~85ms.
- Nine devDependencies collapse to one.

The accepted cost: noFloatingPromises and noMisusedPromises are the
highest-value rules for a library where every public method returns a Promise,
and in Biome 2.5 both are still nursery. They are enabled explicitly, and a
floating promise was confirmed to actually trip the rule rather than trusting
the config.

files.maxSize is raised to 4 MiB. src/types.generated.ts is ~1 MiB and silently
exceeds Biome's 1 MiB default, which skipped the largest file in the repo
without reporting a failure.

Also adds `npm run typecheck`, closing a separate hole: nothing typechecked
test/**. tsconfig-build.json compiles only src/, and @swc/jest strips types
without checking them, so a type error in a test was invisible. Verified by
introducing one -- tsc fails, jest still passes.

Removes `importHelpers: true` from tsconfig.json. It required tslib, which was
only ever present as a hoisted transitive dep of the ESLint stack, so removing
those packages surfaced it. tsconfig-build.json already sets it to false, so
published output was never affected and no dependency needs adding.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mechanical, behavior-preserving fixes from the Biome migration:

- node: protocol on builtin imports (fs, path, events, url)
- `import type` for type-only imports, plus sorted import order
- drop dead imports and unused locals, including the unused URLSearchParams
  import in test/zoomApi.test.ts that ESLint had been reporting to nobody
- `let throwError` -> `let throwError: unknown` (noImplicitAnyLet)
- remove ZoomS2SO's constructor, which only forwarded to super(client).
  ZoomOauth declares the identical signature, so `new ZoomS2SO(client)` still
  typechecks for consumers through inheritance and dist/zoomS2SO.d.ts still
  exposes the class unchanged apart from the now-inherited constructor.

src/types.generated.ts is untouched: Biome's formatting of all 19k lines matches
Prettier's byte for byte. src/zoomApi.generated.ts changes only in import order,
and `npm run generate` is idempotent against the result.

One finding left in place rather than silently "fixed": openapi-parser.ts keeps
its non-null assertion behind a biome-ignore. The map key is guaranteed by the
block directly above it, and Biome's suggested `?.` rewrite would silently drop
endpoints instead of failing loudly. Note that `--unsafe` applies that rewrite
even with a suppression present if the suppression's reason wraps onto a second
line -- biome-ignore has to be a single line to bind to the next statement.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Each was an early-generation helper that a later implementation replaced without
the original being removed:

  pathToResourceName      -> logic now inlined in openapi-parser.ts
  operationIdToMethodName -> determineMethodName in api-generator.ts
  operationIdToTypeName   -> operationIdToBaseTypeName
  extractPathParams       -> getFirstPathParamName
  getResourceGroup        -> groupEndpointsByResource

getResourceGroup is the one worth calling out: it still carried the naive
`endsWith('s') ? slice(0, -1)` singularization that 627f09a fixed in
api-generator.ts, so it was a live trap for anyone who wired it up.

No cascade -- snakeToCamel and snakeToPascal remain in use from api-generator.ts
and type-generator.ts.

Scope: scripts/ only. Confirmed by counting references minus declarations for
every function in non-generated code (13 exported and 18 module-local in
scripts/, 7 local in src/), then closing the gaps that census misses: all 13
exported interfaces in openapi-parser.ts (every one reachable from OpenApiSpec),
arrow-function consts (none exist), and every private/protected method in src/
(all used). These five were the only dead ones.

Nothing removed from src/. Its exports are published API, so an export with no
internal caller is still a consumer's entry point, not dead code -- and the 250+
methods in zoomApi.generated.ts are the library's product. `npm run generate`
produces byte-identical output before and after these deletions, which is the
strongest available evidence that nothing reachable was removed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@Ashniu123
Ashniu123 merged commit f6b2065 into master Aug 4, 2026
4 checks passed
@Ashniu123
Ashniu123 deleted the add-lint-type-checks-1 branch August 4, 2026 19:37
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