Skip to content

Bug: [no-confusing-void-expression] Wrong autofix for a ? void : T #6187

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

Closed
4 tasks done
liuxingbaoyu opened this issue Dec 8, 2022 · 0 comments · Fixed by #7674
Closed
4 tasks done

Bug: [no-confusing-void-expression] Wrong autofix for a ? void : T #6187

liuxingbaoyu opened this issue Dec 8, 2022 · 0 comments · Fixed by #7674
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@liuxingbaoyu
Copy link
Contributor

liuxingbaoyu commented Dec 8, 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.9.3&sourceType=module&code=MYewdgzgLgBAtgQwJ4CMCmBRATllDgDWMAvDABQCUJAfDAN4CwAUDDADZqwIkwCMA3M1ZZOAVyxgY3APzkAZqLDAoAS3DkqdGAF8KlGAC4pgptpPNmaAB4AHEFlgATNHISi2sOtqA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYkACAXAngA4oDG0AlobgLQrzkB2uA9AwPbUlsMBmsyjAObUAbm3IATWgA9C0FAO7ooiaNDbRIAXxBagA&tsconfig=N4XyA

Repro Code

const maybeErrback = () => {
  let a = 1;
  return a ? (function () { })() : a;
};


export default {}

ESLint Config

module.exports = {
  "rules": {"@typescript-eslint/no-confusing-void-expression": "error"}
}

tsconfig

{}

Expected Result

Don't report it or disable automatic fixes.

Actual Result

was wrongly fixed.

const maybeErrback = () => {
  let a = 1;
  a ? (function () { })() : a;
};


export default {}

Additional Info

No response

@liuxingbaoyu liuxingbaoyu added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Dec 8, 2022
@bradzacher bradzacher added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Dec 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2023
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 package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants