Registry /
testing / eslint-plugin-filenames
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.
plugin
✓ plugins: ['filenames'] in .eslintrc
✗ require('eslint-plugin-filenames') without registering
This is an ESLint plugin, not an importable module in code. Register it in your ESLint config under 'plugins'.
match-regex
✓ rules: { 'filenames/match-regex': [2, '^[a-z_]+$'] }
✗ rules: { 'filenames/match-regex': 'error' } (missing array)
The rule accepts an array with regex pattern and optional boolean for ignoring exported files.
match-exported
✓ rules: { 'filenames/match-exported': 2 }
✗ rules: { 'filenames/match-exported': [2, 'camel'] } (transform names are lowercase strings, e.g. 'camel', 'kebab')
Transform parameter can be a string, an array of strings/null, or omitted. Use null for no transform.
no-index
✓ rules: { 'filenames/no-index': 2 }
✗ rules: { 'filenames/no-index': 'error' } (should be numeric severity)
Simple rule; no options. Just set severity.
all rules
✓ const plugin = require('eslint-plugin-filenames'); plugin.rules
✗ import plugin from 'eslint-plugin-filenames' (ESM not supported)
This package is CommonJS only; ESM import may fail in Node.js without bundler.
Shows installation, ESLint configuration with all three rules, and a test that triggers match-regex.
// 1. Install the plugin and ESLint
// npm install eslint eslint-plugin-filenames --save-dev
// 2. Create .eslintrc.json:
{
"plugins": ["filenames"],
"rules": {
"filenames/match-regex": [2, "^[a-z_]+$"],
"filenames/match-exported": [2, null, "\\.react$"],
"filenames/no-index": 2
}
}
// 3. Create a file test-foo.js (not matching regex) and run:
// npx eslint test-foo.js
// Expected output: error: Filename does not match the naming convention (filenames/match-regex)
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-filenames"
Plugin is not installed or not in node_modules.
fixRun npm install eslint-plugin-filenames --save-dev and ensure it's in the same directory as your .eslintrc.
Configuration for rule "filenames/match-regex" is invalid: Value [2, "^[a-z_]+$"] is not a valid severity.
Severity must be a number or string like 'error', not an array if not using options.
fixUse a number for severity if no options: "filenames/match-regex": 2. If using options, keep array format but ensure first element is severity: [2, "^[a-z_]+$"].
Cannot read property 'match' of undefined
Plugin not properly registered; eslint cannot access rules.
fixAdd 'filenames' to the plugins array in your ESLint config.
Audit
Dependencies
eslintrequiredpeer dependency; requires eslint >=1.0.0