Skip to content
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

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

Closed
mdouglass opened this issue Jul 26, 2020 · 2 comments · Fixed by #2316
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@mdouglass
Copy link

mdouglass commented Jul 26, 2020

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
@mdouglass mdouglass added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jul 26, 2020
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Jul 26, 2020
@bradzacher
Copy link
Member

This is fixed by #2316. I accidentally introduced a regression in the AST.
This will be released tomorrow morning - you can try the canary tag on NPM in the meantime.

@mdouglass
Copy link
Author

Awesome, thank you. I'll give it a try shortly.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants