jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
8.86k stars 2.76k forks source link

[Bug]: allowExpression in react/jsx-no-useless-fragment #3710

Open YuriyDyachkov opened 3 months ago

YuriyDyachkov commented 3 months ago

Is there an existing issue for this?

Description Overview

image

I added the allowExpression: true option to my config, but the empty fragment still shows the error.

Expected Behavior

There shouldn't be any mistakes. What did I miss?

eslint-plugin-react version

7.32.2

eslint version

8.15.0

node version

16

ljharb commented 3 months ago

“nothing” isn’t an expression.

Why return an empty fragment instead of undefined or null?