jsx-wrap-multiline false positives
See original GitHub issueI think the case below should not cause error:
https://github.com/ant-design/ant-design-mobile/blob/master/components/accordion/demo/basic.tsx#L13
components/accordion/demo/basic.tsx[13, 9]: Multiline JSX elements must be wrapped in parentheses
// bad
const button = <button type="submit">
Submit
</button>;
// good
const button = (
<button type="submit">
Submit
</button>
);
// why this is bad ? any reason we need wrap inner button with parentheses?
const button = (
<div>
<button type="submit">
Submit
</button>
<div>
);
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Lint rules related to React & JSX for TSLint
Enforces that multiline JSX expressions are wrapped with parentheses. · Opening parenthesis must be followed by a newline. · Closing parenthesis ...
Read more >eslint-plugin-react | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >Eslint Plugin React v7.0.0 Release - GitClear
Fixed ; Fix no-unused-prop-types false positive with nextProps (#1079 @Kerumen) ; Fix prefer-stateless-function to not warn on classes with decorators (#1034 @ ...
Read more >Changelog - JavaScript Standard Style
This release brings better performance, tons of bug fixes, improved JSX, React ⚛️ ... around multiline JSX (react/jsx-wrap-multilines) #710 #1382 (0%) ...
Read more >eslint-config-dbk - npm
... "react/jsx-sort-prop-types": "off", "react/jsx-sort-props": [ "off" ... "react/wrap-multilines": "off", "react/jsx-first-prop-new-line": ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Another repro using React 16.2:
more false positives I’ve found: