Skip to content

feat(linter): add suggestion fix for unicorn/require-module-attributes#17168

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/12-20-feat_linter_add_suggestion_fix_for_unicorn_require-module-attributes
Dec 20, 2025
Merged

feat(linter): add suggestion fix for unicorn/require-module-attributes#17168
graphite-app[bot] merged 1 commit intomainfrom
c/12-20-feat_linter_add_suggestion_fix_for_unicorn_require-module-attributes

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Dec 20, 2025

No description provided.

@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Dec 20, 2025
Copy link
Contributor Author

camc314 commented Dec 20, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camc314 camc314 force-pushed the c/12-20-feat_linter_add_suggestion_fix_for_unicorn_require-module-attributes branch from 902e292 to bc27fab Compare December 20, 2025 12:33
@camc314 camc314 self-assigned this Dec 20, 2025
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 20, 2025
@camc314 camc314 marked this pull request as ready for review December 20, 2025 12:34
Copilot AI review requested due to automatic review settings December 20, 2025 12:34
Copy link
Contributor Author

camc314 commented Dec 20, 2025

Merge activity

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 adds auto-fix suggestions to the unicorn/require-module-attributes linter rule, enabling automatic removal of empty import/export attribute lists. The rule now provides actionable fixes instead of just reporting violations.

Key Changes

  • Upgraded rule category from pending to suggestion to reflect the new fix capability
  • Added fix logic for both import/export statements with empty with {} clauses and import expressions with empty or empty-with property objects
  • Added comprehensive test cases covering various scenarios including trailing commas, comments, and property positioning

Reviewed changes

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

File Description
crates/oxc_linter/src/rules/unicorn/require_module_attributes.rs Implements auto-fix logic for removing empty attribute lists, adds helper function for property removal, includes comprehensive test cases
crates/oxc_linter/src/snapshots/unicorn_require_module_attributes.snap Updates snapshot to include help messages for all diagnostic instances

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 20, 2025

CodSpeed Performance Report

Merging #17168 will not alter performance

Comparing c/12-20-feat_linter_add_suggestion_fix_for_unicorn_require-module-attributes (bc27fab) with main (16d9dc2)

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 force-pushed the c/12-20-feat_linter_add_suggestion_fix_for_unicorn_require-module-attributes branch 2 times, most recently from a7e6e6c to 553a391 Compare December 20, 2025 12:44
@graphite-app graphite-app bot force-pushed the c/12-20-feat_linter_add_suggestion_fix_for_unicorn_require-module-attributes branch from 553a391 to ffc1674 Compare December 20, 2025 12:50
@graphite-app graphite-app bot merged commit ffc1674 into main Dec 20, 2025
20 checks passed
@graphite-app graphite-app bot deleted the c/12-20-feat_linter_add_suggestion_fix_for_unicorn_require-module-attributes branch December 20, 2025 12:55
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants