eslint-plugin-react-naming-convention
v1.22.1
Published
ESLint React's ESLint plugin for naming convention related rules.
Downloads
678,044
Maintainers
Readme
eslint-plugin-react-naming-convention
Naming convention rules.
[!NOTE] This plugin is already included in
@eslint-react/eslint-plugin
. You don't need to install it separately if you are using@eslint-react/eslint-plugin
.
Install
# npm
npm install --save-dev eslint-plugin-react-naming-convention
Setup
// @ts-check
import js from "@eslint/js";
import reactNamingConvention from "eslint-plugin-react-naming-convention";
export default [
js.configs.recommended,
{
files: ["**/*.{ts,tsx}"],
plugins: {
"react-naming-convention": reactNamingConvention,
},
rules: {
// react-naming-convention recommended rules
"react-naming-convention/filename-extension": ["warn", "as-needed"],
"react-naming-convention/use-state": "warn",
},
},
];
Rules
https://eslint-react.xyz/docs/rules/overview#naming-convention-rules