-
Notifications
You must be signed in to change notification settings - Fork 95
Conversation
15626a8
to
c538e04
Compare
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.
Some early comments/questions
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.
Straight fire 🔥
|
||
module ThemeCheck | ||
module RegexHelpers | ||
def matches(s, re) |
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.
IIUC what this code does, you're looking for String#scan
: https://ruby-doc.org/core-3.0.0/String.html#method-i-scan
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.
I really want the MatchData since I'm using match.begin(:src)
to get the index of the src inside the string. And scan gives me strings IIRC.
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.
You can use https://ruby-doc.org/core-3.0.0/Regexp.html#method-c-last_match
. But you have to use scan
w/ a block.
Related #189 (part 1: JS)
Add an AssetSizeJavaScript check + docs. The goal being to discourage
the use of frameworks and encourage web native.
Excerpt from the checks' docs (general template adapted from ESLint):
See docs/checks/asset_size_javascript.md for more details.