Skip to content
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

umi4按照官网文档启用prettier后,在vscode里手动格式化ts/tsx等文件报错 #11160

Closed
puhanjie opened this issue May 18, 2023 · 2 comments · Fixed by #11162
Closed

Comments

@puhanjie
Copy link

What happens?

按照umi4官网文档使用pnpm dlx create-umi@latest创建了umi项目后,再到项目根目录下执行pnpm umi g来启用prettier,然后再任意打开项目中的ts或tsx文件,用vscode的代码格式化快捷键 Shift+Alt+F 手工给文件格式化时,vscode就报错,如下:
image

Mini Showcase Repository(REQUIRED)

复现仓库地址:https://github.com/puhanjie/umi

How To Reproduce

  1. 确保vscode安装了Prettier - Code formatter插件
  2. 项目中打开任意一个ts或tsx或者其他文件,使用快捷键 Shift+Alt+F 格式化文件,就会跳出报错

Context

  • Umi Version:Umi4
  • Node Version:18.16
@xiaohuoni
Copy link
Member

更新 "prettier-plugin-organize-imports": "^3.2.2",
simonhaenisch/prettier-plugin-organize-imports@63011a2

@puhanjie
Copy link
Author

更新插件版本后已解决,谢谢

@fz6m fz6m closed this as completed May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants