Skip to content

linter: react/jsx-curly-brace-presence does not flag empty string literals {""} #20688

@Mad-Kat

Description

@Mad-Kat

What version of Oxlint are you using?

1.56.0

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{
  "categories": {
    "correctness": "off"
  },
  "plugins": ["react"],
  "rules": {
    "react/jsx-curly-brace-presence": ["error", { "props": "never", "children": "never" }]
    }
  }

What happened?

react/jsx-curly-brace-presence with { "props": "never", "children": "never" } does not flag empty string literals wrapped in curly braces ({""}), while ESLint's equivalent rule does.

// Not flagged by oxlint, but flagged by ESLint
<Image alt={""} />
<Timeline title={""} />
// Should be auto-fixed to:
<Image alt="" />
<Timeline title="" />

Expected behavior

{""} in JSX props should be flagged as "Curly braces are unnecessary here" and auto-fixed to "", matching ESLint's behavior.

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions