jsx-eslint/eslint-plugin-react

[Bug]: jsx-curly-newline and comments

Open

#3.584 geöffnet am 7. Juni 2023

Auf GitHub ansehen
 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (8.630 Stars) (2.797 Forks)batch import
bughelp wanted

Beschreibung

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

jsx-curly-newline reports an error when using multiline comments in JSX.

      {/* <FormGroup
        helperTextInvalid={helperText}
        inputProps={inputProps}
        type="password"
      /> */}
  134:7   error  Unexpected newline after '{'                             react/jsx-curly-newline
  138:12  error  Unexpected newline before '}'                            react/jsx-curly-newline

$ eslint --ext .js,.jsx,.ts,.tsx .

Expected Behavior

I would expect no error.

Rule options

"react/jsx-curly-newline": ["error", { "multiline": "forbid", "singleline": "forbid" }],

eslint-plugin-react version

7.32.2

eslint version

7.32.0

node version

14.21.3

Contributor Guide