固定代码格式化程序插件-Prettier JetBrains

基本使用

  • 使用npm install prettier --save-dev为您的项目添加更漂亮或全局安装
  • 使用Prettier选择要格式化的代码或文件
  • 使用“Reformat with Prettier”操作(在MacOS上使用Alt-Shift-Cmd-P或在Windows和Linux上使用Alt-Shift-Ctrl-P)或使用“查找操作”弹出窗口(Cmd / Ctrl-Shift-A)

插件适用编辑器

 参考文档:http://plugins.jetbrains.com/plugin/10456-prettier

code自动格式化:https://prettier.io/docs/en/webstorm.html#running-prettier-on-save-using-file-watcher

自动格式化个人demo:将scope设置为currentFile,免去并行开发其他项目被格式化的问题。

 

posted @ 2019-06-10 20:43  比诺  阅读(1002)  评论(0编辑  收藏  举报