Repository navigation
fix(examples): keep oxlint root-only options out of nested configs - #7770
Conversation
Nested .oxlintrc.json files can't set `options` (typeAware, reportUnusedDisableDirectives); the oxc editor extension refused to load the two starter configs. Move those to CLI flags in the starters' lint scripts and fix example tsconfigs that tsgolint rejects when linting from the repo root. Co-authored-by: alexander <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
TypeScript compiler settings examples/.test/diagnostics-big-router/tsconfig.json, examples/lazy-load/tsconfig.json, examples/minimal/tsconfig.json, examples/vercel-edge-runtime/tsconfig.json |
The diagnostics example changes its target to es2017 and module resolution to bundler. The lazy-load and minimal examples set rootDir to src. The Vercel Edge Runtime example changes module resolution to bundler. |
Oxlint command options examples/next-prisma-starter/.oxlintrc.json, examples/next-prisma-starter/package.json, examples/next-prisma-websockets-starter/.oxlintrc.json, examples/next-prisma-websockets-starter/package.json |
Both starters remove type-aware linting and unused-disable reporting options from .oxlintrc.json and add them to the lint script. The scripts continue to target src. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- trpc/trpc#7765: Migrates the repository from ESLint and Prettier to Oxlint and Oxfmt, and changes example TypeScript configurations.
Suggested reviewers: juliusmarminge, quiibz
Merge Risk: 
Minimal · up to 46354
-
No actionable merge-blocking risk is evident in the reviewed configuration changes.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (6 skipped: 6 unsupported.)
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
@trpc/client
@trpc/next
@trpc/openapi
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Why
The options.typeAware option is only supported in the root configforexamples/next-prisma-starter/.oxlintrc.jsonandexamples/next-prisma-websockets-starter/.oxlintrc.json.options(typeAware,reportUnusedDisableDirectives, …) in the root config. The CLI never complained because each starter lints from its own folder, where its config is the root. The editor lints from the repo root, so the starter configs are nested there.no-non-null-assertion).What
.oxlintrc.jsonfiles: drop theoptionsblock. Rules and plugins stay the same, so each starter still has a complete config when cloned on its own.lintscripts: set the same options as flags:oxlint --type-aware --report-unused-disable-directives-severity=warn src..oxlintrc.jsonoptions (typeAware,reportUnusedDisableDirectives: warn) apply to everything, including the starters."oxc.typeAware": truein its.vscode/settings.json.examples/minimal,examples/lazy-load: addrootDir: "src".dist/layout is unchanged.examples/vercel-edge-runtime:moduleResolution: "bundler".examples/.test/diagnostics-big-router:target: "es2017",moduleResolution: "bundler"..vscode/settings.jsonneeds no change.Links
None. No docs or example routes change. Previews: next-prisma-starter, next-prisma-websockets-starter.
Alternatives considered
overridesfor the starters: rejected. The starters are templates people clone, so they need their own complete config.extendsfrom the root config: same problem. A cloned starter would point at a file that isn't there.root: trueflag, so CLI flags are the only way to keep the starter options without puttingoptionsin a nested file.Testing
oxlint --lspwith the extension's init options (typeAware: true) on starter and package files:main: the same "only supported in the root config" errors as the editor.no-floating-promises) and the localtrpc/*JS plugin rules still fire.await-thenableviolation in a starter. It's caught from the root and by the starter'spnpm lint, and a staleoxlint-disablecomment still warns.pnpm lint(45 tasks),pnpm format,pnpm manypkg checkall pass.tscand the build still pass for the changed example tsconfigs.Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit