{"id":19893,"library":"eslint-plugin-react-filenames","title":"eslint-plugin-react-filenames","description":"Enforces naming conventions for React component files using ESLint. Currently at version 0.0.2, this plugin provides a single rule, react-filenames/filename-matches-component, which verifies that a file's name matches the default export component's name. It is a lightweight, opinionated linter plugin designed for React projects using ESLint 2.x or 3.x. Unlike broader plugins like eslint-plugin-react that cover many rules, this plugin focuses specifically on file naming consistency. The release cadence is low, with no updates since its initial release. It requires ESLint 2.x or 3.x and the react plugin as peer dependencies.","status":"deprecated","version":"0.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/mapbox/eslint-plugin-react-filenames","tags":["javascript","eslint","eslint-plugin","eslintplugin","react"],"install":[{"cmd":"npm install eslint-plugin-react-filenames","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-react-filenames","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-react-filenames","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The main export is a plugin object. Use the plugin directly in ESLint config as 'react-filenames'.","wrong":"const plugin = require('eslint-plugin-react-filenames')","symbol":"rules","correct":"import { rules } from 'eslint-plugin-react-filenames'"}],"quickstart":{"code":"{\n  \"plugins\": [\"react-filenames\"],\n  \"rules\": {\n    \"react-filenames/filename-matches-component\": \"error\"\n  }\n}","lang":"javascript","description":"ESLint configuration to enforce that React component filenames match their default export name."},"warnings":[{"fix":"Switch to eslint-plugin-react's 'jsx-filename-rule' or similar alternative.","message":"Package is no longer maintained and uses outdated ESLint API (1.x–3.x). May not work with ESLint 4+.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure components are default-exported, or consider using a different rule.","message":"The rule 'filename-matches-component' requires a default export, but not all React components use default exports.","severity":"gotcha","affected_versions":"0.0.2"},{"fix":"Use legacy ESLint version or migrate to a supported plugin.","message":"ESLint 2.x/3.x peer dependency: plugin does not support ESLint 4+.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Add 'settings.react' block to your ESLint config.","message":"The plugin does not automatically detect component names; it requires the eslint-plugin-react settings for pragma and createClass.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure rule value is a string severity (e.g., 'error') or array with options. Check ESLint peer dependency compatibility.","cause":"Rule configuration expects an array but got a string, or ESLint version mismatch.","error":"ESLintError: Configuration for rule \"react-filenames/filename-matches-component\" is invalid"},{"fix":"Run 'npm install eslint-plugin-react-filenames --save-dev' and ensure you are in the correct directory.","cause":"Plugin not installed in the project's node_modules.","error":"Error: Cannot find module 'eslint-plugin-react-filenames'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}