Skip to content

Incorrect indentation reported from 7.29.0 #3218

@quiram

Description

@quiram

We have a particular issue after upgrading eslint-plugin-react to 7.29.0 from 7.28.0: indentation doesn't seem to be counted correctly in some cases, resulting in false positives. Take this code snippet:

    case 'multiChoice':
      for (let i = 0; i < obj.options.length; i += 1) {
        options[i] = new Option(obj.options[i].description, parse(obj.options[i].option));
      }
      return new MultiChoiceNode(obj.question, // This is line 34 in the original file
        obj.questionKey,
        options,
        parse(obj.singleOpening),
        parse(obj.multipleOpening),
        parse(obj.singleClosing),
        parse(obj.multipleClosing));

Running the linter on this file with 7.28.0 causes no problem, but from 7.29.0 it results in the following error:

TemplateParser.js:34:7: Expected indentation of 6 space characters but found 8. [Error/react/jsx-indent]

Note that the indentation in line 34 is indeed 6 spaces, not 8 as the error message reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions