Koki's personal blog

Koki's personal blog

Another fine, responsive site template by HTML5 UP.

Ignore auto-formatting a specific language on VS Code (Using Prettier)

This article explains how to ignore auto-formatting a specific language on VS Code. (Using Prettier)

Koki

1-Minute Read

This article explains how to gnore auto-formatting a specific language on VS Code (Using Prettier).

The following lists are the table of contents about this article.

Target audience

  • Those who want to switch the on-off auto-formatting function on a specific language

Environment

  • Visual Studio Code

Preconditions

  • Install Prettier (Prettier is VS Code extention)

Edit setting.json

1. Open setting.json

Pushing Ctrl + Shift + P simultaneously then choosing Preferences: Open Settings(JSON).
If your environment is Mac OS, push Command + Shift + P instead of Ctrl + Shift + P.

2. Disable specific language auto-formatting function

Add the below line to a specific language section.

"editor.formatOnSave": false

e.g. Add to markdown section.

  "[markdown]": {
    "editor.formatOnSave": false
  },

When a specific language section does not exist in the setting.json, you can add a new section yourself.
You can know from what language can use to add the new section that checking the below page.
Language Identifiers#Known language identifiers

Reference articles

prettier / prettier-vscode

Recent Posts

See More

categories

About