简体   繁体   中英

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. 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

You can enable Prettier to run automatically on Ctrl+S by adding these lines to your Prettier configuration file:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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