Skip to content

[member-delimiter-style] member-delimiter-style autofixer produces invalid code with {delimiter: 'none'} #2982

@pfgithub

Description

@pfgithub
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

.eslintrc.json

{
  "parser": "@typescript-eslint/parser",
  "plugins": ["@typescript-eslint"],
  "rules": {
    "@typescript-eslint/member-delimiter-style": ["warn", {"multiline": {"delimiter": "none"}}]
  }
}

test.ts:

type Test = {
    a: {
        one: 1
    }; b: 2
};

eslint --fix test.ts

Expected Result

Autofix would not be enabled for this comma

  4:7  warning  Unexpected separator (;)  @typescript-eslint/member-delimiter-style

Actual Result

Autofixer created invalid code

type Test = {
    a: {
        one: 1
    } b: 2
//  ^ 4:6  error  Parsing error: ';' expected
};

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.14.1
@typescript-eslint/parser 4.14.1
TypeScript 4.1.3
ESLint 7.18.0
node 14.15.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions