Skip to content

fix: support ESLint 10 flat config in build hook - #25

Draft
Cherry7593 wants to merge 1 commit into
react-component:mainfrom
Cherry7593:codex/eslint10-flat-config
Draft

fix: support ESLint 10 flat config in build hook#25
Cherry7593 wants to merge 1 commit into
react-component:mainfrom
Cherry7593:codex/eslint10-flat-config

Conversation

@Cherry7593

Copy link
Copy Markdown

What changed

Remove the obsolete --ext .tsx,.ts CLI option from the build hook's ESLint invocation.

Why

The current package uses ESLint 10 flat config, where --ext is no longer accepted. This makes consuming rc-component package builds fail before Father compilation.

The target directory and dynamically injected @typescript-eslint/consistent-type-exports / restricted internal import rules remain unchanged.

Validation

  • father-plugin lint passed
  • father-plugin Father build passed
  • pristine rc-image lint, TypeScript 6 typecheck, 80 tests, ESM/CJS/declaration/Less build and package output passed
  • an intentional @rc-component/motion/es import was still rejected and failed the consumer build

No runtime API changes.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

鈿欙笍 Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9adc8c8b-1515-4b97-bc8b-071d72bfa75a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 馃攳 Trigger review

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.

@nrps9909 nrps9909 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This fixes the ESLint 10 flat-config flag error, but it regresses every consumer still using legacy config: without --ext, ESLint 8 does not discover .ts/.tsx files when given a directory. I reproduced this on exact head 1c7568b0066259b0cfafc1bcc37c80f4f36a1cbd with a fixture containing only src/example.ts: ESLINT_USE_FLAT_CONFIG=false npx eslint@8.57.1 src --no-ignore --rule '{"no-unused-vars":"error"}' exits 2 with No files matching the pattern "src" were found, while the same command with --ext .ts finds the file and reports the expected lint error. Please preserve TS discovery for legacy consumers while supporting flat config鈥攅.g. choose flags based on config/version, or use an explicitly quoted TS/TSX file pattern that is verified on Windows and both config systems. A regression test covering legacy and flat-config discovery would make this safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants