๐Ÿš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more โ†’
Socket
DemoInstallSign in
Socket

eslint-plugin-react-naming-convention

Package Overview
Dependencies
Maintainers
1
Versions
1327
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-naming-convention

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

1.5.25-next.10
Source
npm
Version published
Weekly downloads
246K
-8.77%
Maintainers
1
Weekly downloads
ย 
Created
Source

eslint-plugin-react-naming-convention

Naming convention rules.

[!TIP] 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

Add the plugin to your eslint.config.js:

// @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
        "naming-convention/filename-extension": ["warn", "as-needed"],
        "naming-convention/use-state": "warn",
      }
    ],
  },
];

Rules

RuleDescription๐Ÿ’ผ๐Ÿ’ญโŒ
component-nameEnforces naming conventions for components.๐Ÿ“–
filenameEnforces naming convention for JSX files.๐Ÿ“–
filename-extensionEnforces consistent use of the JSX file extension.๐Ÿ“–
use-stateEnforces destructuring and symmetric naming of useState hook value and setter variables.๐Ÿ“–

FAQs

Package last updated on 12 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts