Skip to content

refactor(linter): Simplify DefaultRuleConfig usage so we always pass Self to it.#17478

Merged
graphite-app[bot] merged 1 commit intomainfrom
pass-self-to-default-rule-config
Dec 30, 2025
Merged

refactor(linter): Simplify DefaultRuleConfig usage so we always pass Self to it.#17478
graphite-app[bot] merged 1 commit intomainfrom
pass-self-to-default-rule-config

Conversation

@connorshea
Copy link
Member

Good ol' find-and-replace :)

Copilot AI review requested due to automatic review settings December 30, 2025 05:19
@connorshea connorshea requested a review from camc314 as a code owner December 30, 2025 05:19
@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Dec 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> with DefaultRuleConfig<Self> in all from_configuration method implementations
  • Updated the documentation example in rule.rs to 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-hq
Copy link

codspeed-hq bot commented Dec 30, 2025

CodSpeed Performance Report

Merging #17478 will not alter performance

Comparing pass-self-to-default-rule-config (505e41e) with main (3536c65)

Summary

✅ 4 untouched
⏩ 41 skipped1

Footnotes

  1. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 changed the title chore(linter): Simplify DefaultRuleConfig usage so we always pass Self to it. refactor(linter): Simplify DefaultRuleConfig usage so we always pass Self to it. Dec 30, 2025
@camc314 camc314 self-assigned this Dec 30, 2025
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 30, 2025
Copy link
Contributor

camc314 commented Dec 30, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the pass-self-to-default-rule-config branch from 505e41e to 3c7ad0a Compare December 30, 2025 11:07
@graphite-app graphite-app bot merged commit 3c7ad0a into main Dec 30, 2025
20 checks passed
@graphite-app graphite-app bot deleted the pass-self-to-default-rule-config branch December 30, 2025 11:12
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 30, 2025
camc314 added a commit that referenced this pull request Dec 30, 2025
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments