gajus/eslint-config-canonical

Consider enabling `react/jsx-wrap-multilines`

Closed this issue · 2 comments

Copying from #2

I am just curious if there is a reason react/jsx-wrap-multilines has been disabled. Could it be renabled?

gajus commented

https://twitter.com/kuizinas/status/1158753045070659585

tl;dr;

My preference is to use <></> instead of braces because it does not restrict React element to a single element. There is no benefit to () over <></>. I saw ljharb argue that the former has the benefit of explicitly dictating that there is only 1 node being returned – which is fair enough, if that is a requirement. Unfortunately, there is no rule to enforce <></> either.

Naturally you can control this setting locally in your project.

I figured there was a good reason and was just curious.

My counter argument would be the Canonical style guide is to reduce noise in code version control. Until I can enforce fragments I'll be enabling this rule in my projects.

Thanks for taking the time to respond.