Skip to content

eslint --fix with dot-location breaks code #11868

@nightpool

Description

@nightpool
  • ESLint Version: 5.16.0
  • Node Version: 8.1.4
  • npm Version: 6.7.0

ESLint playground link

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

/*eslint dot-location: ["error", "object"]*/

var foo = (
  cond1 == true &&
  cond2func()
).toString();
eslint --fix

What did you expect to happen?

No change to file

What actually happened? Please include the actual, raw output from ESLint.

/*eslint dot-location: ["error", "object"]*/

var foo = (
  cond1 == true &&
  cond2func().
)toString();

As you can see, this code doesn't even parse. eslint --fix should never break correctness and certainly shouldn't ever output something that fails to parse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions