Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork24
ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.
License
dukeluo/eslint-plugin-check-file
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
An ESLint plugin that enforces consistent naming conventions for files and folders in your project. It helps maintain a clean and organized codebase by allowing you to define and enforce specific patterns for filenames and directory structures.
You'll first need to installESLint:
npm i eslint --save-dev
Next, installeslint-plugin-check-file
:
npm install eslint-plugin-check-file --save-dev
This plugin supports ESLint'sflat configuration. Here's a complete example:
importcheckFilefrom'eslint-plugin-check-file';exportdefault[{// optional: add this processor to files which not processed by other processors but still require lintingfiles:['**/*.yaml','**/*.webp'],processor:'check-file/eslint-processor-check-file',},{files:['src/**/*.*'],plugins:{'check-file':checkFile,},rules:{'check-file/no-index':'error','check-file/filename-blocklist':['error',{'**/*.model.ts':'*.models.ts','**/*.util.ts':'*.utils.ts',},],'check-file/folder-match-with-fex':['error',{'*.test.{js,jsx,ts,tsx}':'**/__tests__/','*.styled.{jsx,tsx}':'**/components/',},],'check-file/filename-naming-convention':['error',{'**/*.{jsx,tsx}':'PASCAL_CASE','**/*.{js,ts}':'CAMEL_CASE',},],'check-file/folder-naming-convention':['error',{'src/components/*/':'PASCAL_CASE','src/!(components)/**/!(__tests__)/':'CAMEL_CASE',},],},},];
- check-file/no-index: A file cannot be named "index"
- check-file/filename-blocklist: Blocklist filenames by pattern
- check-file/folder-match-with-fex: Enforce a consistent naming pattern for folder names for specified files
- check-file/filename-naming-convention: Enforce a consistent naming pattern for filenames for specified files
- check-file/folder-naming-convention: Enforce a consistent naming pattern for folder names for specified folders
Version 3.x and above only support ESLint's flat configuration. For legacy configuration support, please use version 2.x.
If you find this plugin helpful, consider supporting the project:
About
ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.