Skip to content

chore(tooling): make the oxlint config effective and clear its warnings - #63

Merged
Alex1990 merged 1 commit into
mainfrom
chore/oxlint-config
Sep 18, 2026
Merged

Alex1990 merged 1 commit into
mainfrom
chore/oxlint-config

Conversation

@Alex1990

Copy link
Copy Markdown
Owner

Problem

pnpm lint reported 39 warnings, and the repository's lint config turned out never to have been in effect:

  • oxlint 1.x auto-loads .oxlintrc.json; the checked-in oxlint.json is ignored by discovery.

  • That file also used the ignore key, which the 1.x schema rejects (renamed ignorePatterns). Reading it explicitly fails outright:

    Failed to parse config with error Error("unknown field `ignore`, expected one of
    `$schema`, `plugins`, `jsPlugins`, `categories`, `rules`, `settings`, `env`,
    `globals`, `overrides`, `ignorePatterns`, `extends`")
    

So both CI (pnpm lint) and the lint-staged hook linted with the default rule set only, and the three rules the file meant to turn off never were.

Changes

  • Rename oxlint.json → .oxlintrc.json so it is discovered, fix ignore → ignorePatterns, and add an override that turns no-unused-vars off for test/test-types*.ts. In those files a declared-but-unused value is the assertion: @ts-expect-error imports of exports an entry must not have (azure, aws, cos, obs) and return-type checks such as const putPromise: Promise<any> = put(...). Deleting them would drop type coverage rather than dead code.
  • Drop what the now-active rules flag: an unused encodeUtf8 import in the COS request layer, unused start/end part bounds in multipartUpload (the bounds actually uploaded are derived from pendingParts), an unused catch binding, and two leftovers in tests.
  • AGENTS.md points at the new file name. This is a norms-layer change, which per the repo rules is a proposal — hence the PR instead of a direct push to main.

Verification

Run on the branch:

pnpm lint        → Found 0 warnings and 0 errors. (90 files, 89 rules)
pnpm check:types → clean (7 × tsc --noEmit)
pnpm fmt:check   → All matched files use the correct format.
npx vitest run test/multipart.spec.ts test/cos.spec.ts test/aws.spec.ts \
  test/provider.spec.ts test/index.spec.ts test/*-signature.spec.ts
                 → 77 passed | 13 skipped

test/index.spec.ts's only failure is its integration beforeAll, which fetches http://localhost:8080/api/oss-config and needs pnpm serve running; unrelated to this change.

`.oxlintrc.json` (renamed from `oxlint.json`) was never picked up: oxlint
loads `.oxlintrc.json` on its own, and the `ignore` key the file used is
not valid in oxlint 1.x — reading it explicitly with `-c` failed with
`unknown field 'ignore'`. Rename it, use `ignorePatterns`, and turn
`no-unused-vars` off for `test/test-types*.ts`, where a declared but
unused value *is* the assertion: `@ts-expect-error` imports of exports an
entry must not have (azure, aws, cos, obs) and return-type checks such as
`const putPromise: Promise<any> = put(...)`. `AGENTS.md` points at the
new file name.

Drop the code the now-active rules flagged: the unused `encodeUtf8`
import in the COS request layer, the unused `start`/`end` part bounds in
`multipartUpload` (the ones actually uploaded are derived from
`pendingParts`), an unused catch binding, and two leftovers in tests.

`pnpm lint` and `pnpm check:types` are clean, `pnpm fmt:check` passes,
and the affected specs (multipart, cos, aws, provider, signatures, utils)
stay green.
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Metric % Covered / Total
Lines 91.73% 1121/1222
Statements 90.42% 1209/1337
Functions 92.76% 218/235
Branches 76.97% 575/747

@github-actions github-actions Bot added the needs-triage Maintainer needs to evaluate (loop can't decide; too risky; external PR) label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Loop triage — needs-triage (human-owned; the loop must not decide this one).

This is an owner-authored, same-repo PR that edits the norms layer (AGENTS.md) plus lint tooling and a small dead-code cleanup. AGENTS.md says norms-layer changes land as a proposal that a human merges, and the loop must not be the maker or checker of the norms it runs on (precedent #36/#37/#47/#49/#51/#53). The change is already written and correct, so no agent-actionable work remains — only your review/merge decision. Routing to the human inbox.

Verified read-only — the change itself checks out

  • pnpm lint → 0 warnings / 0 errors (90 files, 89 rules). Moving .oxlintrc.json away reproduces 33 warnings from default discovery, and the old config fails to parse exactly as described: unknown field 'ignore' (oxlint 1.41.0). The diagnosis is confirmed.
  • pnpm fmt:check clean. pnpm build + pnpm check:types exit 0 — note check:types resolves ../dist/*, so a fresh tree without dist/ reports TS2307; pre-existing, not this PR.
  • CI on head b58271b: Lint pass (14s), Test pass (1m05s). MERGEABLE, REVIEW_REQUIRED; base bb2c01b == origin/main, one commit.
  • The multipartUpload deletions are real dead code: the first loop only builds the checkpoint, and the uploaded bounds are recomputed from pendingParts below.
  • The no-unused-vars: off override for test/test-types*.ts is justified: e.g. test/test-types-cos.ts:74-75 imports putSymlink under @ts-expect-error precisely to assert the COS entry must not export it, and other test-types files use declared-but-unused values as return-type assertions. Deleting them would drop type coverage, not dead code.

No ready-for-agent work exists. Nothing pushed or written by the loop.

@Alex1990
Alex1990 merged commit a3384f7 into main Sep 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-triage Maintainer needs to evaluate (loop can't decide; too risky; external PR)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant