Skip to content

Commit f6b2065

Browse files
authored
Merge pull request #11 from nektarai/add-lint-type-checks-1
replace ESLint 8 + Prettier with Biome, and gate lint/typecheck in CI
2 parents aaaa864 + a739340 commit f6b2065

27 files changed

Lines changed: 652 additions & 3896 deletions

.claude/CLAUDE.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
77
```bash
88
npm run build # Clean dist/ and compile TypeScript
99
npm test # Run Jest tests with coverage
10+
npm run lint # Biome: format + lint check (no writes)
11+
npm run lint:fix # Biome: apply safe fixes
12+
npm run typecheck # tsc --noEmit over src/ AND test/
1013
npm run generate # Regenerate API client from the OpenAPI specs in specs/
1114
npx jest test/zoomClient.test.ts # Run a single test file
1215
npx jest --testNamePattern "should normalize" # Run tests matching a pattern
1316
```
1417

18+
`npm test` does not typecheck — `@swc/jest` strips types without checking them, and
19+
`npm run build` only covers `src/`. `npm run typecheck` is the only thing that
20+
typechecks `test/`.
21+
1522
## Architecture
1623

1724
Zero-dependency, fully typed Zoom API client for Node.js. Published as `@nektarai/zoom-api-client`.
@@ -27,7 +34,7 @@ Zero-dependency, fully typed Zoom API client for Node.js. Published as `@nektara
2734
- **ZoomApi** (`src/zoomApi.generated.ts`): 250+ endpoint methods generated from the Zoom OpenAPI specs in `specs/`. Fluent resource pattern: `zoomApi.user(userId).listMeetings()`, `zoomApi.meeting(id).getMeeting()`.
2835
- **Types** (`src/types.generated.ts`): Request param and response types for all generated endpoints.
2936

30-
To regenerate: `npm run generate` — runs `scripts/generate-api.ts` which parses each spec, generates types and API client, then runs Prettier + ESLint on output.
37+
To regenerate: `npm run generate` — runs `scripts/generate-api.ts` which parses each spec, generates types and API client, then runs `biome check --write` on the output.
3138

3239
Zoom publishes one spec per product area. `specs/*.json` are committed verbatim so they can be refreshed from Zoom without a manual merge; register new ones in `SPEC_PATHS` in `scripts/generate-api.ts`. **Order matters** — duplicate method names resolve first-wins, so an earlier spec keeps the cleaner name and later ones fall back to their `operationId`. Keep `Meetings.json` first to hold existing method names stable.
3340

@@ -45,8 +52,11 @@ Zoom publishes one spec per product area. `specs/*.json` are committed verbatim
4552

4653
## Code Standards
4754

48-
- **Style**: Single quotes, trailing commas, 4-space indent, semicolons (Prettier-enforced)
49-
- **ESLint**: `no-console` is an error. `@typescript-eslint/no-explicit-any` is off. Floating promises are errors.
55+
- **Tooling**: [Biome](https://biomejs.dev) owns both formatting and linting (`biome.json`). It replaced ESLint 8 + Prettier — there is no `.eslintrc.js` or `.prettierrc.js`.
56+
- **Style**: Single quotes, trailing commas, 4-space indent, semicolons. Indent width comes from `.editorconfig` via `formatter.useEditorconfig` (so JSON stays at 2).
57+
- **Lint rules**: Biome `recommended`, plus `noConsole` as an error and `noExplicitAny` / `noTsIgnore` off. `noFloatingPromises` and `noMisusedPromises` are enabled **from nursery** — they are the reason this repo uses Biome's types domain at all, and they may shift behavior across Biome minor versions. Verify they still fire after a Biome upgrade.
58+
- **Overrides** in `biome.json`: `scripts/**` allows `console` and `${}`-in-string (it is a code generator); `src/*.generated.ts` is formatted but not linted; `tsconfig*.json` is parsed as JSONC.
59+
- **`files.maxSize` is raised to 4 MiB.** `src/types.generated.ts` is ~1 MiB and silently exceeds Biome's 1 MiB default, which would skip the largest file in the repo without failing.
5060
- **TypeScript**: Strict mode, ESNext target, CommonJS output. `noImplicitAny` is off despite strict mode.
5161
- **Tests**: Jest with SWC transform. Tests use `nock` for HTTP mocking. Coverage collected from `src/`.
5262

.eslintignore

Lines changed: 0 additions & 15 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ permissions:
1313
contents: read
1414

1515
jobs:
16+
quality:
17+
name: Lint & Typecheck
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '22'
25+
cache: npm
26+
27+
- run: npm ci
28+
29+
# `biome ci` is check-only and enforces assist actions, so it can't
30+
# pass by silently rewriting files the way `biome check` could.
31+
- run: npx biome ci .
32+
33+
# Biome is a native binary and @types/node is pinned to the 22 line,
34+
# so neither check varies by Node major. Run once, not across the matrix.
35+
- run: npm run typecheck
36+
1637
test:
1738
name: Node ${{ matrix.node }}
1839
runs-on: ubuntu-latest

.husky/pre-commit

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
# Check-only, deliberately not --write: Biome would fix files without
5+
# re-staging them, so the commit would capture the unfixed version.
6+
# Run `npm run lint:fix` when this fails.
7+
npx biome check --staged --no-errors-on-unmatched

.prettierignore

Lines changed: 0 additions & 12 deletions
This file was deleted.

.prettierrc.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

biome.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.5.7/schema.json",
3+
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
4+
"files": {
5+
"includes": ["**", "!!**/dist", "!!**/coverage", "!specs"],
6+
"maxSize": 4194304
7+
},
8+
"formatter": {
9+
"enabled": true,
10+
"useEditorconfig": true,
11+
"lineWidth": 80,
12+
"lineEnding": "lf"
13+
},
14+
"javascript": {
15+
"formatter": {
16+
"quoteStyle": "single",
17+
"trailingCommas": "all",
18+
"semicolons": "always"
19+
}
20+
},
21+
"linter": {
22+
"enabled": true,
23+
"rules": {
24+
"preset": "recommended",
25+
"suspicious": {
26+
"noConsole": "error",
27+
"noExplicitAny": "off",
28+
"noTsIgnore": "off"
29+
},
30+
"nursery": {
31+
"noFloatingPromises": "error",
32+
"noMisusedPromises": "error"
33+
}
34+
}
35+
},
36+
"assist": {
37+
"enabled": true,
38+
"actions": { "source": { "organizeImports": "on" } }
39+
},
40+
"overrides": [
41+
{
42+
"includes": ["tsconfig.json", "tsconfig-*.json"],
43+
"json": {
44+
"parser": { "allowComments": true, "allowTrailingCommas": true }
45+
}
46+
},
47+
{
48+
"includes": ["scripts/**"],
49+
"linter": {
50+
"rules": {
51+
"suspicious": {
52+
"noConsole": "off",
53+
"noTemplateCurlyInString": "off"
54+
}
55+
}
56+
}
57+
},
58+
{
59+
"includes": ["src/*.generated.ts"],
60+
"linter": { "rules": { "preset": "none" } }
61+
}
62+
]
63+
}

jest.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,4 @@ module.exports = {
2121
],
2222
verbose: true,
2323
workerIdleMemoryLimit: '512M',
24-
/* @Ashniu123 TEMP: Till we upgrade to jest 30
25-
Issue: https://github.com/jestjs/jest/issues/14305
26-
*/
27-
prettierPath: '<rootDir>/node_modules/prettier2/index.js',
2824
};

0 commit comments

Comments
 (0)