question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no-extra-parens confilct with no-confusing-arrow

See original GitHub issue

ESLint - 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:closed
  • Created 7 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

7reactions
kaicataldocommented, Aug 26, 2016

@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

4reactions
alexander-akaitcommented, Mar 22, 2017

@edoroshenko i can try resolve this issue today, have some time for this 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found