JSPM

eslint-plugin-react-naming-convention

1.26.3-beta.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 257330
  • Score
    100M100P100Q191768F
  • License MIT

ESLint React's ESLint plugin for naming convention related rules.

Package Exports

  • eslint-plugin-react-naming-convention
  • eslint-plugin-react-naming-convention/package.json

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