We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
prefer-code-point
Prefer String#codePointAt() over String#charCodeAt() Prefer String.fromCodePoint() over String.fromCharCode()
String#codePointAt()
String#charCodeAt()
String.fromCodePoint()
String.fromCharCode()
const unicorn = 'π¦'.charCodeAt(0).toString(16) // -> 'd83e'
const unicorn = String.fromCharCode(0x1f984) // -> 'ο¦'
const unicorn = 'π¦'.codePointAt(0).toString(16) // -> '1f984'
const unicorn = String.fromCodePoint(0x1f984) // -> 'π¦'
This rule should use suggestions instead of auto-fix.
The text was updated successfully, but these errors were encountered:
Why? Only due to support?
Sorry, something went wrong.
Because it result differently.
This is now accepted.
Successfully merging a pull request may close this issue.
Prefer
String#codePointAt()
overString#charCodeAt()
Prefer
String.fromCodePoint()
overString.fromCharCode()
Fail
Pass
This rule should use suggestions instead of auto-fix.
The text was updated successfully, but these errors were encountered: