Skip to content

Conversation

@mheob
Copy link
Owner

@mheob mheob commented Dec 22, 2025

Summary

This PR adds React Compiler support to the ESLint configuration, introduces config presets for easier configuration management, and makes jsdoc and node options optional with sensible defaults.

Changes

  • React Compiler Support: Added conditional React Compiler rules that activate when babel-plugin-react-compiler is detected in the project
  • Config Presets: Introduced CONFIG_PRESET_FULL_ON and CONFIG_PRESET_FULL_OFF presets for quick configuration
  • Optional Options: Made jsdoc and node options optional (default: true) to provide more flexibility
  • Rule Updates: Updated React rule severities and removed some deprecated rules
  • Dependencies: Updated multiple dependencies including ESLint, TypeScript ESLint plugins, React plugins, and other tooling dependencies

Motivation

React Compiler is becoming an important tool for React applications, and having ESLint rules that support it helps developers catch issues early. The config presets make it easier for users to quickly set up configurations, and making jsdoc/node optional provides better control over the configuration while maintaining sensible defaults.

Summary by CodeRabbit

  • New Features

    • Added React Compiler support with automatic detection
    • Introduced configuration presets for quick setup options
    • Made JSDoc and Node.js rules optional (enabled by default)
  • Improvements

    • Removed deprecated React validation rules
    • Added new linting rules for TypeScript, testing, and commands
    • Updated rule severity configurations
  • Dependencies

    • Updated ESLint plugins and related tooling to latest versions

✏️ Tip: You can customize this high-level summary in your review settings.

- Add React Compiler rules with conditional activation
- Add config presets (FULL_ON/FULL_OFF)
- Make jsdoc and node options optional (default true)
- Update React rule severities
- Update dependencies
@mheob mheob added eslint 🚨 Belongs to ESLint config deps 📦 labels Dec 22, 2025
@vercel
Copy link

vercel bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
eslint-config Ready Ready Preview, Comment Dec 22, 2025 10:47am

@changeset-bot
Copy link

changeset-bot bot commented Dec 22, 2025

🦋 Changeset detected

Latest commit: 43c991b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@mheob/eslint-config Minor

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Walkthrough

This pull request introduces React Compiler support to an ESLint configuration package through new configuration presets and optional jsdoc/node settings. The factory builder is refactored to use a preset-backed approach, and related types, dependencies, and generated types are updated accordingly.

Changes

Cohort / File(s) Summary
React Compiler Support & Configuration Presets
.changeset/1766399706-eslint-react-compiler.md, packages/eslint-config/src/config-presets.ts, packages/eslint-config/src/configs/react.ts, packages/eslint-config/src/types.ts
Introduces React Compiler support with CONFIG_PRESET_FULL_ON and CONFIG_PRESET_FULL_OFF presets. Adds OptionsReact interface with optional reactCompiler flag. Updates React config to conditionally enable compiler-specific rules, removes deprecated React rules (no-missing-button-type, no-missing-iframe-sandbox, no-unstable-context-value, no-unstable-default-props, no-unused-class-component-members, no-unused-state), tightens severity on several rules (no-duplicate-key, no-nested-lazy-component-declarations), and adds react/jsx-key-before-spread.
Factory & Configuration Building
packages/eslint-config/src/factory.ts, packages/eslint-config/scripts/typegen.ts
Makes jsdoc and node configs optional with defaults of true via options.jsdoc and options.node. Refactors typegen.ts to use factory-backed builder (mheob CONFIG_PRESET_FULL_ON) instead of dynamic config assembly. Updates ConfigNames type to drop fallback 'never' value.
Type & Version Updates
packages/eslint-config/src/typegen.d.ts, packages/eslint-config/src/cli/versions-map.generated.ts
Regenerates typegen.d.ts with new rule options (command/command, test/no-unneeded-async-expect-function, test/prefer-to-have-been-called-times, ts/no-useless-default-assignment), removes test/require-import-vi-mock, updates next/next-script-for-ga documentation, and expands ConfigNames with restructured config name entries. Updates dependency versions: @eslint-react/eslint-plugin ^2.3.12→^2.3.13, @next/eslint-plugin-next ^16.0.7→^16.1.0, eslint ^9.39.1→^9.39.2, eslint-plugin-react-refresh ^0.4.24→^0.4.26.
Dependency & Environment Updates
pnpm-workspace.yaml, packages/eslint-config/src/utils/checks.ts
Updates multiple ESLint ecosystem and TypeScript tooling dependencies with minor version bumps and adds onlyBuiltDependencies section (esbuild, unrs-resolver). Removes VSCODE_CWD from isInEditorEnv environment variable checks while maintaining other editor indicators.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • React config changes (packages/eslint-config/src/configs/react.ts): Review conditional React Compiler rule activation, removal of deprecated rules, and severity tightening to verify correctness and backward compatibility.
  • Factory refactoring (packages/eslint-config/src/factory.ts and scripts/typegen.ts): Ensure the preset-backed builder approach maintains feature parity with the previous dynamic assembly.
  • Generated type updates (packages/eslint-config/src/typegen.d.ts): Verify the restructured ConfigNames union and new/removed rule entries are accurate and complete.
  • Type propagation (packages/eslint-config/src/types.ts): Confirm OptionsReact interface and the jsdoc/node options integrate properly throughout the config chain.

Possibly related PRs

Suggested labels

enhancement, eslint, deps 📦

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(eslint): add React Compiler support' directly and clearly describes the primary feature addition in this PR, which introduces React Compiler support to the ESLint configuration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-deps

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 373ea08 and 43c991b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .changeset/1766399706-eslint-react-compiler.md
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/cli/versions-map.generated.ts
  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/typegen.d.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/utils/checks.ts
  • pnpm-workspace.yaml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/any-inside-generic-functions.mdc)

Using any is acceptable inside generic function bodies when TypeScript cannot match runtime logic to type logic, but should be used sparingly outside of generic functions

Do not use default exports unless explicitly required by the framework. Use named exports instead for TypeScript and TSX files.

