Skip to content

Conversation

lumirlumir
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request?

Hi,

In this PR, I've refactored the no-reversed-media-syntax rule, thanks to #469 (review).

Previously, we used a separate traversing logic with the findSkipRanges helper function. This was somewhat redundant, since ESLint already traverses the AST for us, resulting in duplicate traversing.

I've updated the code to use an ESQuery selector instead, which simplifies the traversing logic.

I've also used the getRange method to make the rule more native and switched to the SourceRange data structure for better consistency.

What changes did you make? (Give an overview)

In this PR, I've refactored the no-reversed-media-syntax rule, thanks to #469 (review).

Related Issues

Ref: #469 (review)

Is there anything you'd like reviewers to focus on?

@eslintbot eslintbot added this to Triage Aug 6, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Aug 6, 2025
Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Leaving it open for @nzakas to verify.

@lumirlumir lumirlumir moved this from Needs Triage to Second Review Needed in Triage Aug 10, 2025
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

Nice work!

@nzakas nzakas merged commit 78b1ac6 into main Aug 11, 2025
24 checks passed
@nzakas nzakas deleted the refactor-simplify-no-reversed-media-syntax-using-esquery-selector branch August 11, 2025 14:52
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

3 participants