fix: support ESLint 10 flat config in build hook - #25
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
nrps9909
left a comment
There was a problem hiding this comment.
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—e.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.
What changed
Remove the obsolete
--ext .tsx,.tsCLI option from the build hook's ESLint invocation.Why
The current package uses ESLint 10 flat config, where
--extis 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
@rc-component/motion/esimport was still rejected and failed the consumer buildNo runtime API changes.