-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(eslint): add React Compiler support #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 43c991b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
WalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/any-inside-generic-functions.mdc)
Files:
pnpm-workspace.yaml📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (38)📓 Common learnings📚 Learning: 2025-12-06T10:42:43.743ZApplied to files:
📚 Learning: 2025-06-12T17:41:36.115ZApplied to files:
📚 Learning: 2025-11-26T17:46:01.626ZApplied to files:
📚 Learning: 2025-11-26T17:45:20.305ZApplied to files:
📚 Learning: 2025-11-26T17:45:20.305ZApplied to files:
📚 Learning: 2025-06-24T23:14:43.211ZApplied to files:
📚 Learning: 2025-12-06T10:42:43.743ZApplied to files:
📚 Learning: 2025-11-26T17:45:50.911ZApplied to files:
📚 Learning: 2025-11-26T17:45:32.304ZApplied to files:
📚 Learning: 2025-06-24T23:14:59.895ZApplied to files:
📚 Learning: 2025-11-26T17:46:01.626ZApplied to files:
📚 Learning: 2025-11-26T17:45:20.305ZApplied to files:
📚 Learning: 2025-11-26T17:46:13.513ZApplied to files:
📚 Learning: 2025-06-24T23:15:06.053ZApplied to files:
📚 Learning: 2025-06-24T23:15:07.222ZApplied to files:
📚 Learning: 2025-05-28T11:00:09.943ZApplied to files:
📚 Learning: 2025-12-06T10:42:43.743ZApplied to files:
📚 Learning: 2025-12-06T10:42:43.743ZApplied to files:
📚 Learning: 2025-12-06T10:42:43.743ZApplied to files:
📚 Learning: 2025-06-24T23:15:00.345ZApplied to files:
📚 Learning: 2024-12-11T10:36:23.225ZApplied to files:
📚 Learning: 2025-11-26T17:45:36.509ZApplied to files:
📚 Learning: 2025-06-24T23:14:59.895ZApplied to files:
📚 Learning: 2025-11-26T17:45:25.749ZApplied to files:
📚 Learning: 2025-06-24T23:15:13.022ZApplied to files:
📚 Learning: 2025-11-26T17:45:25.749ZApplied to files:
📚 Learning: 2025-06-24T23:14:50.420ZApplied to files:
📚 Learning: 2025-06-24T23:14:52.716ZApplied to files:
📚 Learning: 2025-01-21T15:28:16.959ZApplied to files:
📚 Learning: 2025-01-21T15:28:22.683ZApplied to files:
📚 Learning: 2025-06-24T23:14:47.194ZApplied to files:
📚 Learning: 2025-11-26T17:45:20.305ZApplied to files:
📚 Learning: 2025-12-06T10:42:43.743ZApplied to files:
📚 Learning: 2025-06-24T23:14:47.194ZApplied to files:
📚 Learning: 2025-11-26T17:45:10.940ZApplied to files:
📚 Learning: 2025-12-06T10:42:43.743ZApplied to files:
📚 Learning: 2025-11-26T17:46:01.626ZApplied to files:
🧬 Code graph analysis (5)packages/eslint-config/src/config-presets.ts (1)
packages/eslint-config/src/cli/versions-map.generated.ts (2)
packages/eslint-config/scripts/typegen.ts (2)
packages/eslint-config/src/factory.ts (2)
packages/eslint-config/src/typegen.d.ts (1)
🔇 Additional comments (21)
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. Comment |
|
Pull Request Review: React Compiler SupportThank you for this well-structured PR! Here's my detailed review: ✅ Strengths
🔍 Code Quality ObservationsExcellent
Typegen Script Refactoring (packages/eslint-config/scripts/typegen.ts)The simplification from manually importing 25+ configs to using
React Rules Updates (packages/eslint-config/src/configs/react.ts)The rule changes look reasonable:
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 Issues1. React Compiler Rules NamespaceThe React Compiler rules are under
Concern: This might be confusing for users. Are these actually part of 2. Missing Type Exportpackages/eslint-config/src/types.ts:101-110 defines 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 🔒 SecurityNo security concerns identified. The code doesn't introduce any vulnerabilities. ⚡ Performance
📝 Suggestions
📊 Overall AssessmentThis 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:
Recommendation: Approve with minor clarifications requested. Review generated by Claude Code |
There was a problem hiding this 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_CWDas 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
.changeset/1766399706-eslint-react-compiler.mdpackages/eslint-config/scripts/typegen.tspackages/eslint-config/src/cli/versions-map.generated.tspackages/eslint-config/src/config-presets.tspackages/eslint-config/src/configs/react.tspackages/eslint-config/src/factory.tspackages/eslint-config/src/typegen.d.tspackages/eslint-config/src/types.tspackages/eslint-config/src/utils/checks.tspnpm-workspace.yaml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/any-inside-generic-functions.mdc)
Using
anyis acceptable inside generic function bodies when TypeScript cannot match runtime logic to type logic, but should be used sparingly outside of generic functionsDo 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. Preferinterfaceovertypefor 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.tspackages/eslint-config/src/types.tspackages/eslint-config/src/cli/versions-map.generated.tspackages/eslint-config/src/configs/react.tspackages/eslint-config/scripts/typegen.tspackages/eslint-config/src/factory.tspackages/eslint-config/src/utils/checks.tspackages/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.tspackages/eslint-config/src/types.tspackages/eslint-config/src/configs/react.tspackages/eslint-config/scripts/typegen.tspackages/eslint-config/src/factory.tspackages/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.tspackages/eslint-config/src/types.tspackages/eslint-config/src/configs/react.tspackages/eslint-config/scripts/typegen.tspackages/eslint-config/src/factory.tspackages/eslint-config/src/utils/checks.tspackages/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.tspackages/eslint-config/src/types.tspackages/eslint-config/src/configs/react.tspackages/eslint-config/scripts/typegen.tspackages/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.tspackages/eslint-config/src/types.tspackages/eslint-config/src/configs/react.tspackages/eslint-config/scripts/typegen.tspackages/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.tspackages/eslint-config/src/types.tspackages/eslint-config/src/configs/react.tspackages/eslint-config/src/factory.tspackages/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.tspackages/eslint-config/src/types.tspackages/eslint-config/scripts/typegen.tspackages/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.tspackages/eslint-config/src/types.tspackages/eslint-config/src/factory.tspackages/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.tspackages/eslint-config/src/configs/react.tspackages/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.tspackages/eslint-config/scripts/typegen.tspackages/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.tspackages/eslint-config/src/configs/react.tspackages/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.tspnpm-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.tspnpm-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.tspackages/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.tspackages/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.tspackages/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.tspackages/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
onlyBuiltDependenciessection 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
truemaintains 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
trueprovides flexibility while maintaining backward compatibility.
179-188: LGTM! React config now supports sub-options.The spread of
resolveSubOptions(options, 'react')enables the newOptionsReactinterface to pass through React-specific configuration likereactCompiler, 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_ONprovides 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_OFFprovides 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
OptionsReactinterface properly extendsOptionsOverridesand introduces thereactCompileroption to support React Compiler rules. The JSDoc comments are clear and concise.
173-178: LGTM! JSDoc option added with sensible default.The
jsdocboolean option enables opt-out behavior for JSDoc rules while maintaining backward compatibility with a default oftrue.
215-220: LGTM! Node.js option added with sensible default.The
nodeboolean option enables opt-out behavior for Node.js rules while maintaining backward compatibility with a default oftrue.
237-237: LGTM! React option now supports extended configuration.Changing from
boolean | OptionsOverridestoboolean | OptionsReactenables React-specific configuration options likereactCompilerwhile 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 typesyntax 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
reactCompilerfollows 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 theOptionsReacttype.
214-219: LGTM!Upgrading these rules from
warntoerroris 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: Rulereact/jsx-key-before-spreadis valid and correctly configured.The rule exists in
@eslint-react/eslint-plugin(version ^2.3.13). The plugin is registered asreactin the configuration (line 76), so the rule ID uses thereact/prefix correctly. This rule enforces that a JSX element'skeyprop 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.
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



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
babel-plugin-react-compileris detected in the projectCONFIG_PRESET_FULL_ONandCONFIG_PRESET_FULL_OFFpresets for quick configurationjsdocandnodeoptions optional (default:true) to provide more flexibilityMotivation
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
Improvements
Dependencies
✏️ Tip: You can customize this high-level summary in your review settings.