Skip to content

Commit

Permalink
docs(readme): add usage instructions for Prettier 3
Browse files Browse the repository at this point in the history
Closes #102.

Co-authored-by: James <5511220+Zamiell@users.noreply.github.com>
  • Loading branch information
simonhaenisch and Zamiell committed Jul 13, 2023
1 parent ed94b3e commit ac62248
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ Note that _`prettier` and `typescript` are peer dependencies, so make sure you h

## Usage

### Prettier 3

Automatic plugin discovery [has been removed](https://github.com/prettier/prettier/pull/14759). Thus you need to configure Prettier to use the plugin according to the [Plugins docs](https://prettier.io/docs/en/plugins.html), for example by adding it to the `plugins` config option:

```json
{
"plugins": ["prettier-plugin-organize-imports"]
}
```

### Prettier 2

The plugin will be loaded by Prettier automatically. No configuration needed.

Note that automatic plugin discovery is not supported with some package managers, e. g. Yarn PnP (see https://github.com/prettier/prettier/issues/8474). In that case follow the instructions for Prettier 3 above.
Expand Down Expand Up @@ -78,6 +90,8 @@ This plugin acts outside of [Prettier's scope](https://prettier.io/docs/en/ratio

## Changelog

Version `3.2.3` updates the readme with instructions for Prettier 3.

Version `3.2.2` fixes a performance regression introduced in `3.2.0`.

Version `3.2.1` fixes the implementation of the language service host's `getCurrentDirectory` method to return the directory containing the tsconfig, rather than using `ts.sys.getCurrentDirectory` (which returns `process.cwd()`). This should prevent issues with resolving compiler plugins with Volar (which is used for Vue support).
Expand Down

0 comments on commit ac62248

Please sign in to comment.