-
-
Notifications
You must be signed in to change notification settings - Fork 32
refactor: replace findOffsets helper with native methods
#272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: replace findOffsets helper with native methods
#272
Conversation
JoshuaKGoldberg
left a comment
There was a problem hiding this 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!
… of https://github.com/eslint/css into refactor-replace-findoffset-helper-with-native-methods
|
I've updated this PR in 1449877 to apply the feedback from eslint/markdown#541. |
nzakas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Prerequisites checklist
What is the purpose of this pull request?
In this PR, I've replaced the
findOffsetsutility helper function with the nativegetLocFromIndexthat was recently added in #167.As a result of this cleanup, the code has been simplified.
I've used the
dflag for theimportantPatternregex 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
findOffsetsutility helper function with the nativegetLocFromIndexthat was recently added in #167.Related Issues
Refs: #167, eslint/rewrite#212
Is there anything you'd like reviewers to focus on?
N/A