Skip to content

Conversation

@lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Oct 23, 2025

Follow up to #14912. unalias_plugin_name doesn't need a second parameter. It was kept that way to keep the review diff small.

Copilot AI review requested due to automatic review settings October 23, 2025 12:14
@lilnasy lilnasy requested a review from camc314 as a code owner October 23, 2025 12:14
@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Oct 23, 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 simplifies the unalias_plugin_name function by removing its second parameter and changing its return type from a tuple to a string slice, making the function more focused and easier to use.

Key changes:

  • unalias_plugin_name now returns only the plugin name as &str instead of a tuple
  • Callers handle rule name processing independently
  • Special case handling for @next plugin moved to caller

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_linter/src/config/rules.rs Refactored unalias_plugin_name to return only the plugin name and updated parse_rule_key to handle rule name separately
crates/oxc_linter/src/config/config_builder.rs Updated call sites to only destructure the plugin name from unalias_plugin_name

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

);
};
unalias_plugin_name(plugin_name, rule_name)
(unalias_plugin_name(plugin_name).to_string(), rule_name.to_string())
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

The special handling for @next plugin's rule name (trimming 'next/' prefix) has been lost. Previously, @next rules had their names processed with rule_name.trim_start_matches(\"next/\"). This logic needs to be preserved in parse_rule_key for correct rule name resolution.

Suggested change
(unalias_plugin_name(plugin_name).to_string(), rule_name.to_string())
if plugin_name == "@next" {
(unalias_plugin_name(plugin_name).to_string(), rule_name.trim_start_matches("next/").to_string())
} else {
(unalias_plugin_name(plugin_name).to_string(), rule_name.to_string())
}

Copilot uses AI. Check for mistakes.
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 23, 2025

CodSpeed Performance Report

Merging #14921 will not alter performance

Comparing lilnasy:refactor-unalias (8ffebe6) with main (bd74603)

Summary

✅ 4 untouched
⏩ 33 skipped1

Footnotes

  1. 33 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.

@lilnasy lilnasy closed this Oct 23, 2025
@lilnasy lilnasy deleted the refactor-unalias branch October 23, 2025 12:21
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.

1 participant