epaew / eslint-plugin-filenames-simple

An ESLint plugin to check filenames with simple configuration
MIT License
50 stars 5 forks source link

how can use * in except? #704

Open sdudnic opened 9 months ago

sdudnic commented 9 months ago

I would like to use

    "filenames-simple/naming-convention": ["error", {
      "rule": "kebab-case",
      "excepts": ["**/engines/**/properties/*.ts"]
    }]

is that possible, if not please add

epaew commented 9 months ago

I don't think it should be supported by plugins.

Can't you use this?

{
  "overrides": {
    "files": ["**/engines/**/properties/*.ts"],
    "rules": {
      "filenames-simple/naming-convention": "off"
    }
  }
}

https://eslint.org/docs/latest/use/configure/rules#using-configuration-files-1

sdudnic commented 9 months ago

thanks, I will try

sdudnic commented 9 months ago

I don't think it should be supported by plugins.

Can't you use this?

{
  "overrides": {
    "files": ["**/engines/**/properties/*.ts"],
    "rules": {
      "filenames-simple/naming-convention": "off"
    }
  }
}

https://eslint.org/docs/latest/use/configure/rules#using-configuration-files-1

is there a way to use the rule for FOLDERS as well? or only for files?

epaew commented 9 months ago

is there a way to use the rule for FOLDERS as well? or only for files?

I don't know because "overrides" is not my plugin's feature, it's feature of ESLint. And I'm not ESLint's contributer/maitainer.

However, I think you can ignore all files under path/to/dir using the configuration below.

{
  "overrides": {
    "files": ["path/to/dir/**/*"],
    "rules": {
      "filenames-simple/naming-convention": "off"
    }
  }
}
sdudnic commented 9 months ago

is there a way to use the rule for FOLDERS as well? or only for files?

I don't know because "overrides" is not my plugin's feature, it's feature of ESLint. And I'm not ESLint's contributer/maitainer.

However, I think you can ignore all files under path/to/dir using the configuration below.

{
  "overrides": {
    "files": ["path/to/dir/**/*"],
    "rules": {
      "filenames-simple/naming-convention": "off"
    }
  }
}

I mean, is there a way, with YOUR plugin, to check the FOLDERS, along with the files (nothing to override)

epaew commented 9 months ago
  1. Each rules (include plugin's rules) of ESLint works with file by file, so we cannot check anything if the directory is empty.
  2. Currently, the rule naming-convention targets basename of file.

In conclusion, it does not check the name of directories.