refactor(linter): Simplify DefaultRuleConfig usage so we always pass Self to it.#17478
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the linter codebase to use Self instead of explicit type names when passing types to DefaultRuleConfig. This is a purely mechanical change that simplifies the from_configuration implementations across all lint rules.
Key changes:
- Replaced
DefaultRuleConfig<ExplicitTypeName>withDefaultRuleConfig<Self>in allfrom_configurationmethod implementations - Updated the documentation example in
rule.rsto reflect the new pattern
Reviewed changes
Copilot reviewed 149 out of 149 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_linter/src/rule.rs | Updated documentation example to use DefaultRuleConfig<Self> instead of explicit type name |
| All rule files (140+ files) | Replaced explicit type names with Self in DefaultRuleConfig type parameter across vue, unicorn, typescript, react, promise, oxc, node, jsx_a11y, jsdoc, jest, import, and eslint rule modules |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17478 will not alter performanceComparing Summary
Footnotes
|
Self to it.Self to it.
Merge activity
|
…`Self` to it. (#17478) Good ol' find-and-replace :)
505e41e to
3c7ad0a
Compare
…lt` (#17479) Built on top of #17478. Based on the changes I experimented with in #17199, and the suggestion given by camc in that PR. AI Disclosure: This was done almost entirely via find+replace and manual updates to fix individual rules. I did use AI for the change in 0abc981 since I had trouble figuring out a solution for that. It may be easier to review this by going through it commit-by-commit. Ran ecosystem CI on this branch and it looks like it works fine, no new regressions https://github.com/oxc-project/oxc-ecosystem-ci/actions/runs/20590908980 --------- Co-authored-by: Cameron Clark <[email protected]>
Good ol' find-and-replace :)