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

docs: update eslint pattern matching #851

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

NicolasBonduel
Copy link
Contributor

Checks

Changes

I believe there is a mistake in the README, where the s should not be optional, but the x should

*.[jt]s?(x):
    [jt]: Matches a single character, either 'j' or 't'.
    s?: The 's' is optional.
    (x): This matches an `x`, however, parenthesis are not a standard syntax for file globbing.

*.[jt]sx?:
    [jt]: Matches a single character, either 'j' or 't'.
    s: This 's' is required.
    x?: The 'x' is optional.

Context

File matching in eslint configuration example in the README file.

Signed-off-by: Nicolas Bonduel <NicolasBonduel@users.noreply.github.com>
Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

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

Hi @NicolasBonduel! Thanks for reporting. I got that pattern from Jest's testMatch docs directly, but I guess it makes more sense to get the updated pattern you suggest here.

@Belco90 Belco90 changed the title docs: Update eslint pattern matching docs: update eslint pattern matching Dec 11, 2023
@Belco90 Belco90 merged commit c9b5712 into testing-library:main Dec 11, 2023
29 checks passed
@Belco90
Copy link
Member

Belco90 commented Dec 11, 2023

@all-contributors pleased add @NicolasBonduel for docs.

Copy link
Contributor

@Belco90

I've put up a pull request to add @NicolasBonduel! 🎉

@joshunger
Copy link

joshunger commented Jan 4, 2024

@Belco90 @NicolasBonduel 👋 just ran across this. The new pattern doesn't work and no longer matches.

Zero or One Pattern ?(a|b)

See https://www.digitalocean.com/community/tools/glob

Wondering if this should be reverted?

@Belco90
Copy link
Member

Belco90 commented Jan 12, 2024

@joshunger Interesting, thanks for reporting! I'll revert it for now until we figure out if there is a better pattern. I took the original one from Jest docs, so definitely works.

Copy link

🎉 This PR is included in version 6.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants