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

How to support the configuration of multiple matching rules #28

Closed
iceycc opened this issue Jun 5, 2023 · 3 comments
Closed

How to support the configuration of multiple matching rules #28

iceycc opened this issue Jun 5, 2023 · 3 comments

Comments

@iceycc
Copy link

iceycc commented Jun 5, 2023

Project structure
I would like to support both canonical configurations. as follows:

└── src
    └── kebabCase.js
    └── kebab-case.js

Whether the following configurations are supported:

 "src/**/!(App).vue": "KEBAB_CASE|PASCAL_CASE",
@dukeluo
Copy link
Owner

dukeluo commented Jun 6, 2023

@iceycc Built in naming pattern cannot be combined currently. You need to create your own glob pattern for your case.

@dukeluo dukeluo closed this as completed Jun 23, 2023
@MixMasterMitch
Copy link

Could you take this as a feature request?

I have decided not to use this package specifically because it does not support this feature.

@dukeluo
Copy link
Owner

dukeluo commented Jul 20, 2023

It's actually quite simple to create your own glob pattern to combine the built in naming pattern. Here's a step-by-step guide to help you out:

  1. First, head over to the file where the built-in naming patterns are defined. You'll find the KEBAB_CASE pattern as +([a-z])*([a-z0-9])*(-+([a-z0-9])), and the PASCAL_CASE pattern as *([A-Z]*([a-z0-9])).
  2. To combine KEBAB_CASE and PASCAL_CASE, use the @(pattern1 | pattern2) syntax. In this case, the combined pattern will look like this: @(+([a-z])*([a-z0-9])*(-+([a-z0-9])) | *([A-Z]*([a-z0-9]))).
  3. Go to the website globster.xyz and verify your combined pattern.
  4. Once you are satisfied with the combined pattern, you can copy and integrate it into your .eslintrc.json configuration file.

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

No branches or pull requests

3 participants