mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
### TL;DR Added a `should_run` function to multiple lint rules to determine if a rule should be executed based on the source type. This change optimizes the linting process by avoiding unnecessary rule checks. ### What changed? 1. **New Method**: Introduced the `should_run` method in the `Rule` trait. 2. **Implementation**: Implemented the `should_run` method for various lint rules, particularly those related to React and TypeScript. 3. **Usage**: Updated the `Linter` to use the `should_run` method to filter rules before execution. 4. **Macro Update**: Modified the `declare_all_lint_rules` macro to incorporate the `should_run` method. ### How to test? 1. Run the linter on a project containing React and TypeScript files. 2. Verify that only relevant rules are executed based on the file type (e.g., JSX rules for React files). ### Why make this change? This change improves the performance of the linter by ensuring that only applicable rules are run for a given file type, reducing unnecessary computation and potential false positives. --- |
||
|---|---|---|
| .. | ||
| oxc | ||
| oxc_allocator | ||
| oxc_ast | ||
| oxc_ast_macros | ||
| oxc_cfg | ||
| oxc_codegen | ||
| oxc_diagnostics | ||
| oxc_index | ||
| oxc_isolated_declarations | ||
| oxc_js_regex | ||
| oxc_language_server | ||
| oxc_linter | ||
| oxc_macros | ||
| oxc_mangler | ||
| oxc_minifier | ||
| oxc_module_lexer | ||
| oxc_parser | ||
| oxc_prettier | ||
| oxc_semantic | ||
| oxc_sourcemap | ||
| oxc_span | ||
| oxc_syntax | ||
| oxc_transformer | ||
| oxc_traverse | ||
| oxc_wasm | ||