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
{{ message }}
Repository navigation
Extend lint/formatting rule to enforce and auto change to code blocks #97
changed the title [-]Extend lint rule to enforce code blocks[/-][+]Extend lint/formatting rule to enforce and auto change to code blocks[/+]on Aug 23, 2026
Why is the first example bad? In that specific example, I do believe the one that's BAD is more readable. We already have a rule that requires code blocks for control statements (example attached), which makes sense to me. But I'm not sure about enforcing code blocks for everything, specially for simple statements like the one you shared.
It was a simplified example, i know there are situations where it is acceptable, but I want to avoid strange arrow functions that are hard to read. If you believe having it all inline is acceptable, you can always ignore that line and be specific.
// eslint-ignore rule-nameconstfoo=()=>"foo string";// <-- is now allowed
Activity
[-]extend lint rule to enforce code blocks[/-][+]Extend lint rule to enforce code blocks[/+][-]Extend lint rule to enforce code blocks[/-][+]Extend lint/formatting rule to enforce and auto change to code blocks[/+]hmd-ali commentedon Aug 24, 2026
Why is the first example bad? In that specific example, I do believe the one that's BAD is more readable. We already have a rule that requires code blocks for control statements (example attached), which makes sense to me. But I'm not sure about enforcing code blocks for everything, specially for simple statements like the one you shared.
wiktoriavh commentedon Aug 27, 2026
It was a simplified example, i know there are situations where it is acceptable, but I want to avoid strange arrow functions that are hard to read. If you believe having it all inline is acceptable, you can always ignore that line and be specific.
hmd-ali commentedon Aug 28, 2026
We can use eslint/arrow-body-style with the value of
as-neededandrequireReturnForObjectLiteral