Skip to content

[no-invalid-void-type] Intersection with never should be allowed #1946

Closed
@jens-duttke

Description

@jens-duttke

Repro

{
  "rules": {
    "@typescript-eslint/no-invalid-void-type": "error"
  }
}
function foo (): void | never {
    throw new Error('Test');
}

Expected Result

That the no-invalid-void-type does not complain about the void | never union.

Actual Result

void is only valid as a return type or generic type variable [Error/@typescript-eslint/no-invalid-void-type]

Versions

package version
@typescript-eslint/eslint-plugin 2.30.0
@typescript-eslint/parser 2.30.0
TypeScript 3.9.0-dev.20200419
ESLint 6.8.0
node 13.6.0
npm 6.14.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy