
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
eslint-plugin-validate-filename
Advanced tools
ESLint rule to force file names format. Create common rules for file names by folder name or regex pattern.
npm install --save-dev eslint-plugin-validate-filename
{
"plugins": ["validate-filename"]
}
Create a rule in the name of ESLint. You can set multiple rules.
{
"rules": {
"validate-filename/naming-rules": [
"error",
{
rules: [
{
case: 'pascal', // camel or pascal or snake or kebab or flat
target: "**/components/**", // target "components" folder
excludes: ['hooks'], // "hooks" folder is excluded.
},
{
case: 'camel',
target: "**/hooks/**", // target "hooks" folder
patterns: '^use', // file names begin with "use".
},
{
target: '/schemas/**', // target "schemas" folder
patterns: '^[a-z][a-zA-Z0-9]*\\.schema\\.ts$', // file names that contain 'schema'. ex: user.schema.ts
},
],
},
],
},
}
Only certain extensions are allowed. target is a regular expression that identifies the folder. extensions you want to allow for extensions.
{
"rules": {
"validate-filename/limit-extensions": [
"error",
{
rules: [
{
target: "**/hooks/**",
extensions: ['.ts', '.tsx'], // This cannot be created except for .ts or .tsx under the hooks folder.
},
],
},
],
},
}
First, install npm dependencies.
npm install
Running unit test. This library uses vitest.
npm run test
Build modules.
npm run build
See Next.js naming conventions are checked with ESLint rules article.
MIT License.© hiro08gh
FAQs
ESLint plugin validate filename.
The npm package eslint-plugin-validate-filename receives a total of 11,973 weekly downloads. As such, eslint-plugin-validate-filename popularity was classified as popular.
We found that eslint-plugin-validate-filename demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.