-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
class Base { }
class Derived extends Base { }
const foo = new Base();
const bar = new Derived();
`${foo}${bar}`;ESLint Config
{
"rules": {
"@typescript-eslint/restrict-template-expressions": [
"error",
{ "allow": ["Base"]}
]
}
}tsconfig
Expected Result
No warnings - if Base is allowed and every instance of Derived is also a Base, then Derived should be allowed. (This would also be consistent with the no-base-to-string rule - see #11520.)
Actual Result
Invalid type "Derived" of template literal expression. 5:10 - 5:13
Additional Info
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look
{ "rules": { "@typescript-eslint/restrict-template-expressions": [ "error", { "allow": ["Base"]} ] } }