**/*.{ts,tsx}: Use TypeScript for all code. Prefer interface over type for object shapes.
Follow the ESLint rules.
Use 'function' keyword for pure functions.
Follow file structure: Exported component, subcomponents, helpers, static content, types.
Avoid unnecessary curly braces in conditional statements.
For single-line statements in conditionals, omit curly braces.
Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()).
Handle errors and edge cases at the beginning of functions.
Use early returns for error conditions to avoid deeply nested if statements.
Place the happy path last in the function for improved readability.
Avoid unnecessary else statements; use if-return pattern instead.
Use guard clauses to handle preconditions and invalid states early.
Implement proper error logging and user-friendly error messages.
Consider using custom error types or error factories for consistent error handling.
Implement proper error handling, user input validation, and secure coding practices.
Provide clear and concise comments for complex logic.
Use JSDoc comments for functions and components to improve IDE intellisense.

**/*.{ts,tsx}: Proactively use discriminated unions to model data that can be in one of a few different shapes, such as when sending events between environments
Use switch statements to handle the results of discriminated unions by switching on the discriminator property
Use discriminated unions to prevent the 'bag of optionals' problem by modeling states as distinct union types rather than interfaces with optional fields

**/*.{ts,tsx}: Do not introduce new enums into the codebase. Retain existing enums.
I...

Files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/cli/versions-map.generated.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/utils/checks.ts
  • packages/eslint-config/src/typegen.d.ts
pnpm-workspace.yaml

📄 CodeRabbit inference engine (CLAUDE.md)

Configure pnpm workspaces in pnpm-workspace.yaml

Files:

  • pnpm-workspace.yaml
🧠 Learnings (38)
📓 Common learnings
Learnt from: mheob
Repo: mheob/config PR: 270
File: packages/eslint-config/package.json:39-78
Timestamp: 2025-05-28T11:00:09.943Z
Learning: The maintainer mheob is confident in managing non-major dependency updates for mheob/eslint-config and assesses compatibility before merging. They don't need detailed warnings about potential breaking changes in patch/minor version updates.
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for functions and components to improve IDE intellisense.
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to eslint.config.ts : Configure ESLint in eslint.config.ts at the root level

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-06-12T17:41:36.115Z
Learnt from: mheob
Repo: mheob/config PR: 276
File: packages/eslint-config/src/typegen.d.ts:2217-2223
Timestamp: 2025-06-12T17:41:36.115Z
Learning: The file `packages/eslint-config/src/typegen.d.ts` should be ignored in code reviews and related automated checks.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/utils/checks.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:46:01.626Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-11-26T17:46:01.626Z
Learning: Applies to **/*.{ts,tsx} : Use file extensions: `.config.ts`, `.test.ts`, `.context.tsx`, `.type.ts`, `.hook.ts` as appropriate

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:20.305Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Follow the ESLint rules.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:20.305Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for functions and components to improve IDE intellisense.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-06-24T23:14:43.211Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-exports.mdc:0-0
Timestamp: 2025-06-24T23:14:43.211Z
Learning: In TypeScript files (*.ts, *.tsx), prefer named exports over default exports to reduce confusion when importing functions or components, unless the framework (such as Next.js pages) explicitly requires a default export.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to prettier.config.mjs : Configure Prettier in prettier.config.mjs at the root level

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:50.911Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/jsdoc-comments.mdc:0-0
Timestamp: 2025-11-26T17:45:50.911Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments to annotate functions and types in TypeScript files

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:32.304Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/enums.mdc:0-0
Timestamp: 2025-11-26T17:45:32.304Z
Learning: Applies to **/*.{ts,tsx} : Do not introduce new enums into the codebase. Retain existing enums.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
📚 Learning: 2025-06-24T23:14:59.895Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/import-type.mdc:0-0
Timestamp: 2025-06-24T23:14:59.895Z
Learning: In TypeScript files (*.ts, *.tsx), prefer using top-level 'import type' statements rather than inline 'import { type ... }' to avoid issues where type imports are not properly erased in certain environments.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
📚 Learning: 2025-11-26T17:46:01.626Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-11-26T17:46:01.626Z
Learning: Applies to **/*.{ts,tsx} : Avoid magic numbers and define constants

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:20.305Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript for all code. Prefer `interface` over `type` for object shapes.

Applied to files:

  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
