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

Use regex instead of two includes methods #11314

Merged
merged 1 commit into from Aug 6, 2021

Conversation

sosukesuzuki
Copy link
Member

Description

Checklist

Try the playground for this PR

@@ -105,7 +105,7 @@ function createParse(parseMethod, ...optionsCombinations) {
}));
}

if (text.includes("#{") || text.includes("#[")) {
if (/#({|\[)/.test(text)) {
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (/#({|\[)/.test(text)) {
if (/#[[{]/.test(text)) {

Copy link
Sponsor Member

@fisker fisker Aug 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that eslint-plugin-import didn't report

I thought #11013 already merged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed your review sorry. I want to review the PR, but I'm not familiar with regex.

@fisker fisker changed the title Use regex instead of two include methods Use regex instead of two includes methods Aug 6, 2021
@sosukesuzuki sosukesuzuki merged commit e315513 into prettier:main Aug 6, 2021
@sosukesuzuki sosukesuzuki deleted the use-regex branch August 6, 2021 14:34
sosukesuzuki added a commit to sosukesuzuki/prettier that referenced this pull request Aug 6, 2021
@sosukesuzuki sosukesuzuki mentioned this pull request Aug 6, 2021
1 task
sosukesuzuki added a commit that referenced this pull request Aug 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants