From 7962e745bbe9bb1417ba0308542469f378c212f1 Mon Sep 17 00:00:00 2001 From: Nathan Totten Date: Mon, 15 Mar 2021 10:07:26 -0400 Subject: [PATCH] updated readme --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 666d53b69..076b97bfe 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,16 @@ The following will use Prettier for only Javascript. } ``` +Additionally, you can disable format on save for secific languages if you don't want them to be automatically formatted. + +```json +{ + "[javascript]": { + "editor.formatOnSave": false + } +} +``` + ### Prettier Resolution This extension will use prettier from your project's local dependencies (recommended). When the `prettier.resolveGlobalModules` is set to `true` the extension can also attempt to resolve global modules. Should prettier not be installed locally with your project's dependencies or globally on the machine, the version of prettier that is bundled with the extension will be used. @@ -122,9 +132,7 @@ Using [Prettier Configuration files](https://prettier.io/docs/en/configuration.h ### Configuring Default Options -Some users may not wish to create a new Prettier config for every project or use the VS Code settings. Because Prettier searches recursively up the file path, you can place a global prettier config at `~/.prettierrc` to be used as a fallback. - -You can also use the setting [`prettier.configPath`](https://github.com/prettier/prettier-vscode#prettierconfigpath) to provide a global configuration. However, be careful, if this is set this value will always be used and local configuration files will be ignored. +Some users may not wish to create a new Prettier config for every project or use the VS Code settings. In order to set a default configuraiton, set [`prettier.configPath`](https://github.com/prettier/prettier-vscode#prettierconfigpath). However, be careful, if this is set this value will always be used and local configuration files will be ignored. ### Visual Studio Code Settings @@ -181,6 +189,10 @@ json graphql ``` +### Format Document (Forced) + +If you would like to format a document that is configured to be ignored by Prettier either because it is in a `.prettierignore` file or part of a normally excluded location like `node_modules`, you can run the command **Format Document (Forced)** to force the document to be formatted. + ## Linter Integration The recommended way of integrating with linters is to let Prettier do the formatting and configure the linter to not deal with formatting rules. You can find instructions on how to configure each linter on the Prettier docs site. You can then use each of the linting extensions as you normally would. For details refere to the [Prettier documentation](https://prettier.io/docs/en/integrating-with-linters.html).