eslint-plugin-react-camel-case
raw JSON → 1.1.2 verified Sat Apr 25 auth: no javascript maintenance
ESLint plugin (v1.1.2) that enforces camelCased React props, converting dashed props (e.g., margin-left) to camelCase (marginLeft). Designed for JSX in React projects. Provides a single rule 'react-camel-case/prop-types'. Works with ESLint >=3.0. Relies on eslint-plugin-react for AST parsing. Lightweight but limited to runtime detection only—no automatic fix support. Maintained sporadically; last release in 2018.
Common errors
error Definition for rule 'react-camel-case/prop-types' was not found ↓
cause Plugin not loaded in ESLint config or missing from node_modules.
fix
Run 'npm install eslint-plugin-react-camel-case eslint-plugin-react --save-dev' and add 'plugins: ['react-camel-case']' to config.
error ESLint couldn't find the plugin "eslint-plugin-react-camel-case". ↓
cause Package not installed or ESLint version incompatible.
fix
Install the plugin: 'npm install eslint-plugin-react-camel-case@latest' and ensure ESLint version >=3.0.
error Cannot find module 'eslint-plugin-react' ↓
cause Missing required peer dependency.
fix
Install 'eslint-plugin-react': 'npm install eslint-plugin-react --save-dev'.
Warnings
deprecated Only one rule (prop-types) is provided; no custom configuration options. ↓
fix Consider using 'react/jsx-no-literals' or custom linting if more control is needed.
gotcha Rule only checks JSX props, not object spreads or dynamic prop names. ↓
fix Use 'eslint-plugin-react' 'no-unknown-property' for additional checks.
gotcha No autofix available; must manually correct dashed props. ↓
fix Consider using 'eslint-plugin-transform-class-properties' or codemods.
Install
npm install eslint-plugin-react-camel-case yarn add eslint-plugin-react-camel-case pnpm add eslint-plugin-react-camel-case Imports
- plugin wrong
const plugin = require('eslint-plugin-react-camel-case')correctimport plugin from 'eslint-plugin-react-camel-case' - rules wrong
import { rule } from 'eslint-plugin-react-camel-case'correctimport { rules } from 'eslint-plugin-react-camel-case'
Quickstart
// .eslintrc.js
module.exports = {
plugins: ['react', 'react-camel-case'],
rules: {
'react-camel-case/prop-types': 'error',
},
};