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:

  1. Press ctrl + , to open settings
  2. Search for format
  3. Under default formatter select Prettier
  4. Make sure to check Editor: Format on save
  5. The code should now be formatted whenever you save your code
  6. (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 both Files: EOL and Prettier: End Of Line are set to \n.