How to support the configuration of multiple matching rules
iceycc opened this issue · comments
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",
@iceycc Built in naming pattern cannot be combined currently. You need to create your own glob pattern for your case.
Could you take this as a feature request?
I have decided not to use this package specifically because it does not support this feature.
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:
- 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 thePASCAL_CASE
pattern as*([A-Z]*([a-z0-9]))
. - To combine
KEBAB_CASE
andPASCAL_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])))
. - Go to the website globster.xyz and verify your combined pattern.
- Once you are satisfied with the combined pattern, you can copy and integrate it into your
.eslintrc.json
configuration file.