📚 Learning: 2025-11-26T17:46:13.513Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/readonly-properties.mdc:0-0
Timestamp: 2025-11-26T17:46:13.513Z
Learning: Applies to **/*.{ts,tsx} : Use `readonly` properties for object types by default in TypeScript to prevent accidental mutation at runtime. Omit `readonly` only when the property is genuinely mutable.

Applied to files:

  • packages/eslint-config/src/types.ts
📚 Learning: 2025-06-24T23:15:06.053Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/jsdoc-comments.mdc:0-0
Timestamp: 2025-06-24T23:15:06.053Z
Learning: In TypeScript files (*.ts, *.tsx), JSDoc comments should be used to annotate functions and types, but only when the function's behavior is not self-evident. Comments should be concise and leverage the JSDoc inline link tag to reference other functions and types within the same file.

Applied to files:

  • packages/eslint-config/src/types.ts
📚 Learning: 2025-06-24T23:15:07.222Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/jsdoc-comments.mdc:0-0
Timestamp: 2025-06-24T23:15:07.222Z
Learning: In TypeScript files (*.ts, *.tsx), JSDoc comments should be used to annotate functions and types, but only when the function's behavior is not self-evident. Comments should be concise, and the JSDoc inline link tag can be used to reference other functions and types within the same file.

Applied to files:

  • packages/eslint-config/src/types.ts
📚 Learning: 2025-05-28T11:00:09.943Z
Learnt from: mheob
Repo: mheob/config PR: 270
File: packages/eslint-config/package.json:39-78
Timestamp: 2025-05-28T11:00:09.943Z
Learning: The maintainer mheob is confident in managing non-major dependency updates for mheob/eslint-config and assesses compatibility before merging. They don't need detailed warnings about potential breaking changes in patch/minor version updates.

Applied to files:

  • packages/eslint-config/src/cli/versions-map.generated.ts
  • pnpm-workspace.yaml
  • .changeset/1766399706-eslint-react-compiler.md
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to @(package.json|.github/workflows/*.yml) : Maintain Node version compatibility with ^22.12.0 or ^24.0.0

Applied to files:

  • packages/eslint-config/src/cli/versions-map.generated.ts
  • pnpm-workspace.yaml
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to pnpm-workspace.yaml : Configure pnpm workspaces in pnpm-workspace.yaml

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Use Turborepo with pnpm workspaces as the monorepo manager

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-24T23:15:00.345Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/installing-libraries.mdc:0-0
Timestamp: 2025-06-24T23:15:00.345Z
Learning: When installing libraries in JavaScript or TypeScript projects (such as those containing .ts or .tsx files), do not manually select package versions based on your own knowledge or training data, as it may be outdated. Instead, use a package manager command (such as 'pnpm add', 'yarn add', or 'npm install') to fetch and install the latest version of the library, ensuring up-to-date dependencies.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2024-12-11T10:36:23.225Z
Learnt from: mheob
Repo: mheob/config PR: 217
File: packages/eslint-config/package.json:69-70
Timestamp: 2024-12-11T10:36:23.225Z
Learning: In the `packages/eslint-config/package.json`, the project uses `svelte@^5.x.x (beta)`, and the user is comfortable using Svelte v5 (beta). Do not flag the usage of Svelte v5 (beta) as a potential issue in future code reviews for this project.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-26T17:45:36.509Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/import-type.mdc:0-0
Timestamp: 2025-11-26T17:45:36.509Z
Learning: Applies to **/*.{ts,tsx} : Use top-level `import type` syntax when importing TypeScript types (e.g., `import type { User } from './user'`). Avoid inline `import { type ... }` syntax to ensure type imports are properly erased during transpilation in all environments.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
📚 Learning: 2025-06-24T23:14:59.895Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/import-type.mdc:0-0
Timestamp: 2025-06-24T23:14:59.895Z
Learning: In TypeScript files (*.ts, *.tsx), always use 'import type' when importing types to ensure that type-only imports are erased during transpilation and do not result in runtime side effects.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-11-26T17:45:25.749Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/discriminated-unions.mdc:0-0
Timestamp: 2025-11-26T17:45:25.749Z
Learning: Applies to **/*.{ts,tsx} : Use discriminated unions to prevent the 'bag of optionals' problem by modeling states as distinct union types rather than interfaces with optional fields

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-06-24T23:15:13.022Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-06-24T23:15:13.022Z
Learning: In TypeScript files (*.ts, *.tsx), avoid magic numbers by defining constants instead.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-11-26T17:45:25.749Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/discriminated-unions.mdc:0-0
Timestamp: 2025-11-26T17:45:25.749Z
Learning: Applies to **/*.{ts,tsx} : Proactively use discriminated unions to model data that can be in one of a few different shapes, such as when sending events between environments

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-06-24T23:14:50.420Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/discriminated-unions.mdc:0-0
Timestamp: 2025-06-24T23:14:50.420Z
Learning: In TypeScript files (*.ts, *.tsx), discriminated unions should be used to model data that can take on a limited set of distinct shapes, as this prevents impossible states and improves type safety.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-06-24T23:14:52.716Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/discriminated-unions.mdc:0-0
Timestamp: 2025-06-24T23:14:52.716Z
Learning: In TypeScript files (*.ts, *.tsx), discriminated unions are preferred for modeling data that can take on several distinct shapes, as they provide type safety and prevent impossible states.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-01-21T15:28:16.959Z
Learnt from: mheob
Repo: mheob/config PR: 223
File: packages/eslint-config/src/typegen.d.ts:2973-2977
Timestamp: 2025-01-21T15:28:16.959Z
Learning: Auto-generated files like typegen.d.ts may contain seemingly duplicate or overlapping rules/definitions which should not be flagged as issues since they are machine-generated and not meant to be manually modified.

Applied to files:

  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-01-21T15:28:22.683Z
Learnt from: mheob
Repo: mheob/config PR: 223
File: packages/eslint-config/src/typegen.d.ts:680-682
Timestamp: 2025-01-21T15:28:22.683Z
Learning: For generated source files (like typegen.d.ts), it's acceptable to keep deprecated rules/content since modifications should be made to the generation source rather than the generated files directly.

Applied to files:

  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-06-24T23:14:47.194Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-06-24T23:14:47.194Z
Learning: In TypeScript codebases (files matching **/*.{ts,tsx}), optimize performance by reducing load times and improving rendering efficiency.

Applied to files:

  • packages/eslint-config/scripts/typegen.ts
📚 Learning: 2025-11-26T17:45:20.305Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Follow file structure: Exported component, subcomponents, helpers, static content, types.

Applied to files:

  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to @(.husky/**|package.json) : Use Husky for pre-commit git hooks

Applied to files:

  • packages/eslint-config/src/utils/checks.ts
📚 Learning: 2025-06-24T23:14:47.194Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-06-24T23:14:47.194Z
Learning: In TypeScript codebases (files matching **/*.{ts,tsx}), provide clear and concise comments for complex logic, and use JSDoc comments for functions and components to improve IDE intellisense.

Applied to files:

  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:10.940Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-exports.mdc:0-0
Timestamp: 2025-11-26T17:45:10.940Z
Learning: Applies to **/*.{ts,tsx} : Do not use default exports unless explicitly required by the framework. Use named exports instead for TypeScript and TSX files.

Applied to files:

  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to commitlint.config.js : Configure commitlint in commitlint.config.js at the root level

Applied to files:

  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:46:01.626Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-11-26T17:46:01.626Z
Learning: Applies to **/*.{ts,tsx} : Use ALL_CAPS (CONSTANT_CASE) for constants and enum values (e.g., `MAX_COUNT`, `Color.RED`)

Applied to files:

  • packages/eslint-config/src/typegen.d.ts
