Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details โ†’
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-react-x

Package Overview
Dependencies
Maintainers
1
Versions
1965
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-x

A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.

Source
npmnpm
Version
2.9.2
Version published
Weekly downloads
603K
3.06%
Maintainers
1
Weekly downloads
ย 
Created
Source

eslint-plugin-react-x

4-7x faster, composable ESLint rules for for libraries and frameworks that use React as a UI runtime.

Install

# npm
npm install --save-dev eslint-plugin-react-x

Setup

// eslint.config.js

// @ts-check
import js from "@eslint/js";
import react from "eslint-plugin-react-x";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

export default defineConfig(
  {
    files: ["**/*.{ts,tsx}"],
    extends: [
      js.configs.recommended,
      tseslint.configs.recommended,
      react.configs.recommended,
    ],
    rules: {
      // Put rules you want to override here
      "react-x/no-class-component": "warn",
    },
  },
);

Rules

JSX

  • jsx-dollar - Prevents unnecessary $ symbols before JSX expressions (๐Ÿ”ง Fixable)
  • jsx-key-before-spread - Enforces key prop placement before spread props (๐Ÿงช Experimental)
  • jsx-no-comment-textnodes - Prevents comment strings (e.g., beginning with // or /*) from being accidentally inserted into a JSX element's text nodes
  • jsx-no-duplicate-props - Disallows duplicate props in JSX elements
  • jsx-no-iife - Disallows immediately-invoked function expressions in JSX (๐Ÿงช Experimental)
  • jsx-no-undef - Prevents using variables in JSX that are not defined in the scope
  • jsx-shorthand-boolean - Enforces shorthand syntax for boolean props (๐Ÿ”ง Fixable, โš™๏ธ Configurable)
  • jsx-shorthand-fragment - Enforces shorthand syntax for fragment elements (๐Ÿ”ง Fixable, โš™๏ธ Configurable)
  • jsx-uses-react - Marks React variables as used when JSX is present
  • jsx-uses-vars - Marks JSX element variables as used

Key

  • no-array-index-key - Disallows using an item's index in the array as its key
  • no-create-ref - Disallows createRef in function components
  • no-duplicate-key - Prevents duplicate key props on sibling elements when rendering lists
  • no-implicit-key - Prevents key from not being explicitly specified (e.g., spreading key from objects) (๐Ÿงช Experimental)
  • no-missing-key - Disallows missing key on items in list rendering
  • no-unnecessary-key - Disallows unnecessary key props on nested child elements when rendering lists (๐Ÿงช Experimental)

Ref

Props

  • no-children-prop - Disallows passing children as a prop
  • no-default-props - Disallows the defaultProps property in favor of ES6 default parameters
  • no-prop-types - Disallows propTypes in favor of TypeScript or another type-checking solution
  • no-unstable-default-props - Prevents using referential-type values as default props in object destructuring (โš™๏ธ Configurable)
  • no-unused-props - Warns about component props that are defined but never used (๐Ÿ’ญ Type Checking, ๐Ÿงช Experimental)
  • prefer-destructuring-assignment - Enforces destructuring assignment for component props and context
  • prefer-read-only-props - Enforces read-only props in components (๐Ÿ’ญ Type Checking, ๐Ÿงช Experimental)

Context

Structure

Rendering

Optimization

Legacy Element APIs

Legacy Children APIs

Legacy Component APIs

Miscellaneous

https://eslint-react.xyz/docs/rules/overview#x-rules

Keywords

react

FAQs

Package last updated on 02 Feb 2026

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