Skip to content

Conversation

@lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Sep 23, 2025

Prerequisites checklist

What is the purpose of this pull request?

In this PR, I've replaced the findOffsets utility helper function with the native getLocFromIndex that was recently added in #167.

As a result of this cleanup, the code has been simplified.

I've used the d flag for the importantPattern regex to improve readability and make the intention clearer.

There might be a cleaner solution; if so, I'd be happy to take a look.

What changes did you make? (Give an overview)

In this PR, I've replaced the findOffsets utility helper function with the native getLocFromIndex that was recently added in #167.

Related Issues

Refs: #167, eslint/rewrite#212

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

N/A

@lumirlumir lumirlumir marked this pull request as ready for review September 25, 2025 11:19
@lumirlumir lumirlumir requested review from a team and mdjermanovic September 25, 2025 11:19
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Net 62 lines reduced, all tests still passing, very nice 👌

Someone who's more deeply familiar with CSS than me should still review. But this is very lovely to see!

@JoshuaKGoldberg JoshuaKGoldberg moved this from Needs Triage to Second Review Needed in Triage Sep 25, 2025
@lumirlumir lumirlumir added the accepted There is consensus among the team that this change meets the criteria for inclusion label Sep 26, 2025
@lumirlumir
Copy link
Member Author

I've updated this PR in 1449877 to apply the feedback from eslint/markdown#541.

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.

LGTM. Thanks!

@nzakas nzakas merged commit 8047f1e into main Sep 29, 2025
22 checks passed
@nzakas nzakas deleted the refactor-replace-findoffset-helper-with-native-methods branch September 29, 2025 14:07
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion chore

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

4 participants