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
feat: require-unicode-regexp
support v
flag
#17402
Conversation
Hi @sosukesuzuki!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page. Read more about contributing to ESLint here |
✅ Deploy Preview for docs-eslint canceled.
|
requiredUnicodeFlag
option to require-unicode-regexp
and support v
flagrequiredUnicodeFlag
option to require-unicode-regexp
and support v
flag
Hi @sosukesuzuki!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page. Read more about contributing to ESLint here |
requiredUnicodeFlag
option to require-unicode-regexp
and support v
flagrequire-unicode-regexp
support v
flag
I've edited the original post to change |
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.
These lines in the docs should also be updated with the v
flag:
This rule aims to enforce the use of `u` flag on regular expressions. |
If you don't want to notify regular expressions with no `u` flag, then it's safe to disable this rule. |
I also left a few other small suggestions.
re.test('\u2028'); // → false | ||
``` | ||
|
||
Please see <https://github.com/tc39/proposal-regexp-v-flag> and <https://v8.dev/features/regexp-v-flag> for more details. |
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.
These links should go in a "Further Reading" section at the bottom of the page instead of here. See the semi rule as an example: https://eslint.org/docs/latest/rules/semi#further-reading
Changes in the code LGTM. If review comments aren't addressed in time for today's release, I'm fine with merging this as-is to complete #17223, and addressing reviews later in a follow-up. |
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
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.
Approving for this release even though we need to clean up the documentation a bit later.
* docs: add `further_reading` links * docs: mention about `v` * Update docs/src/rules/require-unicode-regexp.md --------- Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[x] Documentation update
[x] Changes an existing rule (template)
[x] Add autofix to a rule
What changes did you make? (Give an overview)
Refs #17223
require-unicode-regexp
warns if there's nou
flag, but we have updated it to also allow thev
flag.requiredUnicodeFlag: "u" | "v"
. When this option is specified, a warning is issued if the designated flag is not included.Is there anything you'd like reviewers to focus on?
Option interface.