denisraslov / folderslint

📁 Directory structure linter for Front-End projects
MIT License
183 stars 3 forks source link

Multiple wildcards (* or **) in same rule #15

Closed sebastian-sommerfeld-io closed 2 years ago

sebastian-sommerfeld-io commented 2 years ago

A .folderslintrc file that looks like this:

{
  "rules": [
    "docs/modules/*/assets/attachments/**",
    "docs/modules/*/assets/images/**",
    "docs/modules/*/examples/*",
    "docs/modules/*/examples/**",
    "docs/modules/*/pages/*",
    "docs/modules/*/pages/**",
    "docs/modules/*/partials/*",
    "docs/modules/*/partials/**",

    "resources/**",

    "src/cicd/**",
    "src/main/**",
    "src/test/**",

    "node_modules/**",
    "target/**"
  ]
}

results in false positives. The directory "docs/modules/ROOT/assets/images" contains the folder "workstations/kobol" (full path = docs/modules/ROOT/assets/images/workstations/kobol). The rule "docs/modules/*/assets/images/**" states that this folder is allowed. But still running the linter results in this message (which is a false positive).

/home/vagrant/work/repos/sebastian-sommerfeld-io/infrastructure/docs/modules/ROOT/assets/images/workstations/kobol
error  Directory is not allowed by config

Expected behavior is that this directory is not marked as error but is accepted and marked as allowed.

Actual behavior is that the directory is marked as error.

denisraslov commented 2 years ago

Thank you! Fixed in the release 1.2.0.

sebastian-sommerfeld-io commented 2 years ago

I can confirm that the bug is fixed. Folderslint 1.2.0 works as expected. Thanks for your help.