'KEBAB_CASE' fails on dot notation
joseph-ravenwolfe opened this issue · comments
When using KEBAB_CASE
filename convention. It is not uncommon to use the .test.js
file extension as a filename convention for tests.
└── src
└── my-module.js
└── tests
└── my-module.test.js
However, this causes the KEBAB_CASE
filename enforcement to fail for { "**/*.js": "KEBAB_CASE" }
This can currently be worked around with a custom Regex, however, I wanted to bring attention to this.
Is this desired behavior?
@joseph-ravenwolfe ignoreMiddleExtensions
is all you need.
Hi @dukeluo Can we have this option for check-file/folder-naming-convention
also
sure, i have this rule
'check-file/folder-naming-convention': [
'error',
{
'marketplace.module/**/*': 'CAMEL_CASE',
},
{
ignoreMiddleExtensions: true,
},
],
but it gives this error
Error: .eslintrc.js:
Configuration for rule "check-file/folder-naming-convention" is invalid:
Value [{"marketplace.module/**/*":"CAMEL_CASE"},{"ignoreMiddleExtensions":true}] should NOT have more than 1 items.
@turker0 This configs works well in my local.
├── create_folder_file.sh
├── index.js
├── marketplace.module
│ └── aB
│ └── b-c
│ └── a.js
├── package-lock.json
└── package.json
{
"plugins": ["check-file"],
"rules": {
"check-file/folder-naming-convention": [
"error",
{
"marketplace.module/**/": "CAMEL_CASE"
}
]
}
}
❯ npm run lint
> lint
> eslint "**/*.{ts,tsx,js,jsx,md}"
marketplace.module/aB/b-c/a.js
1:1 error The folder "b-c" does not match the "CAMEL_CASE" pattern check-file/folder-naming-convention
@dukeluo right but i can not pass gnoreMiddleExtensions: true
to check-file/folder-naming-convention