It seems airbnb-base eslint config makes no-confusing-arrow and arrow-body-style rules impossible to fix when ternary operator is used?
items.map(item => item.name ? item.name.en : null)
error Arrow function used ambiguously with a conditional expression no-confusing-arrow
http://eslint.org/docs/rules/no-confusing-arrow
items.map((item) => { return item.name ? item.name.en : null; })
error Unexpected block statement surrounding arrow body arrow-body-style
items.map(item => (item.name ? item.name.en : null))
Thanks. In my defence no-confusing-arrow rule doc shows (a) => (1 ? 2 : 3) as incorrect code and (a) => { return 1 ? 2 : 3; } as correct, didn't realise there is an option to reverse that.
PRs to improve the docs are always appreciated :-)
Most helpful comment
items.map(item => (item.name ? item.name.en : null))