

Detail configuration you can get it from here. prettierrc in your project root directory and add following basic configuration.

Step 5: Search for format on save in settings, and select Format a file on save. from Editor: Format on Save Step 4: Search for prettier in settings, select Require a prettier configuration file to format from Prettier: Require Config

Step 3: Open Settings, search with formatter text and set Editor: Default Formatter to Prettier - Code formatter Search for Prettier and click on install. Step 1: To install prettier using NPM you can type below command in VS terminal: npm install -save-dev -save-exact prettier Follow below steps to integrate it with VS Code: Extension Settings editor.wordWrapColumn controls the maximum line length. Usage To format an HTML or Handlebars document you have open, use the Format Document command. It is pretty good tool which format your code whenever you save your code. HTML Format for Visual Studio Code Formats HTML documents by auto-indenting, wrapping and removing unnecessary whitespace while preserving newlines. Today we are gonna use one of such tool called Prettier which support JavaScript, TypeScript, HTML, JSON or many other technologies. Để xem bảng các phím tắt này chúng ta có thể bật Visual Studio Code lên và vào các mục File > Preferences > Keyboard Shortcuts.While working with a team formatting code in a consistent style is a big challenge unless your IDE or tool is doing it. Tuy nhiên trong bài viết này tôi sẽ chỉ chia sẻ về các phím tắt của Visual Studio Code sẽ giúp chúng ta tối ưu các thao tác hơn trong quá trình xử lý.

Có rất nhiều các bài viết về tính năng vượt trội của nó so với các Code editor khác. Tuy nhiên, Visual Studio Code thì tôi đã hoàn toàn bị thuyết phục cho đến lúc này. Trong những năm qua, tôi đã sử dụng một loạt các Code Editor khác nhau TextMate, Php Storm, Sublime Text, Atom, và mỗi cái có những ưu điểm và nhược điểm khác nhau.
