oxlint-check-file
v0.2.0
Published
oxlint plugin porting eslint-plugin-check-file rules
Maintainers
Readme
oxlint-check-file
An oxlint plugin that ports filename and folder naming convention rules from eslint-plugin-check-file.
Installation
npm install --save-dev oxlint-check-fileUsage
Add to your .oxlintrc.json:
{
"jsPlugins": [{ "name": "check-file", "specifier": "oxlint-check-file" }],
"rules": {
"check-file/no-index": "error",
"check-file/filename-naming-convention": ["error", { "**/*.{ts,tsx}": "KEBAB_CASE" }],
"check-file/folder-naming-convention": ["error", { "src/**/": "KEBAB_CASE" }],
"check-file/filename-blocklist": ["error", { "**/*.util.ts": "*.utils.ts" }],
"check-file/folder-match-with-fex": ["error", { "*.test.ts": "**/__tests__/**" }]
}
}Rules
| Rule | Description |
|---|---|
| no-index | Disallow files named index |
| filename-blocklist | Flag filenames matching glob blocklist patterns |
| filename-naming-convention | Enforce naming conventions on filenames by glob |
| folder-naming-convention | Enforce naming conventions on folder names by glob |
| folder-match-with-fex | Require files matching a glob to exist in a matching folder |
Naming Conventions
The following built-in convention names are supported for filename-naming-convention and folder-naming-convention:
CAMEL_CASE—myFileNamePASCAL_CASE—MyFileNameSNAKE_CASE—my_file_nameKEBAB_CASE—my-file-nameSCREAMING_SNAKE_CASE—MY_FILE_NAMEFLAT_CASE—myfilenameNEXT_JS_APP_ROUTER_CASE— Next.js app router segmentsNEXT_JS_PAGE_ROUTER_FILENAME_CASE— Next.js page router filenames
You can also pass a custom regex string (without ^ and $, they are added automatically).
License
MIT
