-
-
Notifications
You must be signed in to change notification settings - Fork 862
Open
Labels
A-linterArea - LinterArea - LinterA-linter-pluginsArea - Linter JS pluginsArea - Linter JS pluginsC-enhancementCategory - New feature or requestCategory - New feature or request
Description
@vitejs/plugin-react has implemented a heuristic for skipping React Compiler rules for certain files.
We could apply the same logic in Oxlint.
Open questions
How do we implement this heuristic?
@vitejs/plugin-react searches the source text for certain strings. We could potentially implement via a different route.
Oxlint already walks the AST. We could pattern match on AST nodes instead of source text search. Would that be faster?
How to integrate with Oxlint?
- Special case logic which recognises (how?) that user is using React Compiler rules as a JS plugin, and adds skip logic before it.
- Make React compiler rules a "first class citizen" of Oxlint. Implementation would run React Compiler rules as a JS plugin, but that's an implementation detail which is transparent to the user (except that we warn them that it's slow).
Personally I favour the 2nd approach. It gives us more scope to improve it in future if we "own" it - in particular, we could find ways to improve perf.
Related: #10048
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - LinterA-linter-pluginsArea - Linter JS pluginsArea - Linter JS pluginsC-enhancementCategory - New feature or requestCategory - New feature or request