🧬 Code graph analysis (5)
packages/eslint-config/src/config-presets.ts (1)
packages/eslint-config/src/types.ts (1)
  • OptionsConfig (112-320)
packages/eslint-config/src/cli/versions-map.generated.ts (2)
packages/eslint-config/src/cli/stages/update-package-json.ts (1)
  • updatePackageJson (22-54)
packages/eslint-config/src/configs/nextjs.ts (1)
  • nextjs (22-63)
packages/eslint-config/scripts/typegen.ts (2)
packages/eslint-config/src/factory.ts (1)
  • mheob (95-294)
packages/eslint-config/src/config-presets.ts (1)
  • CONFIG_PRESET_FULL_ON (3-26)
packages/eslint-config/src/factory.ts (2)
packages/eslint-config/src/configs/jsdoc.ts (1)
  • jsdoc (15-40)
packages/eslint-config/src/configs/node.ts (1)
  • node (15-34)
packages/eslint-config/src/typegen.d.ts (1)
packages/eslint-config/src/types.ts (1)
  • ConfigNames (8-8)
🔇 Additional comments (21)
packages/eslint-config/src/cli/versions-map.generated.ts (1)

2-8: LGTM! Dependency versions updated appropriately.

The minor and patch version updates align with the PR's goal to update dependencies for React Compiler support.

pnpm-workspace.yaml (2)

13-71: LGTM! Catalog dependencies updated.

The dependency version updates are consistent with the PR objectives to support React Compiler and update tooling dependencies.


78-80: New section added for binary dependencies.

The onlyBuiltDependencies section explicitly lists dependencies that require native builds (esbuild, unrs-resolver), which can help with reproducible builds and clarify binary dependency handling.

.changeset/1766399706-eslint-react-compiler.md (1)

1-11: LGTM! Changeset properly documents the release.

The changeset accurately summarizes the key changes: React Compiler support, config presets, optional jsdoc/node options, and dependency updates.

packages/eslint-config/src/factory.ts (3)

151-153: LGTM! JSDoc rules now optional with sensible default.

Making JSDoc rules optional with a default of true maintains backward compatibility while providing flexibility for users who don't want JSDoc enforcement.


175-177: LGTM! Node rules now optional with sensible default.

Making Node.js rules optional with a default of true provides flexibility while maintaining backward compatibility.


179-188: LGTM! React config now supports sub-options.

The spread of resolveSubOptions(options, 'react') enables the new OptionsReact interface to pass through React-specific configuration like reactCompiler, aligning with the PR's goal to add React Compiler support.

packages/eslint-config/src/config-presets.ts (2)

3-26: LGTM! Comprehensive preset for full feature enablement.

CONFIG_PRESET_FULL_ON provides a convenient way to enable all features including React Compiler support, which is useful for testing and quick configuration setup.


28-48: LGTM! Comprehensive preset for feature disablement.

CONFIG_PRESET_FULL_OFF provides a clean starting point for users who want to selectively enable only specific features.

packages/eslint-config/scripts/typegen.ts (1)

6-15: LGTM! Cleaner type generation approach.

The refactoring to use mheob(CONFIG_PRESET_FULL_ON) simplifies the type generation process and aligns with the new preset-based configuration system. This ensures all rules and config names are captured for type generation.

packages/eslint-config/src/types.ts (4)

94-110: LGTM! Well-documented React configuration interface.

The new OptionsReact interface properly extends OptionsOverrides and introduces the reactCompiler option to support React Compiler rules. The JSDoc comments are clear and concise.


173-178: LGTM! JSDoc option added with sensible default.

The jsdoc boolean option enables opt-out behavior for JSDoc rules while maintaining backward compatibility with a default of true.


215-220: LGTM! Node.js option added with sensible default.

The node boolean option enables opt-out behavior for Node.js rules while maintaining backward compatibility with a default of true.


237-237: LGTM! React option now supports extended configuration.

Changing from boolean | OptionsOverrides to boolean | OptionsReact enables React-specific configuration options like reactCompiler while maintaining backward compatibility with boolean values.

packages/eslint-config/src/configs/react.ts (6)

4-10: LGTM!

The type imports follow the coding guideline to use top-level import type syntax for TypeScript types.


23-23: LGTM!

The constant follows the established pattern for package detection arrays in this file.


37-44: LGTM!

The auto-detection default for reactCompiler follows the established pattern used elsewhere in this file (e.g., isAllowConstantExport, isUsingRemix). This provides sensible defaults while still allowing explicit opt-in/opt-out via the OptionsReact type.


214-219: LGTM!

Upgrading these rules from warn to error is appropriate—duplicate keys cause reconciliation issues, and nested lazy component declarations lead to unexpected remounts. Both represent correctness concerns.


126-145: No action needed. These are legitimate React Compiler rules officially integrated into eslint-plugin-react-hooks and properly configured with the correct severity levels.


194-194: Rule react/jsx-key-before-spread is valid and correctly configured.

The rule exists in @eslint-react/eslint-plugin (version ^2.3.13). The plugin is registered as react in the configuration (line 76), so the rule ID uses the react/ prefix correctly. This rule enforces that a JSX element's key prop appears before any spread props, ensuring the JSX automatic runtime receives the key correctly.

packages/eslint-config/src/typegen.d.ts (1)

911-919: Skipping review of auto-generated file.

Based on learnings, this file (typegen.d.ts) is auto-generated and should be ignored in code reviews. Any modifications should be made to the generation source rather than this file directly.


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.

@sonarqubecloud
Copy link

@claude
Copy link

claude bot commented Dec 22, 2025

Pull Request Review: React Compiler Support

Thank you for this well-structured PR! Here's my detailed review:

Strengths

  1. Clear Purpose & Documentation: The changeset clearly documents all changes, making it easy for users to understand what's new
  2. Smart Auto-Detection: React Compiler rules are automatically enabled when babel-plugin-react-compiler is detected, providing a great DX
  3. Config Presets: The new CONFIG_PRESET_FULL_ON and CONFIG_PRESET_FULL_OFF presets are helpful for quick setup
  4. Optional Defaults: Making jsdoc and node optional with true defaults is a good balance of flexibility and sensible defaults
  5. Type Safety: Proper TypeScript interfaces for OptionsReact with good documentation

🔍 Code Quality Observations

Excellent

  • Clean separation of concerns with the new config-presets.ts file
  • Consistent code style throughout
  • Proper use of conditional rule activation (packages/eslint-config/src/configs/react.ts:127-145)

Typegen Script Refactoring (packages/eslint-config/scripts/typegen.ts)

The simplification from manually importing 25+ configs to using CONFIG_PRESET_FULL_ON is elegant! However:

  • Question: Does this ensure all possible configs are included in type generation? If someone uses a config not in the preset, will types still be generated?
  • Minor: The removed empty string check on line 23 (|| 'never') suggests confidence that configNames will always have values. This is likely fine with the preset approach.

React Rules Updates (packages/eslint-config/src/configs/react.ts)

The rule changes look reasonable:

  • ✅ Upgraded severity: no-duplicate-key (warn → error), no-nested-lazy-component-declarations (warn → error) - good catches for actual bugs
  • ⚠️ Removed rules: Lines 111-112, 230-233 removed several rules:
    • react-dom/no-missing-button-type
    • react-dom/no-missing-iframe-sandbox
    • react-dom/no-unsafe-target-blank
    • react/no-unstable-context-value
    • react/no-unstable-default-props
    • react/no-unused-class-component-members
    • react/no-unused-state

Question: Were these rules deprecated/removed from the plugin, or is this intentional? If intentional, it might be worth documenting why in the changeset.

🐛 Potential Issues

1. React Compiler Rules Namespace

The React Compiler rules are under react-hooks/* namespace (lines 129-143), but these seem like compiler-specific rules, not just hooks rules. Examples:

  • react-hooks/immutability
  • react-hooks/purity
  • react-hooks/static-components

Concern: This might be confusing for users. Are these actually part of eslint-plugin-react-hooks, or should they be in a different plugin namespace?

2. Missing Type Export

packages/eslint-config/src/types.ts:101-110 defines OptionsReact but I don't see it re-exported from the main index. Users may want to import this type.

3. Factory Logic (packages/eslint-config/src/factory.ts:179-187)

if (options.react ?? false) {
  configs.push(
    react({
      ...typescriptOptions,
      ...resolveSubOptions(options, 'react'),
      overrides: getOverrides(options, 'react'),
      tsconfigPath,
    }),
  );
}

The reactCompiler option from resolveSubOptions(options, 'react') is correctly spread, but there's a subtle issue: tsconfigPath is set after spreading typescriptOptions. Since resolveSubOptions returns an empty object for boolean values, this is fine. However, the ordering could be clearer.

🔒 Security

No security concerns identified. The code doesn't introduce any vulnerabilities.

Performance

  • The auto-detection using isPackageExists is called at config initialization time, not on every lint run, so performance impact is minimal
  • No blocking or expensive operations introduced

📝 Suggestions

  1. Documentation: Consider adding a README section or example showing how to use React Compiler support
  2. Testing: Are there tests for the conditional React Compiler rule activation?
  3. Preset Consistency: CONFIG_PRESET_FULL_OFF includes stylistic: false but CONFIG_PRESET_FULL_ON doesn't set it. Should FULL_ON explicitly set stylistic: true for consistency?
  4. Type Export: Export OptionsReact from the main package entry point if not already done

📊 Overall Assessment

This is a high-quality PR that adds valuable functionality. The code is clean, well-structured, and follows the project's conventions. The main questions are around:

  1. Whether the removed React rules were intentional
  2. Clarification on the React Compiler rules namespace

Recommendation: Approve with minor clarifications requested.


Review generated by Claude Code

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/eslint-config/src/utils/checks.ts (1)

3-27: Update JSDoc comment to match code.

The JSDoc comment at line 10 mentions VSCODE_CWD as one of the conditions, but line 22 shows it's no longer checked in the code. Update the comment to accurately reflect the current logic.

🔎 Proposed fix
 /**
  * Checks if the current environment is an editor environment.
  *
  * The following conditions are considered to be an editor environment:
  *
  * - The `CI` environment variable is not set.
  * - The `GIT_PARAMS` environment variable is not set.
- * - The `VSCODE_PID` or `VSCODE_CWD` environment variable is set.
+ * - The `VSCODE_PID` environment variable is set.
  * - The `JETBRAINS_IDE` environment variable is set.
  * - The `VIM` or `NVIM` environment variable is set.
  *
  * @returns `true` if the current environment is an editor environment, `false` otherwise.
  */
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 373ea08 and 43c991b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .changeset/1766399706-eslint-react-compiler.md
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/cli/versions-map.generated.ts
  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/typegen.d.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/utils/checks.ts
  • pnpm-workspace.yaml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/any-inside-generic-functions.mdc)

Using any is acceptable inside generic function bodies when TypeScript cannot match runtime logic to type logic, but should be used sparingly outside of generic functions

Do not use default exports unless explicitly required by the framework. Use named exports instead for TypeScript and TSX files.

**/*.{ts,tsx}: Use TypeScript for all code. Prefer interface over type for object shapes.
Follow the ESLint rules.
Use 'function' keyword for pure functions.
Follow file structure: Exported component, subcomponents, helpers, static content, types.
Avoid unnecessary curly braces in conditional statements.
For single-line statements in conditionals, omit curly braces.
Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()).
Handle errors and edge cases at the beginning of functions.
Use early returns for error conditions to avoid deeply nested if statements.
Place the happy path last in the function for improved readability.
Avoid unnecessary else statements; use if-return pattern instead.
Use guard clauses to handle preconditions and invalid states early.
Implement proper error logging and user-friendly error messages.
Consider using custom error types or error factories for consistent error handling.
Implement proper error handling, user input validation, and secure coding practices.
Provide clear and concise comments for complex logic.
Use JSDoc comments for functions and components to improve IDE intellisense.

**/*.{ts,tsx}: Proactively use discriminated unions to model data that can be in one of a few different shapes, such as when sending events between environments
Use switch statements to handle the results of discriminated unions by switching on the discriminator property
Use discriminated unions to prevent the 'bag of optionals' problem by modeling states as distinct union types rather than interfaces with optional fields

**/*.{ts,tsx}: Do not introduce new enums into the codebase. Retain existing enums.
I...

Files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/cli/versions-map.generated.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/utils/checks.ts
  • packages/eslint-config/src/typegen.d.ts
pnpm-workspace.yaml

📄 CodeRabbit inference engine (CLAUDE.md)

Configure pnpm workspaces in pnpm-workspace.yaml

Files:

  • pnpm-workspace.yaml
🧠 Learnings (38)
📓 Common learnings
Learnt from: mheob
Repo: mheob/config PR: 270
File: packages/eslint-config/package.json:39-78
Timestamp: 2025-05-28T11:00:09.943Z
Learning: The maintainer mheob is confident in managing non-major dependency updates for mheob/eslint-config and assesses compatibility before merging. They don't need detailed warnings about potential breaking changes in patch/minor version updates.
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for functions and components to improve IDE intellisense.
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to eslint.config.ts : Configure ESLint in eslint.config.ts at the root level

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-06-12T17:41:36.115Z
Learnt from: mheob
Repo: mheob/config PR: 276
File: packages/eslint-config/src/typegen.d.ts:2217-2223
Timestamp: 2025-06-12T17:41:36.115Z
Learning: The file `packages/eslint-config/src/typegen.d.ts` should be ignored in code reviews and related automated checks.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/utils/checks.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:46:01.626Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-11-26T17:46:01.626Z
Learning: Applies to **/*.{ts,tsx} : Use file extensions: `.config.ts`, `.test.ts`, `.context.tsx`, `.type.ts`, `.hook.ts` as appropriate

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:20.305Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Follow the ESLint rules.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:20.305Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for functions and components to improve IDE intellisense.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-06-24T23:14:43.211Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-exports.mdc:0-0
Timestamp: 2025-06-24T23:14:43.211Z
Learning: In TypeScript files (*.ts, *.tsx), prefer named exports over default exports to reduce confusion when importing functions or components, unless the framework (such as Next.js pages) explicitly requires a default export.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to prettier.config.mjs : Configure Prettier in prettier.config.mjs at the root level

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:50.911Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/jsdoc-comments.mdc:0-0
Timestamp: 2025-11-26T17:45:50.911Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments to annotate functions and types in TypeScript files

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/factory.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:32.304Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/enums.mdc:0-0
Timestamp: 2025-11-26T17:45:32.304Z
Learning: Applies to **/*.{ts,tsx} : Do not introduce new enums into the codebase. Retain existing enums.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
📚 Learning: 2025-06-24T23:14:59.895Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/import-type.mdc:0-0
Timestamp: 2025-06-24T23:14:59.895Z
Learning: In TypeScript files (*.ts, *.tsx), prefer using top-level 'import type' statements rather than inline 'import { type ... }' to avoid issues where type imports are not properly erased in certain environments.

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
📚 Learning: 2025-11-26T17:46:01.626Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-11-26T17:46:01.626Z
Learning: Applies to **/*.{ts,tsx} : Avoid magic numbers and define constants

Applied to files:

  • packages/eslint-config/src/config-presets.ts
  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:20.305Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript for all code. Prefer `interface` over `type` for object shapes.

Applied to files:

  • packages/eslint-config/src/types.ts
  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
📚 Learning: 2025-11-26T17:46:13.513Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/readonly-properties.mdc:0-0
Timestamp: 2025-11-26T17:46:13.513Z
Learning: Applies to **/*.{ts,tsx} : Use `readonly` properties for object types by default in TypeScript to prevent accidental mutation at runtime. Omit `readonly` only when the property is genuinely mutable.

Applied to files:

  • packages/eslint-config/src/types.ts
📚 Learning: 2025-06-24T23:15:06.053Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/jsdoc-comments.mdc:0-0
Timestamp: 2025-06-24T23:15:06.053Z
Learning: In TypeScript files (*.ts, *.tsx), JSDoc comments should be used to annotate functions and types, but only when the function's behavior is not self-evident. Comments should be concise and leverage the JSDoc inline link tag to reference other functions and types within the same file.

Applied to files:

  • packages/eslint-config/src/types.ts
📚 Learning: 2025-06-24T23:15:07.222Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/jsdoc-comments.mdc:0-0
Timestamp: 2025-06-24T23:15:07.222Z
Learning: In TypeScript files (*.ts, *.tsx), JSDoc comments should be used to annotate functions and types, but only when the function's behavior is not self-evident. Comments should be concise, and the JSDoc inline link tag can be used to reference other functions and types within the same file.

Applied to files:

  • packages/eslint-config/src/types.ts
📚 Learning: 2025-05-28T11:00:09.943Z
Learnt from: mheob
Repo: mheob/config PR: 270
File: packages/eslint-config/package.json:39-78
Timestamp: 2025-05-28T11:00:09.943Z
Learning: The maintainer mheob is confident in managing non-major dependency updates for mheob/eslint-config and assesses compatibility before merging. They don't need detailed warnings about potential breaking changes in patch/minor version updates.

Applied to files:

  • packages/eslint-config/src/cli/versions-map.generated.ts
  • pnpm-workspace.yaml
  • .changeset/1766399706-eslint-react-compiler.md
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to @(package.json|.github/workflows/*.yml) : Maintain Node version compatibility with ^22.12.0 or ^24.0.0

Applied to files:

  • packages/eslint-config/src/cli/versions-map.generated.ts
  • pnpm-workspace.yaml
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to pnpm-workspace.yaml : Configure pnpm workspaces in pnpm-workspace.yaml

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Use Turborepo with pnpm workspaces as the monorepo manager

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-24T23:15:00.345Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/installing-libraries.mdc:0-0
Timestamp: 2025-06-24T23:15:00.345Z
Learning: When installing libraries in JavaScript or TypeScript projects (such as those containing .ts or .tsx files), do not manually select package versions based on your own knowledge or training data, as it may be outdated. Instead, use a package manager command (such as 'pnpm add', 'yarn add', or 'npm install') to fetch and install the latest version of the library, ensuring up-to-date dependencies.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2024-12-11T10:36:23.225Z
Learnt from: mheob
Repo: mheob/config PR: 217
File: packages/eslint-config/package.json:69-70
Timestamp: 2024-12-11T10:36:23.225Z
Learning: In the `packages/eslint-config/package.json`, the project uses `svelte@^5.x.x (beta)`, and the user is comfortable using Svelte v5 (beta). Do not flag the usage of Svelte v5 (beta) as a potential issue in future code reviews for this project.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-26T17:45:36.509Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/import-type.mdc:0-0
Timestamp: 2025-11-26T17:45:36.509Z
Learning: Applies to **/*.{ts,tsx} : Use top-level `import type` syntax when importing TypeScript types (e.g., `import type { User } from './user'`). Avoid inline `import { type ... }` syntax to ensure type imports are properly erased during transpilation in all environments.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
  • packages/eslint-config/scripts/typegen.ts
📚 Learning: 2025-06-24T23:14:59.895Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/import-type.mdc:0-0
Timestamp: 2025-06-24T23:14:59.895Z
Learning: In TypeScript files (*.ts, *.tsx), always use 'import type' when importing types to ensure that type-only imports are erased during transpilation and do not result in runtime side effects.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-11-26T17:45:25.749Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/discriminated-unions.mdc:0-0
Timestamp: 2025-11-26T17:45:25.749Z
Learning: Applies to **/*.{ts,tsx} : Use discriminated unions to prevent the 'bag of optionals' problem by modeling states as distinct union types rather than interfaces with optional fields

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-06-24T23:15:13.022Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-06-24T23:15:13.022Z
Learning: In TypeScript files (*.ts, *.tsx), avoid magic numbers by defining constants instead.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-11-26T17:45:25.749Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/discriminated-unions.mdc:0-0
Timestamp: 2025-11-26T17:45:25.749Z
Learning: Applies to **/*.{ts,tsx} : Proactively use discriminated unions to model data that can be in one of a few different shapes, such as when sending events between environments

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-06-24T23:14:50.420Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/discriminated-unions.mdc:0-0
Timestamp: 2025-06-24T23:14:50.420Z
Learning: In TypeScript files (*.ts, *.tsx), discriminated unions should be used to model data that can take on a limited set of distinct shapes, as this prevents impossible states and improves type safety.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-06-24T23:14:52.716Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/discriminated-unions.mdc:0-0
Timestamp: 2025-06-24T23:14:52.716Z
Learning: In TypeScript files (*.ts, *.tsx), discriminated unions are preferred for modeling data that can take on several distinct shapes, as they provide type safety and prevent impossible states.

Applied to files:

  • packages/eslint-config/src/configs/react.ts
📚 Learning: 2025-01-21T15:28:16.959Z
Learnt from: mheob
Repo: mheob/config PR: 223
File: packages/eslint-config/src/typegen.d.ts:2973-2977
Timestamp: 2025-01-21T15:28:16.959Z
Learning: Auto-generated files like typegen.d.ts may contain seemingly duplicate or overlapping rules/definitions which should not be flagged as issues since they are machine-generated and not meant to be manually modified.

Applied to files:

  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-01-21T15:28:22.683Z
Learnt from: mheob
Repo: mheob/config PR: 223
File: packages/eslint-config/src/typegen.d.ts:680-682
Timestamp: 2025-01-21T15:28:22.683Z
Learning: For generated source files (like typegen.d.ts), it's acceptable to keep deprecated rules/content since modifications should be made to the generation source rather than the generated files directly.

Applied to files:

  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-06-24T23:14:47.194Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-06-24T23:14:47.194Z
