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

特性: 更快速的代码格式化 #39

Open
liujinxing opened this issue Sep 29, 2020 · 0 comments
Open

特性: 更快速的代码格式化 #39

liujinxing opened this issue Sep 29, 2020 · 0 comments

Comments

@liujinxing
Copy link
Member

ts-lib-scripts 目前采用 eslint + prettier 处理代码格式化的,对于大型代码库来说,速度很慢,严重影响开发体验,体现在:

  • git提交集成了代码格式化,导致提交非常缓慢
  • vscode 调用 eslint + prettier 进行自动格式化代码,有时导致 vscode 卡顿,甚至卡死

社区出现一些基于 wasm 的更快速的代码格式化方案,如:

根据社区的测试,dprint 性能是 prettier 的 5 倍,deno fmt 性能是 prettier 的 17 倍。(其中 deno fmt 内部采用了dprint,二者之间的内部差距可能是采用 wasm 的方式不同导致)。内部需要做性能测试,验证性能提升幅度,和对开发体验的提升。

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

No branches or pull requests

1 participant