Registry / testing / eslint-plugin-filenames-ts

eslint-plugin-filenames-ts

JSON →
library1.3.2jsnpmunverified

An ESLint plugin that adds rules to enforce consistent file naming conventions in JavaScript projects. The latest stable version is 1.3.2. It provides three rules: match-regex for custom regex patterns, match-exported to match filenames to default exports, and no-index to disallow index.js files. The plugin is no longer actively maintained (last release 2018). It requires ESLint >=1.0.0 as a peer dependency. Key differentiator: it specifically lints filenames within ESLint's scope, not the entire filesystem.

npm install eslint-plugin-filenames-ts
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-FILE
E
eslint-plugin-filenames-ts
testingjavascriptv1.3.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

filenames/match-regex
// In .eslintrc: "rules": { "filenames/match-regex": [2, "^[a-z_]+$", true] }
// Incorrect: using "filenames/match-regex": [2, "^[a-z_]+$"] (omitting second argument) - second argument is not optional; default is 'camelCase.js'
The rule is enabled via plugin configuration, not direct import.
filenames/match-exported
// In .eslintrc: "rules": { "filenames/match-exported": [2, "kebab"] }
// Incorrect: using "filenames/match-exported": [2] (no transform) - defaults to null (no transform), but people often expect kebab by default
Available transforms: snake, kebab, camel, pascal. Can be array of transforms.
filenames/no-index
// In .eslintrc: "rules": { "filenames/no-index": 2 }
// Incorrect: using "filenames/no-index": [2] - rule has no options, array is accepted but unnecessary
Disallows index.js files entirely.

Shows basic ESLint configuration to enable all three plugin rules with example transform.

// .eslintrc.json { "plugins": ["filenames"], "rules": { "filenames/match-regex": [2, "^[a-z_]+$", true], "filenames/match-exported": [2, "kebab"], "filenames/no-index": 2 } } // Example file: my-file.js export default function myFile() {} // This file passes match-regex and match-exported (kebab transform matches 'my-file').
Debug
Known issues
deprecatedThis project is no longer actively maintained. Last release in 2018. May not work with modern ESLint versions (>=7).
fix
Consider alternatives like eslint-plugin-unicorn (unicorn/filename-case) or eslint-plugin-perfectionist.
affects: >=1.0.0
gotchaOnly lints filenames of .js and .jsx files that are already being linted by ESLint. Does not check other files like .ts, .tsx, .json, etc.
fix
For TypeScript files, use eslint-plugin-unicorn/filename-case or write custom rule.
affects: >=0.1.0
gotchaThe match-regex rule's second argument (ignoreExporting) defaults to false if only one argument provided. Many users omit it assuming default is 'camelCase.js' without export ignoring.
fix
Always provide both arguments to match-regex: [severity, regex, ignoreExporting]. Example: [2, '^[a-z_]+$', true].
affects: >=0.2.0
gotchamatch-exported does not respect exported function calls (e.g., export default someFunction()). Only respects function declarations, classes, and variable assignments.
fix
For complex exports, consider using a different plugin or adjust naming convention manually.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Failed to load plugin 'filenames' declared in '.eslintrc': Cannot find module 'eslint-plugin-filenames'
Plugin not installed as npm package.
fix
Run: npm install eslint-plugin-filenames --save-dev
Configuration for rule "filenames/match-regex" is invalid: Expected an array but got number
Using just severity number without array for rule that expects options.
fix
Change from "filenames/match-regex": 2 to "filenames/match-regex": [2, "^[a-z_]+$", true]
ESLint: Rule 'filenames/match-exported' requires a string or array of strings for transforms, got undefined
Using match-exported with no arguments (just severity), but expecting second argument.
fix
Provide a transform (e.g., 'kebab') or null: "filenames/match-exported": [2, null]
Upgrade
Version history
1.3.2latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required to run the plugin
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-filenames-ts — npm install eslint-plugin-filenames-ts · libregistry