When formatting Typescript, prettier reports there is a missing semicolon in the middle of typecasting a generic function. Specifically, it reports that there should be a semicolon before the as in this code:
function func<T>() {};
const x = func<number> as any;
This error does not happen if the @trivago/prettier-plugin-sort-imports plugin is not included.
To Reproduce
Run prettier on the above code snippet with @trivago/prettier-plugin-sort-imports installed.
Expected behavior
Prettier should output no errors.
Screenshots, code sample, etc
Minimal repro - repro.ts:
function func<T>() {};
const x = func<number> as any;
Your Environment
Describe the bug
When formatting Typescript, prettier reports there is a missing semicolon in the middle of typecasting a generic function. Specifically, it reports that there should be a semicolon before the
as
in this code:This error does not happen if the
@trivago/prettier-plugin-sort-imports
plugin is not included.To Reproduce Run prettier on the above code snippet with
@trivago/prettier-plugin-sort-imports
installed.Expected behavior
Prettier should output no errors.
Screenshots, code sample, etc
Minimal repro -
repro.ts
:Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Error log
Contribute to @trivago/prettier-plugin-sort-imports