简体   繁体   English

我可以自动化 Prettier 的“修复所有更漂亮/更漂亮的问题”吗?

[英]Can I automate Prettier's 'Fix all prettier/prettier problems'?

I currently have Prettier set up on VSCode to warn me when something is not correct.我目前在 VSCode 上设置了 Prettier,以在出现问题时警告我。 It's a pain to right click the underlined red to selected.右键单击带下划线的红色以选中它很痛苦。 'Fix all prettier/prettier problems' all the time.一直“修复所有更漂亮/更漂亮的问题”。 I was wondering if that could be automated?我想知道这是否可以自动化?

NB I use AutoSave on VSCode注意我在 VSCode 上使用 AutoSave

You can enable Prettier to run automatically on Ctrl+S by adding these lines to your Prettier configuration file:您可以通过将这些行添加到您的 Prettier 配置文件来启用 Prettier 在 Ctrl+S 上自动运行:

"[javascript]": {
    "editor.formatOnSave": true
}

Please, take a look here https://github.com/prettier/prettier-vscode#format-on-save .请看这里https://github.com/prettier/prettier-vscode#format-on-save

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM