Skip to content

current eslint-config-react-app a little too restrictive for common use #2793

Closed
@kswope

Description

@kswope

Its set to

'no-cond-assign': ['warn', 'always'],

when it should be ( actually the default )

'no-cond-assign': ['warn', 'except-parens'],

Why is this important. For example, it makes the proper use of iterating of global regex matches whiney.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec

var myRe = /ab*/g;
var str = 'abbcdefabh';
var myArray;
while ((myArray = myRe.exec(str)) !== null) {
  var msg = 'Found ' + myArray[0] + '. ';
  msg += 'Next match starts at ' + myRe.lastIndex;
  console.log(msg);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions