testing-library / eslint-plugin-testing-library

ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library
https://npm.im/eslint-plugin-testing-library
MIT License
968 stars 135 forks source link

docs: update eslint pattern matching #851

Closed NicolasBonduel closed 6 months ago

NicolasBonduel commented 7 months ago

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.

Belco90 commented 6 months ago

@all-contributors pleased add @NicolasBonduel for docs.

allcontributors[bot] commented 6 months ago

@Belco90

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

joshunger commented 5 months ago

@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 commented 5 months ago

@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.

github-actions[bot] commented 2 months ago

:tada: This PR is included in version 6.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: