Skip to content

🐛 useConsistentCurlyBraces breaks react/no-unescaped-entities rule #5391

Open
@fregante

Description

@fregante

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v22.14.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "bun/1.1.32"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 false

Workspace:
  Open Documents:               0

What happened?

See https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md, also requested in #4491

{
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
  "linter": {
    "rules": {
      "recommended": false,
      "nursery": {
        "useConsistentCurlyBraces": "error"
      }
    }
  }
}

With the input:

function statement() {
  return <strong>Jupiter {">"} Venus</strong>
}
function other() {
  return <strong>{'"Moon\'s orbit is "huuuge"'}</strong>
}

is turned into

function statement() {
  return <strong>Jupiter > Venus</strong>
}

function other() {
  return <strong>Moon's orbit is "huuuge"</strong>
}

which is respectively invalid and breaking no-unescaped-entities

Expected result

See above

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid buggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions