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

[New] jsx-pascal-case: support glob ignore option #2906

Merged
merged 1 commit into from Jan 25, 2021
Merged

Conversation

@bcherny
Copy link

@bcherny bcherny commented Jan 23, 2021

Fixes #2905.

Note: This will potentially relax existing ignores:

  • Before, ignoreonly checked exact matches
  • After, ignore checks partial matches as well

I think this is fine, since it mirrors ESLint's behavior for the camelcase rule. If we prefer to be extra careful, I can make this a new option (eg. ignoreRegex).

@bcherny bcherny changed the title [Fix] jsx-pascal-case: support regex allow option [Fix] jsx-pascal-case: support regex ignore option Jan 23, 2021
Copy link
Collaborator

@ljharb ljharb left a comment

While It's impressive you found what I believe is the only option in eslint core that accepts regex, it's very dangerous to do new RegExp from user-supplied values, and we won't be supporting any regex options here. It would be reasonable to support globs instead, however.

As to this rule specifically, I'd love to understand the use case a bit more - why do you need "deprecated" to be in the name on the consuming side? import { Foo_DEPRECATED as Foo }, for example, works fine.

@bcherny bcherny force-pushed the bcherny:master branch from ca8a5fa to 983b4c2 Jan 25, 2021
@bcherny
Copy link
Author

@bcherny bcherny commented Jan 25, 2021

Updated per convo in #2905

@ljharb
ljharb approved these changes Jan 25, 2021
Copy link
Collaborator

@ljharb ljharb left a comment

Seems straightforward now, thanks!

docs/rules/jsx-pascal-case.md Outdated Show resolved Hide resolved
@ljharb ljharb force-pushed the bcherny:master branch 2 times, most recently from e66c119 to 4881bae Jan 25, 2021
@ljharb ljharb merged commit 4881bae into yannickcr:master Jan 25, 2021
43 checks passed
43 checks passed
@github-actions
Automatic Rebase
Details
@github-actions
Require “Allow Edits”
Details
@github-actions
matrix
Details
@github-actions
pretest
Details
@github-actions
readme
Details
@github-actions
latest majors (15, 7)
Details
@github-actions
posttest
Details
@github-actions
latest majors (15, 6)
Details
@github-actions
latest majors (15, 5)
Details
@github-actions
latest majors (15, 4)
Details
@github-actions
latest majors (14, 7)
Details
@github-actions
latest majors (14, 6)
Details
@github-actions
latest majors (14, 5)
Details
@github-actions
latest majors (14, 4)
Details
@github-actions
latest majors (13, 7)
Details
@github-actions
latest majors (13, 6)
Details
@github-actions
latest majors (13, 5)
Details
@github-actions
latest majors (13, 4)
Details
@github-actions
latest majors (12, 7)
Details
@github-actions
latest majors (12, 6)
Details
@github-actions
latest majors (12, 5)
Details
@github-actions
latest majors (12, 4)
Details
@github-actions
latest majors (11, 7)
Details
@github-actions
latest majors (11, 6)
Details
@github-actions
latest majors (11, 5)
Details
@github-actions
latest majors (11, 4)
Details
@github-actions
latest majors (10, 7)
Details
@github-actions
latest majors (10, 6)
Details
@github-actions
latest majors (10, 5)
Details
@github-actions
latest majors (10, 4)
Details
@github-actions
latest majors (9, 6)
Details
@github-actions
latest majors (9, 5)
Details
@github-actions
latest majors (9, 4)
Details
@github-actions
latest majors (8, 6)
Details
@github-actions
latest majors (8, 5)
Details
@github-actions
latest majors (8, 4)
Details
@github-actions
latest majors (7, 5)
Details
@github-actions
latest majors (7, 4)
Details
@github-actions
latest majors (6, 5)
Details
@github-actions
latest majors (6, 4)
Details
@github-actions
latest majors (5, 4)
Details
@github-actions
latest majors (4, 4)
Details
@github-actions
node 4+
Details
@ljharb ljharb changed the title [Fix] jsx-pascal-case: support regex ignore option [New] jsx-pascal-case: support regex ignore option Jan 25, 2021
@ljharb ljharb changed the title [New] jsx-pascal-case: support regex ignore option [New] jsx-pascal-case: support glob ignore option Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants