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