Conflicting rules 'no-confusing-arrow' and 'arrow-body-style'
See original GitHub issueCurrently I’m using eslint
with the airbnb config to lint my project. However since the last update (6.0.1) i’ve found somewhat conflicting rules, the ‘no-confusing-arrow’ rule and the ‘arrow-body-style’ rule.
Take this piece of code:
export const conflict = (a) => a > 1 ? 'yes' : 'no';
This triggers the no-confusing-arrow
rule.
According to the rule it should be written as following:
export const conflict = (a) => {
return a > 1 ? 'yes' : 'no';
};
However this triggers the arrow-body-style
rule.
Any idea how to solve this while keeping the shorthand if?
Versions used:
"eslint": "^2.2.0",
"eslint-config-airbnb": "^6.0.1",
Issue Analytics
- State:
- Created 8 years ago
- Reactions:13
- Comments:5 (1 by maintainers)
Top Results From Across the Web
eslint-config-prettier/README.md - UNPKG
Turns off all rules that are unnecessary or might conflict with [Prettier]. 4. 5, This lets you use you favorite shareable config without...
Read more >arrow-body-style - ESLint - Pluggable JavaScript Linter
This rule can enforce or disallow the use of braces around arrow function body. Options. The rule takes one or two options. The...
Read more >ESLint `no-confusing-arrow` "--fix" formatting conflict on save ...
I have "auto format" on save enabled in VSCode. For example this has an ESLint error of no-confusing-arrow : getOptionSelected={option => typeof ...
Read more >eslint-config-prettier | Yarn - Package Manager
Turns off all rules that are unnecessary or might conflict with [Prettier]. This lets you use your favorite shareable config without letting its...
Read more >eslint-config-prettier - Awesome JS
Turns off all rules that are unnecessary or might conflict with Prettier. ... See the arrow-body-style and prefer-arrow-callback issue for details.
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
Does it work if you use parentheses?
worked for me