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-tsVerified import paths — ran on the pinned version, not inferred.
Shows basic ESLint configuration to enable all three plugin rules with example transform.
Consider alternatives like eslint-plugin-unicorn (unicorn/filename-case) or eslint-plugin-perfectionist.
For TypeScript files, use eslint-plugin-unicorn/filename-case or write custom rule.
Always provide both arguments to match-regex: [severity, regex, ignoreExporting]. Example: [2, '^[a-z_]+$', true].
For complex exports, consider using a different plugin or adjust naming convention manually.
Run: npm install eslint-plugin-filenames --save-dev
Change from "filenames/match-regex": 2 to "filenames/match-regex": [2, "^[a-z_]+$", true]
Provide a transform (e.g., 'kebab') or null: "filenames/match-exported": [2, null]