yoavbls / pretty-ts-errors

🔵 Make TypeScript errors prettier and human-readable in VSCode 🎀
https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors
MIT License
13.14k stars 89 forks source link

ts(4113) and ts(4117) are formatted incorrectly #82

Closed jackssrt closed 1 week ago

jackssrt commented 9 months ago

Describe the bug ts(4113) and ts(4117) are formatted incorrectly if the base class is generic and there are quotes in the base class part of the error. For example: ts(4113)

class A<T extends string> {}

class B<T extends { nested: string }> extends A<T["nested"]> {
    override test: any;
}

ts(4117)

class A<T extends string> {
    public testA: any;
}

class B<T extends { nested: string }> extends A<T["nested"]> {
    override test: any;
}

Expected behavior It should probably be formatted as:

This member cannot have an override modifier because it is not declared in the base class A<T["nested"]>. ts(4113) and This member cannot have an override modifier because it is not declared in the base class A<T["nested"]>. Did you mean testA?ts(4117)

Original error If this bug is related to an error that is not formatting well, please attach the original error in a code block:

This member cannot have an 'override' modifier because it is not declared in the base class 'A<T["nested"]>'.ts(4113)
This member cannot have an 'override' modifier because it is not declared in the base class 'A<T["nested"]>'. Did you mean 'testA'?ts(4117)

Screenshots ts(4113) error being incorrectly formatted ts(4117) error being incorrectly formatted