-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript 4.9 satisfies operator causes error #204
Comments
@trivago ? |
For anyone using pnpm here's a temporary fix I'm using. In package.json (if using a monorepo this is the root package.json) add: "pnpm": {
"overrides": {
"@trivago/prettier-plugin-sort-imports>@babel/core": "7.20.12",
"@trivago/prettier-plugin-sort-imports>@babel/parser": "7.20.15",
"@trivago/prettier-plugin-sort-imports>@babel/traverse": "7.20.13"
}
}, In your prettier config add: "overrides": [
{
"files": ["*.ts", "*.tsx"],
"options": {
"parser": "typescript",
"importOrderParserPlugins": ["typescript", "jsx"]
}
}
] |
Thanks |
The npm version of @reiss-d's fix: {
"overrides": {
"@trivago/prettier-plugin-sort-imports": {
"@babel/core": "^7.20.12",
"@babel/parser": "$@babel/core",
"@babel/traverse": "$@babel/core"
}
}
} Because of a bug of npm, You will need to either remove Edit: I got prettier worked successfully without modifying |
This sort of issue happens every time TypeScript introduces new syntax. For example, we also had this problem back when TypeScript added Instantiation Expressions in v4.7. To prevent these sort of issues from re-occurring I believe the following issue should be addressed: #141 |
Relevant issue for the package.json changes for the '@trivago/prettier-plugin-sort-imports' package trivago/prettier-plugin-sort-imports#204
Relevant issue for the package.json changes for the '@trivago/prettier-plugin-sort-imports' package trivago/prettier-plugin-sort-imports#204
Relevant issue for the package.json changes for the '@trivago/prettier-plugin-sort-imports' package trivago/prettier-plugin-sort-imports#204
See also: prettier/prettier#13951
The text was updated successfully, but these errors were encountered: