Skip to content

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

Closed

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);
}

Activity

  1. Timer commented on Jul 25, 2017

    @Timer
    Contributor

    I don't feel super strongly about this either way; options, @gaearon?

  2. added a commit that references this issue on Jan 8, 2018
    2e841cb
  3. added a commit that references this issue on Jan 8, 2018
    ce07e98
  4. gaearon commented on Jan 15, 2018

    @gaearon
    Contributor

    The fix is out in react-scripts@1.1.0! Please let us know if something doesn’t quite work.
    https://github.com/facebookincubator/create-react-app/releases/tag/v1.1.0

  5. added a commit that references this issue on Jul 10, 2018
    dbe3369
  6. locked and limited conversation to collaborators on Jan 20, 2019
  7. added a commit that references this issue on Oct 8, 2024
    d9c4f19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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