dukeluo / eslint-plugin-check-file

ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.

Home Page:https://www.npmjs.com/package/eslint-plugin-check-file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support multiple wildcard matching

Yokozuna59 opened this issue · comments

Hi there! I'm currently have the following eslint config:

{
    // ...
    "check-file/filename-naming-convention": [
        "error",
        {
            "**/*.ts": "KEBAB_CASE"
        }
    ]
}

And it's working fine with regular (single wildcard) files:

.
├── sample-sample.ts
└── sample.ts

But in multiple wildcards, it throws errors for it:

.
├── sample.test.ts
├── sample-test.spec.ts
├── sample.d.css.ts
├── sample.config.ts
└── sample.d.ts
commented

The rule filename-naming-convention can ignore the middle file extensions. You need to set like this:

    "check-file/filename-naming-convention": [
      "error",
      {
        "**/*.ts": "KEBAB_CASE"
      },
      {
        "ignoreMiddleExtensions": true
      }
    ]

See more at here.

Oh, sorry! wasn't aware of that.