Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: [member-delimiter-style] autofixer result is not as expected when comments after the delimiter with option delimiter: 'none' #5028

Closed
4 tasks done
holazz opened this issue May 21, 2022 · 1 comment · Fixed by #5029
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@holazz
Copy link
Contributor

holazz commented May 21, 2022

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=4.6.4&sourceType=module&code=C4TwDgpgBAYg9nKBeKBvAUFKBDAXFYAJwFcIBuKAegCpqoBnOAWwmAAsBLAOwHMprKVWg2YRMBTr36CARviKkKNOoxbtufAVADG+AGbYANvXJVBq1pJ7oAvuiA&rules=N4IgAgLgngDgpgZwMYCcCWMIFpEBs0B2EA9ALZykBGcKWAJnPqWhDVgtLnCAFwDaIAO4BDFARAAaUKQCuuCGnwFuPUAyYsavEAQD2ykAF9DAXUNA&tsConfig=N4XyA

Repro Code

type Foo = {
  a: true; /** something */ /** some
  thing */ b: true; /** something */ c: false; // something
}

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "@typescript-eslint/member-delimiter-style": ["warn", {
      "multiline": {
        "delimiter": "none"
      },
    }],
  },
};

tsconfig

{
  "compilerOptions": {
    // ...
  }
}

Expected Result

type Foo = {
  a: true /** something */ /** some
  thing */ b: true; /** something */ c: false // something
}

Actual Result

type Foo = {
  a: true; /** something */ /** some
  thing */ b: true; /** something */ c: false; // something
}

Additional Info

No response

Versions

package version
@typescript-eslint/eslint-plugin 5.25.0
@typescript-eslint/parser 5.25.0
TypeScript 4.6.4
ESLint 8.15.0
node 16.15.0
@holazz holazz added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels May 21, 2022
@holazz
Copy link
Contributor Author

holazz commented May 21, 2022

I missed the case with comments after the delimiter in #5023, as above. I have fixed it here, I'd love to submit another PR if you guys agree :)

@bradzacher bradzacher added accepting prs Go ahead, send a pull request that resolves this issue formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. and removed triage Waiting for maintainers to take a look labels May 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants