Skip to content

Bug: [no-type-alias] template literals are unhandled #5043

Closed
@burtek

Description

@burtek

Before You File a Proposal Please Confirm You Have Done The Following...

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Link to the rule's documentation

https://typescript-eslint.io/rules/no-this-alias/

Description

Currently when aliasing template literal type, an error is thrown with message "Type unhandled are not allowed"

image

This rule should recognise template literal type. Additionally, a new option allowTemplateLiteral should be introduced to control rule's behaviour similarly to other options in this rule.

Fail

// with allowTemplateLiteral: false (default)
type SlashCommand = `/${string}`

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