no-extra-parens confilct with no-confusing-arrow
See original GitHub issueESLint - v2.9.0 (and 2.10.1 - see below)
parser - default
this code:
set(val) {
let result = val;
if (_.isArray(val)) {
result = _.map(val, (str) => /*THERE*/(_.isString(str) ? str.replace(/\(|\)|\-|\s/g, '') : str));
}
this.setDataValue(fieldName, JSON.stringify(result));
}
– give “no-extra-parens” error.
and this:
set(val) {
let result = val;
if (_.isArray(val)) {
result = _.map(val, /*THERE*/(str) => _.isString(str) ? str.replace(/\(|\)|\-|\s/g, '') : str);
}
this.setDataValue(fieldName, JSON.stringify(result));
}
– give “no-confusing-arrow” error
"no-confusing-arrow": [
2,
{
"allowParens": true
}
],
"no-extra-parens": [
2,
"all",
{
"conditionalAssign": true,
"nestedBinaryExpressions": false
}
],
– part of configuration
I already have tried update ESlint to 2.10.1, and change configuration to:
"no-extra-parens": [
2,
"all",
{
"conditionalAssign": false,
"nestedBinaryExpressions": false,
"returnAssign": false
}
],
It did not help.
I expect, that “no extra parens” error would not appear in that case.
Issue Analytics
- State:
- Created 7 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
no-confusing-arrow and no-extra-parens conflict · Issue #10997
Tell us about your environment ESLint Version: 5.7.0 Node Version: 10.12.0 npm Version: 6.4.1 What parser (default, Babel-ESLint, etc.)
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 >no-confusing-arrow - ESLint - Pluggable JavaScript Linter
This rule warns against using the arrow function syntax in places where it could be confused with a comparison operator.
Read more >typescript-eslint.js - Renovate Bot Package Diff
Changed: The CLI helper tool now considers [no-confusing-arrow] to conflict if you use the default value of its `allowParens` option.
Read more >https://raw.githubusercontent.com/prettier/eslint-...
Thanks to Masafumi Koba (@ybiquitous)! ### Version 6.0.0 (2019-06-25) - Changed: The CLI helper tool now considers [no-confusing-arrow] to conflict if you ...
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
@eslint/eslint-team Do we want to support this change? It’s been a while since the last comment, but seems like we should at least discuss
@edoroshenko i can try resolve this issue today, have some time for this 😄