Skip to content

chore(lint): fail CI on deprecated API usage - #1418

Merged
gabrielseco merged 3 commits into
mainfrom
chore-oxlint-no-deprecated
Sep 29, 2026
Merged

gabrielseco merged 3 commits into
mainfrom
chore-oxlint-no-deprecated

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

CI now fails when code uses an API marked @deprecated, whether it's ours or from a dependency.

Why

Editors don't always show deprecation strikethroughs reliably, so deprecated calls slip in unnoticed (e.g. TanStack's isCancelledError, deprecated since @tanstack/query-core 5.85.2, landed in #1415). A lint rule makes it deterministic.

What changed

Toggle details
  • Added oxlint-tsgolint (dev) and switched npm run lint to oxlint --type-aware . — typescript/no-deprecated needs type information.
  • typescript/no-deprecated: "error" in .oxlintrc.json.
  • Exemptions:
    • src/client/** via overrides — generated by openapi-ts, deprecations come from the gateway schema.
    • The 24 existing usages get // oxlint-disable-next-line typescript/no-deprecated (mostly our own mutateAsync / *MutationAsync, Meta → NestedMeta, form_schema, plus RHF onChange in TextField.tsx and a deprecated API field in PayrollAdminOnboarding). Line-level so new deprecated usages in those same files still fail; remove each disable when migrated.
  • The root type-aware run passes --ignore-pattern 'example/**': the root lint job doesn't install example/ deps, so type-aware linting there fails on tsconfig.e2e.json (@playwright/test not found) and yields bogus any types.
  • Instead, example/'s own lint script is now oxlint --type-aware . (runs in Example App Checks, where the package is built and example deps are installed), with oxlint-tsgolint added to example/ devDependencies. Its 5 existing hits (React 19 deprecated React.FormEvent) get per-line disables. Partners copy from example/, so it's the place deprecated APIs matter most.
  • Side effect: --type-aware also turns on oxlint's default type-aware rules, adding ~45 warnings (no-floating-promises, await-thenable, restrict-template-expressions, …). Warnings don't fail CI; left visible rather than silenced.
  • No public API change.

Screenshots

N/A

Related Resources

Testing

  • npm run lint passes on this branch.
  • Verified a new file calling isCancelledError fails with typescript(no-deprecated).
  • Tested against the example/ app in a browser — N/A
  • Feature flag: N/A

🤖 Generated with Claude Code


Note

Low Risk
Tooling and lint-only changes with targeted disables; no production behavior or public API changes.

Overview
CI lint now fails on @deprecated API usage by enabling type-aware oxlint (oxlint --type-aware) with typescript/no-deprecated: "error", backed by the new oxlint-tsgolint dev dependency.

Root npm run lint ignores example/** (type-aware lint there runs via the example app’s own script). Generated src/client/** is exempt via an oxlintrc override. Existing grandfathered hits (mostly mutationToPromise / mutateAsync, Meta, schema version helpers, RHF onChange, and example React.FormEvent) get line-level oxlint-disable-next-line comments so new deprecated usage in those files still fails.

Type-aware mode may surface additional oxlint warnings (e.g. floating promises); they do not fail CI. No public runtime API changes.

Reviewed by Cursor Bugbot for commit 74ddc7c. Bugbot is set up for automated code reviews on this repo. Configure here.

Enables typescript/no-deprecated via oxlint --type-aware (oxlint-tsgolint).
Generated client and files with existing deprecated usages are exempted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 167.25 kB 167.25 kB 0 B (0%) 🟢
Total (raw) 559.22 kB 559.22 kB 0 B (0%) 🟢
CSS (gzip) 21.94 kB 21.94 kB 0 B (0%) 🟢
CSS (raw) 114.43 kB 114.43 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 167.25 kB / 350 kB (47.8%)
  • ✅ Total raw: 559.22 kB / 850 kB (65.8%)
  • ✅ CSS gzipped: 21.94 kB / 25 kB (87.8%)

Largest Files (Top 5)

  1. CheckBoxField-CBXcXbix.js - 24.61 kB (0 B (0%))
  2. ContractorOnboarding-CZBU8CGm.js - 13.54 kB (0 B (0%))
  3. Onboarding-dS9AgOSV.js - 11.27 kB (0 B (0%))
  4. Termination-zUqQ758Y.js - 11.08 kB (0 B (0%))
  5. styles.css - 10.97 kB (0 B (0%))
View All Files (75 total)
File Size (gzip) Change
CheckBoxField-CBXcXbix.js 24.61 kB 0 B (0%)
ContractorOnboarding-CZBU8CGm.js 13.54 kB 0 B (0%)
Onboarding-dS9AgOSV.js 11.27 kB 0 B (0%)
Termination-zUqQ758Y.js 11.08 kB 0 B (0%)
styles.css 10.97 kB 0 B (0%)
index.css 10.97 kB 0 B (0%)
CostCalculator-DKTQMrVy.js 10.68 kB 0 B (0%)
internals-CjKQthVT.js 8.23 kB 0 B (0%)
index.js 5.05 kB 0 B (0%)
JSONSchemaForm-I1mWdIp7.js 4.92 kB 0 B (0%)

✅ Bundle size check passed

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-8nhetz7ih-remotecom.vercel.app
Latest Commit:74ddc7c

Deployed with vercel-action

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-6kr2qlekl-remotecom.vercel.app
Latest Commit:74ddc7c

Deployed with vercel-action

Only the generated client is exempted in config. The root type-aware run
skips example/, which has its own lint step and whose deps aren't
installed in the root lint job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 86.36% 86.36% 0% ⚪
Statements 85.93% 85.93% 0% ⚪
Functions 84.92% 84.92% 0% ⚪
Branches 77.79% 77.79% 0% ⚪

Detailed Breakdown

Lines Coverage
  • Covered: 4850 / 5616
  • Coverage: 86.36%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 4934 / 5742
  • Coverage: 85.93%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1290 / 1519
  • Coverage: 84.92%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 3002 / 3859
  • Coverage: 77.79%
  • Change: 0% (0 branches)

✅ Coverage check passed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabrielseco
gabrielseco merged commit 43ab492 into main Sep 29, 2026
16 checks passed
@gabrielseco
gabrielseco deleted the chore-oxlint-no-deprecated branch September 29, 2026 10:11
@gabrielseco gabrielseco mentioned this pull request Sep 30, 2026
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.

2 participants