Skip to content

[no-type-alias] Rule fails with "Unhandled in union types are not allowed." when encountering null #2328

@mdouglass

Description

@mdouglass

Repro

{
  "rules": {
    "@typescript-eslint/no-type-alias": [
      "error",
      {
        "allowAliases": "always",
        "allowCallbacks": "always",
        "allowLiterals": "in-unions-and-intersections",
        "allowMappedTypes": "always",
        "allowTupleTypes": "always",
      },
    ]
  }
}
export type Value = null | string | number

Expected Result
No errors

Actual Result
Unhandled in union types are not allowed.eslint@typescript-eslint/no-type-alias

Versions

package version
@typescript-eslint/eslint-plugin 3.7.0
@typescript-eslint/parser 3.7.0
TypeScript 3.9.7
ESLint 7.5.0
node 14.6.0
npm 6.14.6

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

      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