Registry /
testing / eslint-plugin-validate-filename
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default export
✓ import validateFilename from 'eslint-plugin-validate-filename'
✗ const validateFilename = require('eslint-plugin-validate-filename')
ESM-only; the plugin exports a single object with rules
rules
✓ import { rules } from 'eslint-plugin-validate-filename'
Named export 'rules' contains all rule definitions
Plugin config
✓ import validateFilename from 'eslint-plugin-validate-filename'; plugins: { 'validate-filename': validateFilename }
✗ plugins: ['validate-filename'] // Not valid for flat config
In ESLint flat config, you must pass the plugin object, not a string
Configure eslint-plugin-validate-filename with naming-rules and limit-extensions in both legacy and flat ESLint configs.
// .eslintrc.js (legacy)
module.exports = {
plugins: ['validate-filename'],
rules: {
'validate-filename/naming-rules': ['error', {
rules: [
{ case: 'pascal', target: '**/components/**' },
{ case: 'camel', target: '**/hooks/**', patterns: '^use' }
]
}],
'validate-filename/limit-extensions': ['error', {
rules: [
{ target: '**/hooks/**', extensions: ['.ts', '.tsx'] }
]
}]
}
};
// eslint.config.js (flat config)
import validateFilename from 'eslint-plugin-validate-filename';
export default [
{
plugins: { 'validate-filename': validateFilename },
rules: {
'validate-filename/naming-rules': ['error', {
rules: [
{ case: 'pascal', target: '**/components/**' },
{ case: 'camel', target: '**/hooks/**', patterns: '^use' }
]
}],
'validate-filename/limit-extensions': ['error', {
rules: [
{ target: '**/hooks/**', extensions: ['.ts', '.tsx'] }
]
}]
}
}
];
Errors
Common errors & fixes
ESLint: Error while loading rule 'validate-filename/naming-rules': Rule is not found
Plugin not added to plugins array or incorrectly configured in flat config.
fixEnsure plugin is registered: in flat config use plugins: { 'validate-filename': validateFilename }. Cannot find module 'eslint-plugin-validate-filename'
Package not installed or not in node_modules.
fixRun 'npm install --save-dev eslint-plugin-validate-filename'.
Invalid option 'case' - must be one of camel, pascal, snake, kebab, flat
Typo or unsupported case value.
fixUse one of: camel, pascal, snake, kebab, flat.
target is not a valid glob pattern
target uses regex or invalid glob syntax.
fixUse proper glob patterns like '**/components/**'.
Audit
Dependencies
eslintrequiredpeer dependency for ESLint plugin