If you followed the standard installation procedure, WebStorm locates the prettier package itself and the field is filled in automatically. In the Settings dialog ( Ctrl+Alt+S), go to Languages & Frameworks | JavaScript | Prettier.įrom the Prettier package list, select the prettier installation to use. Learn more about installation modes from the Prettier official website. Npm install -save-dev -save-exact prettier In the embedded Terminal ( Alt+F12), type one of the following commands: Install and configure Prettier in WebStorm Make sure the JavaScript and TypeScript and Prettier required plugins are enabled on the Settings | Plugins page, tab Installed, see Managing plugins for details. Learn more from Configuring a local Node.js interpreter. The Node interpreter field shows the default project Node.js interpreter. Make sure a local Node.js interpreter is configured in your project: open the Settings dialog ( Ctrl+Alt+S) and go to Languages & Frameworks | Node.js. Make sure you have Node.js on your computer. See Reformat code with Prettier for details. It will run against such files every time you reformat your code with Ctrl+Alt+L. You can configure Prettier to reformat specific files every time such file is changed and the changes are saved automatically or manually.Īlso, Prettier can be set as default formatter for specific files. WebStorm adds this action as soon as you install Prettier as a dependency in your project or globally on your computer. With WebStorm, you can format selected code fragments as well as entire files or directories using the Reformat with Prettier action.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |