{"id":19759,"library":"eslint-plugin-filenames-ts","title":"eslint-plugin-filenames","description":"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.","status":"deprecated","version":"1.3.2","language":"javascript","source_language":"en","source_url":"git://github.com/selaux/eslint-plugin-filenames","tags":["javascript","eslint","eslintplugin","eslint-plugin","file","filename","path"],"install":[{"cmd":"npm install eslint-plugin-filenames-ts","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-filenames-ts","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-filenames-ts","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to run the plugin","package":"eslint","optional":false}],"imports":[{"note":"The rule is enabled via plugin configuration, not direct import.","wrong":"// Incorrect: using \"filenames/match-regex\": [2, \"^[a-z_]+$\"] (omitting second argument) - second argument is not optional; default is 'camelCase.js'","symbol":"filenames/match-regex","correct":"// In .eslintrc: \"rules\": { \"filenames/match-regex\": [2, \"^[a-z_]+$\", true] }"},{"note":"Available transforms: snake, kebab, camel, pascal. Can be array of transforms.","wrong":"// Incorrect: using \"filenames/match-exported\": [2] (no transform) - defaults to null (no transform), but people often expect kebab by default","symbol":"filenames/match-exported","correct":"// In .eslintrc: \"rules\": { \"filenames/match-exported\": [2, \"kebab\"] }"},{"note":"Disallows index.js files entirely.","wrong":"// Incorrect: using \"filenames/no-index\": [2] - rule has no options, array is accepted but unnecessary","symbol":"filenames/no-index","correct":"// In .eslintrc: \"rules\": { \"filenames/no-index\": 2 }"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"filenames\"],\n  \"rules\": {\n    \"filenames/match-regex\": [2, \"^[a-z_]+$\", true],\n    \"filenames/match-exported\": [2, \"kebab\"],\n    \"filenames/no-index\": 2\n  }\n}\n\n// Example file: my-file.js\nexport default function myFile() {}\n// This file passes match-regex and match-exported (kebab transform matches 'my-file').","lang":"javascript","description":"Shows basic ESLint configuration to enable all three plugin rules with example transform."},"warnings":[{"fix":"Consider alternatives like eslint-plugin-unicorn (unicorn/filename-case) or eslint-plugin-perfectionist.","message":"This project is no longer actively maintained. Last release in 2018. May not work with modern ESLint versions (>=7).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"For TypeScript files, use eslint-plugin-unicorn/filename-case or write custom rule.","message":"Only lints filenames of .js and .jsx files that are already being linted by ESLint. Does not check other files like .ts, .tsx, .json, etc.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Always provide both arguments to match-regex: [severity, regex, ignoreExporting]. Example: [2, '^[a-z_]+$', true].","message":"The 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.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"For complex exports, consider using a different plugin or adjust naming convention manually.","message":"match-exported does not respect exported function calls (e.g., export default someFunction()). Only respects function declarations, classes, and variable assignments.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install eslint-plugin-filenames --save-dev","cause":"Plugin not installed as npm package.","error":"Error: Failed to load plugin 'filenames' declared in '.eslintrc': Cannot find module 'eslint-plugin-filenames'"},{"fix":"Change from \"filenames/match-regex\": 2 to \"filenames/match-regex\": [2, \"^[a-z_]+$\", true]","cause":"Using just severity number without array for rule that expects options.","error":"Configuration for rule \"filenames/match-regex\" is invalid: Expected an array but got number"},{"fix":"Provide a transform (e.g., 'kebab') or null: \"filenames/match-exported\": [2, null]","cause":"Using match-exported with no arguments (just severity), but expecting second argument.","error":"ESLint: Rule 'filenames/match-exported' requires a string or array of strings for transforms, got undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}