conflict with react/jsx-curly-newline
See original GitHub issueHey @sheerun, I came across some conflict between prettier-standard
and eslint with standard
and standard-jsx
presets included.
Example:
const A: React.FC = ({ children }) => <div>{children}</div>
const B: React.FC<{ onDelete: () => void }> = ({ children }) => (
<div>{children}</div>
)
const MyComponent: FunctionComponent = () => {
const someLongMethodHandlerName = (obj: {
parameter1: string
parameter2: string
}) => {}
return (
<A>
<B
onDelete={() =>
someLongMethodHandlerName({
parameter1: 'parameter1',
parameter2: 'parameter2'
})
}
>
B
</B>
</A>
)
}
^^ this is how prettier-standard formats the code,
but eslint with standard
and standard-jsx
presets expects the next version
const A: React.FC = ({ children }) => <div>{children}</div>
const B: React.FC<{ onDelete: () => void }> = ({ children }) => (
<div>{children}</div>
)
const MyComponent: FunctionComponent = () => {
const someLongMethodHandlerName = (obj: {
parameter1: string
parameter2: string
}) => {}
return (
<A>
<B
onDelete={() =>
someLongMethodHandlerName({
parameter1: 'parameter1',
parameter2: 'parameter2'
- })
- }
+ . })}
>
B
</B>
</A>
)
}
Is it some expected behaviour or is it a bug? If you need any other information, please let me know.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
react/jsx-curly-newline rule in conflict with eslint-config-airbnb
eslint-config-airbnb enabled the rule react/jsx-curly-newline in version 18. ... This is in conflict with the current config for eslint-config- ...
Read more >eslint object-curly-newline conflicts prettier multi-line rationale
In your .eslintrc.js add this to your rules . ... is a configuration-option for this rule, which you can look up here object-curly-newline....
Read more >object-curly-newline - ESLint - Pluggable JavaScript Linter
"consistent": true (default) requires that either both curly braces, or neither, directly enclose newlines.
Read more >conflict with react/jsx-curly-newline - Bountysource
Hey @sheerun, I came across some conflict between prettier-standard and eslint with standard and standard-jsx presets included. Example:
Read more >eslint-config-prettier | Yarn - Package Manager
Added: react/jsx-newline. Version 7.1.0 (2020-12-19). Added: unicorn/empty-brace-spaces. Thanks to fisker Cheung (@fisker)!. Version 7.0.0 (2020-12-05). Changed ...
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 FreeTop 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
Top GitHub Comments
Yes. Maybe you can try it first? Just describe this formatting in standard-jsx and show prettier-standard formatting
On Sun, 1 Dec 2019 at 09:44, Uladzimir Havenchyk notifications@github.com wrote:
prettier-standard version looks better to me 😃 I’d consider it the bug in standard the same way as #76