You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exporttypeTest<T>=Textends infer Pextendsstring ? P : never;
result in the following error when running prettier with prettier-plugin-sort-imports enabled:
[error] test.ts: SyntaxError: Unexpected token, expected "?" (1:40)
[error] 1 | export type Test<T> = T extends infer P extends string ? P : never;
[error] 2 |
Note that this error is not present when manually selecting babel-ts as the prettier parser or running prettier with --no-plugin-search to disable the plugin.
Expected behavior
No error for this syntax when using prettier with the typescript parser and prettier-plugin-sort-imports.
The text was updated successfully, but these errors were encountered:
I apologize if this has been discussed previously here, but instead of pinning dependencies on exact versions, wouldn't it be better to allow any version of dependencies that are on the same major?
I apologize if this has been discussed previously here, but instead of pinning dependencies on exact versions, wouldn't it be better to allow any version of dependencies that are on the same major?
Your Environment
Describe the bug
prettier-plugin-sort-imports results in SyntaxError when combined with
typescript
parser and newer syntax for Typescript types, cf https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#extends-constraints-on-infer-type-variables.To Reproduce
test.ts
:result in the following error when running prettier with
prettier-plugin-sort-imports
enabled:Note that this error is not present when manually selecting
babel-ts
as the prettier parser or running prettier with--no-plugin-search
to disable the plugin.Expected behavior
No error for this syntax when using prettier with the
typescript
parser andprettier-plugin-sort-imports
.The text was updated successfully, but these errors were encountered: