Skip to content

Strange behaviour of react/jsx-curly-brace-presence/react/self-closing-comp #437

@dimaMachina

Description

@dimaMachina

Initial checklist

Affected packages and versions

2.0.5

Link to runnable example

No response

Steps to reproduce

// test.mdx

```jsx
let a = (
  <App prop="foo">{'bar'}</App> // ❌ error  Curly braces are unnecessary here  react/jsx-curly-brace-presence
)
```

<App prop="foo">{'bar'}</App> // 😬 nothing here

and

```jsx
let a = <App prop={'foo'}>bar</App> ❌ error  Curly braces are unnecessary here  react/jsx-curly-brace-presence
```

<App prop={'foo'}>bar</App> ❌ error  Curly braces are unnecessary here  react/jsx-curly-brace-presence / error  Empty components are self-closing  react/self-closing-comp

Expected behavior

should report only react/jsx-curly-brace-presence errors

Actual behavior

reports react/jsx-curly-brace-presence and react/self-closing-comp

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions