How to install prettier and format on save - ntnu-informatikk-2021/SDG-ontology-visualizer GitHub Wiki
Download Prettier for your text editor. If you don't find it, use VSCode and press Ctrl+Shift+X, then look for Prettier. To format your code with prettier everytime you save your code:
- Press
ctrl + ,
to open settings - Search for
format
- Under default formatter select Prettier
- Make sure to check
Editor: Format on save
- The code should now be formatted whenever you save your code
- (only Windows). The way the operating system detects a line ending differs from Mac/Linux and Windows. If you're using Windows you have to go back to settings (
ctrl + ,
) and make sure bothFiles: EOL
andPrettier: End Of Line
are set to \n.