8000 Bug: [no-confusing-void-expression] Wrong autofix for `a ? void : T` · Issue #6187 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

< 8000 div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;">
Skip to content
Bug: [no-confusing-void-expression] Wrong autofix for a ? void : T #6187
Closed
@liuxingbaoyu

Description

@liuxingbaoyu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething 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

      0