You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read properties of undefined (reading 'loc')
Occurred while linting .../Foo.tsx:1
Rule: "react/jsx-newline"
at isMultilined (\node_modules\eslint-plugin-react\lib\rules\jsx-newline.js:23:15)
at \node_modules\eslint-plugin-react\lib\rules\jsx-newline.js:111:22
at Array.forEach ()
at \node_modules\eslint-plugin-react\lib\rules\jsx-newline.js:87:27
at Set.forEach ()
at Program:exit (\node_modules\eslint-plugin-react\lib\rules\jsx-newline.js:86:27)
at ruleErrorHandler (\node_modules\eslint\lib\linter\linter.js:1051:28)
at \node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
I tried to take out parts from the code line by line and when the { ...Array.from(this.children) } part is missing then it works well.
(a few minutes later)
Ok, the rule is broken when you wanna use spread something in the JSX.
Is there an existing issue for this?
Description Overview
The jsx-newline rule is broken with this options on the given source code.
Oops! Something went wrong! :(
ESLint: 8.49.0
TypeError: Cannot read properties of undefined (reading 'loc')
Occurred while linting .../Foo.tsx:1
Rule: "react/jsx-newline"
at isMultilined (\node_modules\eslint-plugin-react\lib\rules\jsx-newline.js:23:15)
at \node_modules\eslint-plugin-react\lib\rules\jsx-newline.js:111:22
at Array.forEach ()
at \node_modules\eslint-plugin-react\lib\rules\jsx-newline.js:87:27
at Set.forEach ()
at Program:exit (\node_modules\eslint-plugin-react\lib\rules\jsx-newline.js:86:27)
at ruleErrorHandler (\node_modules\eslint\lib\linter\linter.js:1051:28)
at \node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach ()
at Object.emit (\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
I tried to take out parts from the code line by line and when the { ...Array.from(this.children) } part is missing then it works well.
(a few minutes later)
Ok, the rule is broken when you wanna use spread something in the JSX.
Expected Behavior
The rule autofixes the code to this:
eslint-plugin-react version
v7.33.2
eslint version
v8.49.0
node version
v20.3.1
The text was updated successfully, but these errors were encountered: