Skip to content

chore: Add typeaware rules to oxlint to speed up linting + typecheck#848

Merged
kingston merged 22 commits into
mainfrom
kingston/eng-1127-add-typeaware-rules-to-oxlint
Mar 20, 2026
Merged

chore: Add typeaware rules to oxlint to speed up linting + typecheck#848
kingston merged 22 commits into
mainfrom
kingston/eng-1127-add-typeaware-rules-to-oxlint

Conversation

@kingston

@kingston kingston commented Mar 19, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Ensure deterministic ordering of generated relation fragments
    • Fix Fastify auth hook callback to handle async flow correctly
    • Preserve configured button text in the blocker dialog
  • Chores

    • Upgrade linting/tooling (oxlint → 1.56.0) and add related tooling
    • Harden lint and TypeScript configurations
    • Migrate/typify internal release scripts to TypeScript and remove outdated helpers

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 19, 2026

Copy link
Copy Markdown

Deploying baseplate-storybook with  Cloudflare Pages  Cloudflare Pages

Latest commit: f13ad35
Status: ✅  Deploy successful!
Preview URL: https://b151f6fb.baseplate-storybook.pages.dev
Branch Preview URL: https://kingston-eng-1127-add-typeaw.baseplate-storybook.pages.dev

View logs

@changeset-bot

changeset-bot Bot commented Mar 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bdc706c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Mar 19, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Migrates linting from ESLint to OXLint across the repo, updates lint configs and tsconfigs, adjusts package/workspace scripts and devDependencies, converts/typed version-fixing script to TypeScript and removes obsolete version-fix scripts, makes a deterministic sort change in relation build-data, and applies small runtime tweaks (auth callback style and blocker dialog text handling).

Changes

Cohort / File(s) Summary
Workspace & Scripts
package.json, pnpm-workspace.yaml, scripts/fix-versions.ts, scripts/version-fix/*
Updated check and version scripts (added oxlint type-check flag, switched version script to TS), added oxlint-tsgolint devDependency, bumped workspace oxlint catalog, converted fix-versions to TypeScript and deleted obsolete version-fix JS scripts.
OXLint / ESLint Configs & tsconfigs
packages/tools/oxlint.config.base.ts, packages/tools/eslint-configs/typescript.js, packages/tools/eslint-configs/react.js, packages/tools/tsconfig.node.base.json, packages/tools/tsconfig.vite.base.json
Large updates to base OXLint rules (many type-aware rules added/adjusted), ignore patterns extended, some ESLint config property access simplified, and Node types added to tool tsconfigs.
Lint Directive Migration (widespread)
packages/**/... (20+ files such as packages/project-builder-lib/**, packages/sync/**, packages/utils/**, packages/ui-components/**, packages/project-builder-server/**, packages/project-builder-web/**, packages/react-generators/**)
Replaced many eslint-disable-* annotations with corresponding oxlint-disable-* variants across numerous source and test files (no behavioral changes).
Rule & Utility Refactors
packages/tools/eslint-configs/rules/no-unused-generator-dependencies.js, packages/tools/eslint-configs/typescript.js
Refactored rule implementation (destructuring, optional chaining) and adjusted alphabet generation / rule toggles in TypeScript ESLint config.
Fastify Generators: Deterministic Ordering
packages/fastify-generators/src/generators/prisma/.../generate-relation-build-data.ts, .../generate-relation-build-data.unit.test.ts
Added compareStrings import and changed relationFragments sorting to deterministic sort by relationName; updated unit test snapshot to match new ordering.
Auth hook & UI tweak
packages/project-builder-server/src/dev-server/auth-plugin.ts, packages/project-builder-web/src/components/blocker-dialog/blocker-dialog.tsx
Changed Fastify onRequest handler from async to callback-style with explicit done(); removed fallback text when rendering continue-without-save button (uses provided text directly).
Deep-clone -> structuredClone
packages/project-builder-lib/src/migrations/transform-json-path.ts, packages/project-builder-lib/src/utils/definition-diff/definition-diff.ts
Replaced cloneDeep usage with native structuredClone and removed unused cloneDeep import in one place.
JSDoc & minor typings
packages/project-builder-common/index.js, scripts/fix-versions.ts, packages/project-builder-common/tsconfig.json
Added JSDoc for getDefaultPlugins(logger), added/checks noEmit and checkJs in package tsconfig, and added explicit TypeScript typings inside fix-versions conversion.
Misc tests / small fixes
assorted unit tests and helpers (e.g., packages/*/unit.test.ts, test-helpers/*)
Non-functional changes in test files: lint directive migrations and small expectation updates to align with other changes.
Field-map error lint directive
packages/utils/src/field-map/field-map.ts
Added inline oxlint suppression for throw new Error(...) (no behavior change).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main objective: migrating ESLint directives to oxlint and adding type-aware linting rules to improve linting performance and consolidate type-checking.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kingston/eng-1127-add-typeaware-rules-to-oxlint
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security

socket-security Bot commented Mar 19, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedoxlint@​1.55.0 ⏵ 1.56.099 +110091 +196100
Addedoxlint-tsgolint@​0.17.0991009795100

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (3)
packages/project-builder-common/index.js (1)

4-6: Complete the JSDoc documentation.

The JSDoc comment is incomplete. It only documents the parameter type but lacks a function description and return value documentation. Consider adding:

  • A description of what the function does
  • A @returns tag documenting the returned Promise and what it resolves to
📝 Proposed enhancement for complete JSDoc
 /**
+ * Discovers and returns the default plugins for the project builder.
  * `@param` {unknown} logger
+ * `@returns` {Promise<Array>} A promise that resolves to an array of discovered plugins
  */
 export async function getDefaultPlugins(logger) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/project-builder-common/index.js` around lines 4 - 6, Add a full
JSDoc for the function that accepts the `logger` parameter: include a one-line
description of what the function does, document the `@param {unknown} logger`
(describe expected shape/usage), and add a `@returns {Promise<...>}` tag
describing the Promise and what it resolves to (e.g., resolved value type or
void) so the JSDoc fully describes inputs and output for the function that takes
`logger`.
packages/sync/src/utils/non-overwriteable-map.ts (1)

164-180: Consider refactoring to reduce type suppressions.

The migration to oxlint is correct, but this line requires two type safety suppressions (no-unsafe-return and no-unsafe-assignment). Consider adding explicit type guards or using a typed merge helper to eliminate these suppressions:

♻️ Potential refactor to improve type safety
-        (targetValue, sourceValue) => {
+        (targetValue: unknown, sourceValue: unknown) => {
           if (
             mergeArraysUniquely &&
             Array.isArray(targetValue) &&
             Array.isArray(sourceValue)
           ) {
-            // oxlint-disable-next-line `@typescript-eslint/no-unsafe-return`, `@typescript-eslint/no-unsafe-assignment`
-            return uniq([...targetValue, ...sourceValue]);
+            return uniq([...targetValue, ...sourceValue]) as typeof sourceValue;
           }
-          // oxlint-disable-next-line `@typescript-eslint/no-unsafe-return`
-          return sourceValue;
+          return sourceValue as typeof sourceValue;
         },

Note: This is optional and the current approach with suppressions is acceptable given the dynamic nature of the merge operation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/sync/src/utils/non-overwriteable-map.ts` around lines 164 - 180, The
value() method in non-overwriteable-map.ts uses mergeWith over { ...defaults }
and overrideValues and currently contains two oxlint type suppressions for
unsafe return/assignment; remove those suppressions by adding explicit type
guards or a typed merge helper: narrow the checked branch around
mergeArraysUniquely to assert the element types (e.g., guard
Array.isArray(targetValue) && Array.isArray(sourceValue) and refine their item
types before calling uniq and spreading, or create a typedMerge<T> wrapper
around mergeWith that enforces the expected value shape so the customizer can
safely return typed arrays; update references to mergeWith, mergeArraysUniquely,
defaults, overrideValues, uniq, and value() to use the safer types so the linter
suppressions can be removed.
packages/utils/src/json/stringify-pretty-compact.ts (1)

123-124: Inconsistent lint directive naming convention.

Line 123 uses the OXLint convention (typescript/no-confusing-void-expression), but lines 129 and 175 use the ESLint convention (@typescript-eslint/no-unnecessary-condition). OXLint typically uses the typescript/ prefix for its TypeScript rules.

Consider aligning all directives to use the OXLint naming convention for consistency:

♻️ Proposed fix for consistency
-    // oxlint-disable-next-line `@typescript-eslint/no-unnecessary-condition`
+    // oxlint-disable-next-line typescript/no-unnecessary-condition

Apply this change to both lines 129 and 175.

Also applies to: 129-130, 175-176

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/utils/src/json/stringify-pretty-compact.ts` around lines 123 - 124,
Update the lint-disable directives to use the OXLint naming convention
(typescript/...) for consistency: replace occurrences of
"@typescript-eslint/no-unnecessary-condition" with
"typescript/no-unnecessary-condition" near the code that handles obj.toJSON()
(the lines around the obj = (obj as { toJSON: () => void }).toJSON(); statement
and the other two occurrences referenced at lines 129 and 175) so all TypeScript
rule disables use the same "typescript/" prefix.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 59: Update the "version" npm script so Node runs the TypeScript script
with the same runtime flag used elsewhere: change the invocation of node
./scripts/fix-versions.ts in the "version" script to include
--experimental-strip-types (i.e., node --experimental-strip-types
./scripts/fix-versions.ts) so the TypeScript file executes correctly; modify the
package.json "version" script entry accordingly while keeping the existing pnpm
changeset command intact.

In `@packages/project-builder-lib/src/references/expression-types.ts`:
- Around line 229-230: Revert the custom oxlint disable directive back to the
original ESLint form: replace the comment "oxlint-disable-next-line
`@typescript-eslint/no-explicit-any`" with "eslint-disable-next-line
`@typescript-eslint/no-explicit-any`" for the parser property declaration (parser:
RefExpressionParser<any, any, any>), and similarly update the other ~25
instances in packages/project-builder-lib so ESLint still recognizes the
suppression; don't change rule names or remove the suppression, only restore the
"eslint-disable-next-line" prefix.

In `@packages/project-builder-server/src/template-extractor/delete-template.ts`:
- Line 78: Replace the ESLint disable comment that references the wrong rule ID:
change the inline directive that currently says
"@typescript-eslint/no-dynamic-delete" to use the Oxlint rule namespace
"typescript/no-dynamic-delete" (i.e., update the comment in delete-template.ts
where the disable is applied so it reads "// oxlint-disable-next-line
typescript/no-dynamic-delete" to ensure the suppression is honored).

In `@packages/tools/tsconfig.vite.base.json`:
- Around line 6-7: The tsconfig overrides the parent by setting "types":
["node"] and thus loses Vite typings needed for import.meta.env; update the
"types" array in this config to include "vite/client" (e.g., change the "types"
entry to include both "node" and "vite/client") so Vite environment variables
are properly typed and the existing "lib" entries (e.g., "ES2023", "DOM",
"DOM.Iterable") can remain unchanged.

In `@packages/ui-components/src/hooks/use-event-callback.ts`:
- Line 27: Update the OXLint suppression comment in the use-event-callback hook
to use the correct rule namespace: replace the incorrect
"@typescript-eslint/no-unsafe-return" with "typescript/no-unsafe-return" (the
suppression comment near the top of
packages/ui-components/src/hooks/use-event-callback.ts that currently reads the
bad rule); ensure the rest of the comment text (the trailing explanation " --
safe to return the function") remains unchanged so it matches the other
suppression style used in this file (e.g., the existing
"typescript/no-explicit-any" line).

In `@packages/utils/src/types/tuple-paths.ts`:
- Around line 60-61: Replace the incorrect OXLint suppression that uses the
ESLint plugin namespace so the linter recognizes it: locate the generic branch
containing "T extends readonly any[]" in packages/utils/src/types/tuple-paths.ts
and change the comment "// oxlint-disable-next-line
`@typescript-eslint/no-explicit-any`" to "// oxlint-disable-next-line
typescript/no-explicit-any" so the rule id matches the project's oxlint
configuration.

---

Nitpick comments:
In `@packages/project-builder-common/index.js`:
- Around line 4-6: Add a full JSDoc for the function that accepts the `logger`
parameter: include a one-line description of what the function does, document
the `@param {unknown} logger` (describe expected shape/usage), and add a
`@returns {Promise<...>}` tag describing the Promise and what it resolves to
(e.g., resolved value type or void) so the JSDoc fully describes inputs and
output for the function that takes `logger`.

In `@packages/sync/src/utils/non-overwriteable-map.ts`:
- Around line 164-180: The value() method in non-overwriteable-map.ts uses
mergeWith over { ...defaults } and overrideValues and currently contains two
oxlint type suppressions for unsafe return/assignment; remove those suppressions
by adding explicit type guards or a typed merge helper: narrow the checked
branch around mergeArraysUniquely to assert the element types (e.g., guard
Array.isArray(targetValue) && Array.isArray(sourceValue) and refine their item
types before calling uniq and spreading, or create a typedMerge<T> wrapper
around mergeWith that enforces the expected value shape so the customizer can
safely return typed arrays; update references to mergeWith, mergeArraysUniquely,
defaults, overrideValues, uniq, and value() to use the safer types so the linter
suppressions can be removed.

In `@packages/utils/src/json/stringify-pretty-compact.ts`:
- Around line 123-124: Update the lint-disable directives to use the OXLint
naming convention (typescript/...) for consistency: replace occurrences of
"@typescript-eslint/no-unnecessary-condition" with
"typescript/no-unnecessary-condition" near the code that handles obj.toJSON()
(the lines around the obj = (obj as { toJSON: () => void }).toJSON(); statement
and the other two occurrences referenced at lines 129 and 175) so all TypeScript
rule disables use the same "typescript/" prefix.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e085392c-414a-4d5a-b7e3-a4fac86b5102

📥 Commits

Reviewing files that changed from the base of the PR and between 497904a and b3d3fdb.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (67)
  • package.json
  • packages/code-morph/src/morphers/tests/morpher.test-helper.ts
  • packages/core-generators/src/test-helpers/matchers.ts
  • packages/fastify-generators/src/generators/prisma/_shared/build-data-helpers/generate-relation-build-data.ts
  • packages/fastify-generators/src/generators/prisma/_shared/build-data-helpers/generate-relation-build-data.unit.test.ts
  • packages/fastify-generators/src/test-helpers/setup.test-helper.ts
  • packages/fastify-generators/src/types/service-output.ts
  • packages/project-builder-common/index.js
  • packages/project-builder-lib/src/compiler/admin-crud-action-compiler.ts
  • packages/project-builder-lib/src/compiler/admin-crud-column-compiler-spec.ts
  • packages/project-builder-lib/src/compiler/admin-crud-input-spec.ts
  • packages/project-builder-lib/src/compiler/app-compiler-spec.ts
  • packages/project-builder-lib/src/compiler/model-transformer-compiler-spec.ts
  • packages/project-builder-lib/src/migrations/migration-005-primary-unique-refs.unit.test.ts
  • packages/project-builder-lib/src/migrations/transform-json-path.ts
  • packages/project-builder-lib/src/migrations/types.ts
  • packages/project-builder-lib/src/parser/definition-issue-utils.ts
  • packages/project-builder-lib/src/parser/definition-issue-utils.unit.test.ts
  • packages/project-builder-lib/src/parser/transform-data-with-schema.ts
  • packages/project-builder-lib/src/plugins/imports/loader.unit.test.ts
  • packages/project-builder-lib/src/references/definition-ref-builder.ts
  • packages/project-builder-lib/src/references/definition-ref-registry.ts
  • packages/project-builder-lib/src/references/expression-types.ts
  • packages/project-builder-lib/src/schema/creator/infer-types.ts
  • packages/project-builder-lib/src/specs/packages/library-type-spec.ts
  • packages/project-builder-lib/src/web/specs/admin-crud-action-web-spec.ts
  • packages/project-builder-lib/src/web/specs/admin-crud-column-web-spec.ts
  • packages/project-builder-lib/src/web/specs/admin-crud-input-web-spec.ts
  • packages/project-builder-lib/src/web/specs/model-transformer-web-spec.ts
  • packages/project-builder-server/src/actions/types.ts
  • packages/project-builder-server/src/actions/utils/trpc.ts
  • packages/project-builder-server/src/dev-server/auth-plugin.ts
  • packages/project-builder-server/src/plugins/plugin-discovery.unit.test.ts
  • packages/project-builder-server/src/template-extractor/delete-template.ts
  • packages/project-builder-server/src/templates/utils/extractor-config.ts
  • packages/project-builder-web/src/components/blocker-dialog/blocker-dialog.tsx
  • packages/project-builder-web/src/components/error-boundary/error-boundary.tsx
  • packages/project-builder-web/src/router.tsx
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/action-dialog.tsx
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/column-dialog.tsx
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/field-dialog.tsx
  • packages/react-generators/src/test-helpers/setup.test-helper.ts
  • packages/sync/src/generators/generators.ts
  • packages/sync/src/runner/generator-runner.ts
  • packages/sync/src/runner/generator-runner.unit.test.ts
  • packages/sync/src/templates/extractor/test-utils/mock-context.ts
  • packages/sync/src/utils/non-overwriteable-map.ts
  • packages/tools/eslint-configs/react.js
  • packages/tools/eslint-configs/rules/no-unused-generator-dependencies.js
  • packages/tools/eslint-configs/typescript.js
  • packages/tools/oxlint.config.base.ts
  • packages/tools/tsconfig.node.base.json
  • packages/tools/tsconfig.vite.base.json
  • packages/ui-components/src/components/ui/form-action-bar/form-action-bar.tsx
  • packages/ui-components/src/hooks/use-event-callback.ts
  • packages/ui-components/src/utils/generic-forward-ref.ts
  • packages/utils/src/events/typed-event-emitter.ts
  • packages/utils/src/fs/handle-not-found-error.unit.test.ts
  • packages/utils/src/json/json-deep-clone.unit.test.ts
  • packages/utils/src/json/stringify-pretty-compact.ts
  • packages/utils/src/objects/safe-merge.ts
  • packages/utils/src/types/tuple-paths.ts
  • packages/utils/src/types/tuple-paths.unit.test.ts
  • pnpm-workspace.yaml
  • scripts/fix-versions.ts
  • scripts/version-fix/collect-bad-versions.js
  • scripts/version-fix/unpublish.js
💤 Files with no reviewable changes (2)
  • scripts/version-fix/unpublish.js
  • scripts/version-fix/collect-bad-versions.js

Comment thread package.json
"test-project:save": "pnpm --filter @baseplate-dev/project-builder-test test-project:save",
"typecheck": "turbo run typecheck --affected --continue",
"version": "pnpm changeset version && node ./scripts/fix-versions.js",
"version": "pnpm changeset version && node ./scripts/fix-versions.ts",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Missing --experimental-strip-types flag for TypeScript execution.

The version script invokes node ./scripts/fix-versions.ts directly, but TypeScript files require the --experimental-strip-types flag to run with Node.js (as correctly used on line 11 for changesets:check).

🐛 Proposed fix
-    "version": "pnpm changeset version && node ./scripts/fix-versions.ts",
+    "version": "pnpm changeset version && node --experimental-strip-types ./scripts/fix-versions.ts",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"version": "pnpm changeset version && node ./scripts/fix-versions.ts",
"version": "pnpm changeset version && node --experimental-strip-types ./scripts/fix-versions.ts",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 59, Update the "version" npm script so Node runs the
TypeScript script with the same runtime flag used elsewhere: change the
invocation of node ./scripts/fix-versions.ts in the "version" script to include
--experimental-strip-types (i.e., node --experimental-strip-types
./scripts/fix-versions.ts) so the TypeScript file executes correctly; modify the
package.json "version" script entry accordingly while keeping the existing pnpm
changeset command intact.

Comment on lines 229 to 230
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
parser: RefExpressionParser<any, any, any>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Remaining ESLint entry points =="
rg -n --glob 'package.json' --glob 'eslint.config.*' --glob '.github/workflows/*' --glob '.vscode/*' '\beslint\b|@eslint/js|packages/tools/eslint-configs'

echo
echo "== Inline disable directive forms in source =="
rg -n --glob '**/*.{js,jsx,ts,tsx,mjs,cjs}' 'oxlint-disable-next-line `@typescript-eslint/no-explicit-any`|eslint-disable-next-line `@typescript-eslint/no-explicit-any`'

Repository: halfdomelabs/baseplate

Length of output: 50378


🏁 Script executed:

# First, check the actual file and surrounding context
sed -n '225,235p' packages/project-builder-lib/src/references/expression-types.ts

Repository: halfdomelabs/baseplate

Length of output: 433


🏁 Script executed:

# Count how many oxlint-disable directives appear in the changed file
rg -c 'oxlint-disable' packages/project-builder-lib/src/references/expression-types.ts

Repository: halfdomelabs/baseplate

Length of output: 67


🏁 Script executed:

# Find all instances of both directive types in this specific file
rg -n 'eslint-disable|oxlint-disable' packages/project-builder-lib/src/references/expression-types.ts

Repository: halfdomelabs/baseplate

Length of output: 134


🏁 Script executed:

# Check if other files in the same package show this directive pattern
rg -n 'eslint-disable|oxlint-disable' packages/project-builder-lib/

Repository: halfdomelabs/baseplate

Length of output: 5154


🏁 Script executed:

# Check if packages/project-builder-lib has its own package.json with lint config
cat packages/project-builder-lib/package.json | grep -A 5 '"lint"'

Repository: halfdomelabs/baseplate

Length of output: 325


🏁 Script executed:

# Check for any eslint config in this package directory
find packages/project-builder-lib -maxdepth 2 -name 'eslint.config.*' -o -name '.eslintrc*'

Repository: halfdomelabs/baseplate

Length of output: 111


Do not change disable directive syntax until ESLint is removed from the lint pipeline.

This package runs both oxlint && eslint ., and changing eslint-disable-next-line to oxlint-disable-next-line will break ESLint's suppression. While oxlint honors eslint-disable comments for backward compatibility, ESLint does not recognize oxlint-disable comments. Revert these directives to eslint-disable-next-line across packages/project-builder-lib (25+ instances).

Example fix
-  // oxlint-disable-next-line `@typescript-eslint/no-explicit-any`
+  // eslint-disable-next-line `@typescript-eslint/no-explicit-any`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
parser: RefExpressionParser<any, any, any>;
// eslint-disable-next-line `@typescript-eslint/no-explicit-any`
parser: RefExpressionParser<any, any, any>;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/project-builder-lib/src/references/expression-types.ts` around lines
229 - 230, Revert the custom oxlint disable directive back to the original
ESLint form: replace the comment "oxlint-disable-next-line
`@typescript-eslint/no-explicit-any`" with "eslint-disable-next-line
`@typescript-eslint/no-explicit-any`" for the parser property declaration (parser:
RefExpressionParser<any, any, any>), and similarly update the other ~25
instances in packages/project-builder-lib so ESLint still recognizes the
suppression; don't change rule names or remove the suppression, only restore the
"eslint-disable-next-line" prefix.

Comment thread packages/project-builder-server/src/template-extractor/delete-template.ts Outdated
Comment on lines +6 to +7
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"types": ["node"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether Vite ambient types are needed but not declared in extending configs.

echo "== tsconfig files extending tsconfig.vite.base.json =="
rg -n '"extends"\s*:\s*"\./tsconfig\.vite\.base\.json"' --type=json -C2

echo
echo "== Any explicit vite/client typings already declared? =="
rg -n '"types"\s*:\s*\[[^]]*vite/client' --type=json -C2

echo
echo "== Potential usage requiring vite/client typing =="
rg -nP --type=ts --type=tsx -C2 '\bimport\.meta\.env\b|\bImportMetaEnv\b'

Repository: halfdomelabs/baseplate

Length of output: 990


🏁 Script executed:

#!/bin/bash
# Check the full content of the extending tsconfig files to see if they override types

echo "=== tsconfig.vite.web.json ==="
cat packages/tools/tsconfig.vite.web.json

echo
echo "=== tsconfig.vite.lib.json ==="
cat packages/tools/tsconfig.vite.lib.json

echo
echo "=== tsconfig.vite.base.json ==="
cat packages/tools/tsconfig.vite.base.json

Repository: halfdomelabs/baseplate

Length of output: 962


🏁 Script executed:

#!/bin/bash
# Find which projects use these tsconfig files

echo "=== Projects using tsconfig.vite.web.json ==="
rg -l 'tsconfig\.vite\.web\.json' --type=json --type=ts

echo
echo "=== Projects using tsconfig.vite.lib.json ==="
rg -l 'tsconfig\.vite\.lib\.json' --type=json --type=ts

echo
echo "=== Check git log for this file to understand intent ==="
git log --oneline -20 packages/tools/tsconfig.vite.base.json 2>/dev/null || echo "(git history not available)"

echo
echo "=== Check if `@tsconfig/vite-react` is in dependencies ==="
rg -l '@tsconfig/vite-react' --type=json

Repository: halfdomelabs/baseplate

Length of output: 939


🏁 Script executed:

#!/bin/bash
# Check what's in `@tsconfig/vite-react` and if project-builder-web has issues

echo "=== Check if `@tsconfig/vite-react` is installed and what it contains ==="
find . -path "*/node_modules/@tsconfig/vite-react*" -type f -name "tsconfig.json" 2>/dev/null | head -5 | xargs cat 2>/dev/null || echo "(node_modules not available)"

echo
echo "=== project-builder-web tsconfig ==="
cat packages/project-builder-web/tsconfig.app.json 2>/dev/null || echo "not found"

echo
echo "=== Check if project-builder-web would need vite/client types ==="
rg -n 'import\.meta\.env' packages/project-builder-web --type=ts --type=tsx -A2 -B2 || echo "(no usage found)"

echo
echo "=== Check vite version and what it provides ==="
cat packages/tools/package.json | jq '.dependencies.vite, .devDependencies.vite' 2>/dev/null || grep -i '"vite"' packages/tools/package.json

Repository: halfdomelabs/baseplate

Length of output: 610


Consider adding vite/client to the types array if Vite environment variables will be used.

The base config extends @tsconfig/vite-react but sets "types": ["node"] explicitly. This overrides the parent config's type declarations. If code uses import.meta.env, add "vite/client" to ensure proper typing.

Suggested adjustment
   "compilerOptions": {
     "lib": ["ES2023", "DOM", "DOM.Iterable"],
-    "types": ["node"]
+    "types": ["node", "vite/client"]
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"types": ["node"]
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"types": ["node", "vite/client"]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/tools/tsconfig.vite.base.json` around lines 6 - 7, The tsconfig
overrides the parent by setting "types": ["node"] and thus loses Vite typings
needed for import.meta.env; update the "types" array in this config to include
"vite/client" (e.g., change the "types" entry to include both "node" and
"vite/client") so Vite environment variables are properly typed and the existing
"lib" entries (e.g., "ES2023", "DOM", "DOM.Iterable") can remain unchanged.

Comment thread packages/ui-components/src/hooks/use-event-callback.ts Outdated
Comment thread packages/utils/src/types/tuple-paths.ts Outdated
@kingston kingston merged commit a64d481 into main Mar 20, 2026
9 of 10 checks passed
@kingston kingston deleted the kingston/eng-1127-add-typeaware-rules-to-oxlint branch March 20, 2026 08:27
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.

1 participant