jsx-eslint/eslint-plugin-react

[Bug]: jsx-curly-newline and comments

開放

#3,584 建立於 2023年6月7日

 (6 則留言) (0 個反應) (0 位負責人)JavaScript (2,733 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (9,292 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南