logoESLint React
Rules

jsx

Full Name in eslint-plugin-react-debug

react-debug/jsx

Full Name in @eslint-react/eslint-plugin

@eslint-react/debug/jsx

Features

🐞

Description

Reports all JSX elements and fragments.

Examples

tsconfig.json
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxFactory": "React.createElement",
    "jsxFragmentFactory": "React.Fragment",
    "jsxImportSource": "react"
  }
}
import React from "react";
 
const element = <div>Hello World</div>;
//              ^^^^^^^^^^^^^^^^^^^^^^
//              - [jsx element] jsx: 'react-jsx', jsxFactory: 'React.createElement', jsxFragmentFactory: 'React.Fragment', jsxRuntime: 'automatic', jsxImportSource: 'react'
/** @jsx Preact.h */
/** @jsxFrag Preact.Fragment */
/** @jsxImportSource preact */
/** @jsxRuntime classic */
 
import Preact from "preact";
 
const element = <div>Hello World</div>;
//              ^^^^^^^^^^^^^^^^^^^^^^
//              - [jsx element] jsx: 'react', jsxFactory: 'Preact.h', jsxFragmentFactory: 'Preact.Fragment', jsxRuntime: 'classic', jsxImportSource: 'preact'

Implementation

On this page