You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[![Follow Author on X][x-follow-image]][x-follow-url]
9
9
10
-
[![Donate][ko-fi-image]][ko-fi-url]
11
-
12
-
ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.
10
+
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.
Add `check-file` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
80
-
81
-
```json
82
-
{
83
-
"plugins": ["check-file"]
84
-
}
85
-
```
86
-
87
-
Then configure the rules you want to use under the rules section.
88
-
89
-
```json
90
-
{
91
-
"rules": {
92
-
"check-file/no-index": "error",
93
-
"check-file/filename-blocklist": [
94
-
"error",
95
-
{
96
-
"**/*.model.ts": "*.models.ts",
97
-
"**/*.util.ts": "*.utils.ts"
98
-
}
99
-
],
100
-
"check-file/folder-match-with-fex": [
101
-
"error",
102
-
{
103
-
"*.test.{js,jsx,ts,tsx}": "**/__tests__/",
104
-
"*.styled.{jsx,tsx}": "**/pages/"
105
-
}
106
-
],
107
-
"check-file/filename-naming-convention": [
108
-
"error",
109
-
{
110
-
"**/*.{jsx,tsx}": "CAMEL_CASE",
111
-
"**/*.{js,ts}": "KEBAB_CASE"
112
-
}
113
-
],
114
-
"check-file/folder-naming-convention": [
115
-
"error",
116
-
{
117
-
"src/**/": "CAMEL_CASE",
118
-
"mocks/*/": "KEBAB_CASE"
119
-
}
120
-
]
121
-
}
122
-
}
123
-
```
124
-
125
77
## Supported Rules
126
78
127
79
-[check-file/no-index](docs/rules/no-index.md): A file cannot be named "index"
@@ -130,6 +82,18 @@ Then configure the rules you want to use under the rules section.
130
82
-[check-file/filename-naming-convention](docs/rules/filename-naming-convention.md): Enforce a consistent naming pattern for filenames for specified files
131
83
-[check-file/folder-naming-convention](docs/rules/folder-naming-convention.md): Enforce a consistent naming pattern for folder names for specified folders
132
84
85
+
## Version Compatibility
86
+
87
+
Version 3.0.0 and above only support ESLint's flat configuration. For legacy configuration support, please use version 2.x.
88
+
89
+
## Support
90
+
91
+
If you find this plugin helpful, consider supporting the project:
0 commit comments