Skip to content
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

Breaking: support new regex d flag (fixes #14640) #14653

Merged
merged 5 commits into from Aug 5, 2021

Conversation

ota-meshi
Copy link
Contributor

@ota-meshi ota-meshi commented Jun 1, 2021

WIP

Remaining steps:

  • release espree.
  • release regexpp.
  • update package.json with the new versions of espree.
  • update package.json with the new versions of regexpp.
  • Fix test cases that failed due to upgrading espree.

Fixes #14640.

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[x] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain: Upgrade the espree and the regexpp.

What changes did you make? (Give an overview)

This PR adds support for ES2022 RegExp Match Indices. Specifically, change the no-empty-character-class rule and no-invalid-regexp rule to allow the regex d flag.
https://github.com/tc39/proposal-regexp-match-indices

Is there anything you'd like reviewers to focus on?

I changed the no-empty-character-class rule to accept any flags.

@eslint-github-bot eslint-github-bot bot added the triage An ESLint team member will look at this issue soon label Jun 1, 2021
@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion new syntax This issue is related to new syntax that has reached stage 4 and removed triage An ESLint team member will look at this issue soon labels Jun 12, 2021
Copy link
Member

@mdjermanovic mdjermanovic left a comment

LGTM once espree v8.0.0 is released and package.json updated.

Thanks for updating regexpp with the new syntax, and thanks for refactoring no-empty-character-class in a way that it doesn't have to be updated with new flags in the future.

lib/rules/no-invalid-regexp.js Outdated Show resolved Hide resolved
@ota-meshi
Copy link
Contributor Author

ota-meshi commented Jun 30, 2021

It seems that some existing rule tests fail due to upgrading espree to v8.x.
Will this issue be fixed in #14591? Or do you need another PR?

@mdjermanovic mdjermanovic changed the title Update: support new regex d flag (fixes #14640) Breaking: support new regex d flag (fixes #14640) Jun 30, 2021
@mdjermanovic
Copy link
Member

mdjermanovic commented Jun 30, 2021

camelcase, id-denylist, id-blacklist, id-match, id-length are planned to be fixed in #14591, SourceCode#getComments() in #14748.

I think this PR can be marked as Ready for review (i.e. not draft) although the CI is failing. Once we fix the errors on master branch, we could re-run CI checks here.

@ota-meshi ota-meshi marked this pull request as ready for review Jun 30, 2021
@mdjermanovic mdjermanovic added upgrade This change is related to a dependency upgrade breaking This change is backwards-incompatible labels Jun 30, 2021
Copy link
Member

@mdjermanovic mdjermanovic left a comment

LGTM, thanks!

nzakas
nzakas approved these changes Aug 5, 2021
@nzakas nzakas merged commit 6bd747b into eslint:master Aug 5, 2021
13 checks passed
@ota-meshi ota-meshi deleted the es2022-regexp branch Aug 5, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Feb 2, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion breaking This change is backwards-incompatible new syntax This issue is related to new syntax that has reached stage 4 upgrade This change is related to a dependency upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Support for RegExp match indices
4 participants