typescript-coverage-report
typescript-coverage-report copied to clipboard
Bug: Syntax highlighter has a bug
Describe the bug The syntax highlighter used has a bug with backticks.
To Reproduce
Add the following to a file and run typescript-coverage-report. Open the html file and you'll see the highlighting breaks
/**
* see #54
*/
export type Path<T, Key extends keyof T = keyof T> = Key extends string
? T[Key] extends Record<string, any>
?
| `${Key}.${Path<T[Key], Exclude<keyof T[Key], keyof any[]>> & string}`
| `${Key}.${Exclude<keyof T[Key], keyof any[]> & string}`
| Key
: never
: never;
export type PathValue<T, P extends Path<T>> = P extends `${infer Key}.${infer Rest}`
? Key extends keyof T
? Rest extends Path<T[Key]>
? PathValue<T[Key], Rest>
: never
: never
: P extends keyof T
? T[P]
: never;
Expected behaviour It to not break.
Screenshots

Environment
- Tool version: 0.6.0
- OS: N/A
- Node version: N/A
- Browser (if applicable): [e.g. chrome, safari] N/A
Additional context Same issue in all browsers leading me to believe it's an issue with the code on generation but I could be wrong.
I think the ` causes problems to codemirror. I wonder if just upgrading the version fixes the problem.
If I paste the same code in this codemirror playground I get the same. Even trying to upgrade to the latest version of codemirror.
Related? https://github.com/codemirror/CodeMirror/issues/5774
@OmgImAlexis yes seems to be the exact issue.
@alexcanessa should be fixed in https://github.com/codemirror/CodeMirror/commit/472b458a31c2236a7088e4fb5d4bf3b04e8c91fa can you please update.