Repository navigation
chore(tooling): make the oxlint config effective and clear its warnings - #63
Merged
Merged
Conversation
`.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.
Contributor
Coverage
|
Contributor
|
Loop triage — This is an owner-authored, same-repo PR that edits the norms layer ( Verified read-only — the change itself checks out
No |
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.
Problem
pnpm lintreported 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-inoxlint.jsonis ignored by discovery.That file also used the
ignorekey, which the 1.x schema rejects (renamedignorePatterns). Reading it explicitly fails outright:So both CI (
pnpm lint) and thelint-stagedhook linted with the default rule set only, and the three rules the file meant to turn off never were.Changes
oxlint.json→.oxlintrc.jsonso it is discovered, fixignore→ignorePatterns, and add an override that turnsno-unused-varsoff fortest/test-types*.ts. In those files a declared-but-unused value is the assertion:@ts-expect-errorimports of exports an entry must not have (azure, aws, cos, obs) and return-type checks such asconst putPromise: Promise<any> = put(...). Deleting them would drop type coverage rather than dead code.encodeUtf8import in the COS request layer, unusedstart/endpart bounds inmultipartUpload(the bounds actually uploaded are derived frompendingParts), an unused catch binding, and two leftovers in tests.AGENTS.mdpoints 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 tomain.Verification
Run on the branch:
test/index.spec.ts's only failure is its integrationbeforeAll, which fetcheshttp://localhost:8080/api/oss-configand needspnpm serverunning; unrelated to this change.