Learning: In TypeScript codebases (files matching **/*.{ts,tsx}), optimize performance by reducing load times and improving rendering efficiency.

Applied to files:

  • packages/eslint-config/scripts/typegen.ts
📚 Learning: 2025-11-26T17:45:20.305Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-11-26T17:45:20.305Z
Learning: Applies to **/*.{ts,tsx} : Follow file structure: Exported component, subcomponents, helpers, static content, types.

Applied to files:

  • packages/eslint-config/scripts/typegen.ts
  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to @(.husky/**|package.json) : Use Husky for pre-commit git hooks

Applied to files:

  • packages/eslint-config/src/utils/checks.ts
📚 Learning: 2025-06-24T23:14:47.194Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-06-24T23:14:47.194Z
Learning: In TypeScript codebases (files matching **/*.{ts,tsx}), provide clear and concise comments for complex logic, and use JSDoc comments for functions and components to improve IDE intellisense.

Applied to files:

  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:45:10.940Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/default-exports.mdc:0-0
Timestamp: 2025-11-26T17:45:10.940Z
Learning: Applies to **/*.{ts,tsx} : Do not use default exports unless explicitly required by the framework. Use named exports instead for TypeScript and TSX files.

Applied to files:

  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-12-06T10:42:43.743Z
Learnt from: CR
Repo: mheob/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-06T10:42:43.743Z
Learning: Applies to commitlint.config.js : Configure commitlint in commitlint.config.js at the root level

Applied to files:

  • packages/eslint-config/src/typegen.d.ts
📚 Learning: 2025-11-26T17:46:01.626Z
Learnt from: CR
Repo: mheob/config PR: 0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-11-26T17:46:01.626Z
Learning: Applies to **/*.{ts,tsx} : Use ALL_CAPS (CONSTANT_CASE) for constants and enum values (e.g., `MAX_COUNT`, `Color.RED`)

Applied to files:

  • packages/eslint-config/src/typegen.d.ts
🧬 Code graph analysis (5)
packages/eslint-config/src/config-presets.ts (1)
packages/eslint-config/src/types.ts (1)
  • OptionsConfig (112-320)
packages/eslint-config/src/cli/versions-map.generated.ts (2)
packages/eslint-config/src/cli/stages/update-package-json.ts (1)
  • updatePackageJson (22-54)
packages/eslint-config/src/configs/nextjs.ts (1)
  • nextjs (22-63)
packages/eslint-config/scripts/typegen.ts (2)
packages/eslint-config/src/factory.ts (1)
  • mheob (95-294)
packages/eslint-config/src/config-presets.ts (1)
  • CONFIG_PRESET_FULL_ON (3-26)
packages/eslint-config/src/factory.ts (2)
packages/eslint-config/src/configs/jsdoc.ts (1)
  • jsdoc (15-40)
packages/eslint-config/src/configs/node.ts (1)
  • node (15-34)
packages/eslint-config/src/typegen.d.ts (1)
packages/eslint-config/src/types.ts (1)
  • ConfigNames (8-8)
🔇 Additional comments (21)
packages/eslint-config/src/cli/versions-map.generated.ts (1)

2-8: LGTM! Dependency versions updated appropriately.

The minor and patch version updates align with the PR's goal to update dependencies for React Compiler support.

pnpm-workspace.yaml (2)

13-71: LGTM! Catalog dependencies updated.

The dependency version updates are consistent with the PR objectives to support React Compiler and update tooling dependencies.


78-80: New section added for binary dependencies.

The onlyBuiltDependencies section explicitly lists dependencies that require native builds (esbuild, unrs-resolver), which can help with reproducible builds and clarify binary dependency handling.

.changeset/1766399706-eslint-react-compiler.md (1)

1-11: LGTM! Changeset properly documents the release.

The changeset accurately summarizes the key changes: React Compiler support, config presets, optional jsdoc/node options, and dependency updates.

packages/eslint-config/src/factory.ts (3)

151-153: LGTM! JSDoc rules now optional with sensible default.

Making JSDoc rules optional with a default of true maintains backward compatibility while providing flexibility for users who don't want JSDoc enforcement.


175-177: LGTM! Node rules now optional with sensible default.

Making Node.js rules optional with a default of true provides flexibility while maintaining backward compatibility.


179-188: LGTM! React config now supports sub-options.

The spread of resolveSubOptions(options, 'react') enables the new OptionsReact interface to pass through React-specific configuration like reactCompiler, aligning with the PR's goal to add React Compiler support.

packages/eslint-config/src/config-presets.ts (2)

3-26: LGTM! Comprehensive preset for full feature enablement.

CONFIG_PRESET_FULL_ON provides a convenient way to enable all features including React Compiler support, which is useful for testing and quick configuration setup.


28-48: LGTM! Comprehensive preset for feature disablement.

CONFIG_PRESET_FULL_OFF provides a clean starting point for users who want to selectively enable only specific features.

packages/eslint-config/scripts/typegen.ts (1)

6-15: LGTM! Cleaner type generation approach.

The refactoring to use mheob(CONFIG_PRESET_FULL_ON) simplifies the type generation process and aligns with the new preset-based configuration system. This ensures all rules and config names are captured for type generation.

packages/eslint-config/src/types.ts (4)

94-110: LGTM! Well-documented React configuration interface.

The new OptionsReact interface properly extends OptionsOverrides and introduces the reactCompiler option to support React Compiler rules. The JSDoc comments are clear and concise.


173-178: LGTM! JSDoc option added with sensible default.

The jsdoc boolean option enables opt-out behavior for JSDoc rules while maintaining backward compatibility with a default of true.


215-220: LGTM! Node.js option added with sensible default.

The node boolean option enables opt-out behavior for Node.js rules while maintaining backward compatibility with a default of true.


237-237: LGTM! React option now supports extended configuration.

Changing from boolean | OptionsOverrides to boolean | OptionsReact enables React-specific configuration options like reactCompiler while maintaining backward compatibility with boolean values.

packages/eslint-config/src/configs/react.ts (6)

4-10: LGTM!

The type imports follow the coding guideline to use top-level import type syntax for TypeScript types.


23-23: LGTM!

The constant follows the established pattern for package detection arrays in this file.


37-44: LGTM!

The auto-detection default for reactCompiler follows the established pattern used elsewhere in this file (e.g., isAllowConstantExport, isUsingRemix). This provides sensible defaults while still allowing explicit opt-in/opt-out via the OptionsReact type.


214-219: LGTM!

Upgrading these rules from warn to error is appropriate—duplicate keys cause reconciliation issues, and nested lazy component declarations lead to unexpected remounts. Both represent correctness concerns.


126-145: No action needed. These are legitimate React Compiler rules officially integrated into eslint-plugin-react-hooks and properly configured with the correct severity levels.


194-194: Rule react/jsx-key-before-spread is valid and correctly configured.

The rule exists in @eslint-react/eslint-plugin (version ^2.3.13). The plugin is registered as react in the configuration (line 76), so the rule ID uses the react/ prefix correctly. This rule enforces that a JSX element's key prop appears before any spread props, ensuring the JSX automatic runtime receives the key correctly.

packages/eslint-config/src/typegen.d.ts (1)

911-919: Skipping review of auto-generated file.

Based on learnings, this file (typegen.d.ts) is auto-generated and should be ignored in code reviews. Any modifications should be made to the generation source rather than this file directly.

@kodiakhq kodiakhq bot merged commit c00e853 into main Dec 22, 2025
10 checks passed
@kodiakhq kodiakhq bot deleted the update-deps branch December 22, 2025 10:52
kodiakhq bot pushed a commit that referenced this pull request Dec 22, 2025
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.


# Releases
## @mheob/eslint-config@9.2.0

### Minor Changes

-   [#336](#336) ([@mheob](https://github.com/mheob)): Add React Compiler support and config presets
    -   Add React Compiler rules with conditional activation
    -   Add config presets (CONFIG_PRESET_FULL_ON and CONFIG_PRESET_FULL_OFF)
    -   Make jsdoc and node options optional (default true)
    -   Update React rule severities
    -   Update dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deps 📦 eslint 🚨 Belongs to ESLint config

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants