Skip to content

[Bug]: If boolean props are in JSX, the react/jsx-no-literals rule in latest update(7.36.0) throws exception and breaks ESLINT #3820

Closed
@aswinsekar

Description

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

If there is a boolean props in JSX, there is an exception thrown in processing this rule and eslint broke down.

<a isBoolean>test</a>

[Error - 15:46:51] TypeError: Cannot read properties of null (reading 'type')
Occurred while linting <file_name>
Rule: "react/jsx-no-literals"
at JSXAttribute (/node_modules/.pnpm/eslint-plugin-react@7.36.0_eslint@8.57.0/node_modules/eslint-plugin-react/lib/rules/jsx-no-literals.js:506:44)
at ruleErrorHandler (/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/linter.js:1076:28)
at /node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/safe-emitter.js:45:38)

Happening in both CLI & IDE

Expected Behavior

No breakage in ESLINT setup

eslint-plugin-react version

v7.36.0

eslint version

v8.57.0

node version

v18.18.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions