mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +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. --- |
||
|---|---|---|
| .. | ||
| examples | ||
| fixtures | ||
| src | ||
| tests | ||
| Cargo.toml | ||
| CHANGELOG.md | ||