-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
ESLint and Biome fixes #148
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
return count; | ||
return Array.from(segmenter.segment(str.replaceAll("\u200D", ""))).length; |
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.
return Array.from(segmenter.segment(str.replaceAll("\u200D", ""))).length; | |
const STRING_JOINER_CHAR = "\u200D" | |
return Array.from(segmenter.segment(str.replaceAll(STRING_JOINER_CHAR, ""))).length; |
Another example on how you can remove the explanatory comment above and explain the code… with code itself.
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.
See my comment in Unicodify: rugk/unicodify#96 (comment)
@@ -125,6 +123,8 @@ export async function triggerOnSelect(emoji) { | |||
if (closePopup) { | |||
window.close(); | |||
} | |||
} else { | |||
CommonMessages.showError("couldNotDoAction", true); |
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 am unsure, is couldNotDoAction
really already defined?
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.
See above on lines 117-119. This is just switching the twisted if/else statements per the no-negated-condition ESLint rule. The Unicorn ESLint plugin includes an autofix for this.
typeof
operator.window
withglobalThis
.Intl.Segmenter
.RegExp.escape
if available.