Feature proposal: supporting .dir only for child folders
haili042 opened this issue · comments
haili042 commented
Hi~
I have project like this:
src
|-- apps
| |-- HomeApp # XxxXxxApp
| | |-- components
| | |-- utils
| |-- UserApp
I want all child folders of src/apps follow PascalCase + App, and the other subdirectories follow kebab-case, so I try this:
ls:
src:
.dir: kebab-case
src/apps:
.dir: regex:^[A-Z](([a-z0-9]+[A-Z]?)*)App$
src/apps/HomeApp/components failed for rules: kebabcase
But it's fail because .dir will applies for the current directory and all their subdirectories.
So I'd like to propose the ability to supporting rules configuration to add recursive option (or other options maybe)
ls:
src:
.dir: kebab-case
src/apps:
.dir:
rule: regex:^[A-Z](([a-z0-9]+[A-Z]?)*)App$
recursive: false # true for all subdirectories, false for child folders
Lucas Löffel commented
Hey @haili042,
this is supported - i think you can simple do this (please let me know if this works):
ls:
src:
.dir: kebab-case
apps/*:
.dir: regex:... # fyi: do not use ^..$ here: https://ls-lint.org/2.2/configuration/the-rules.html#example
'**':
.dir: kebab-case