Skip to content

Commit

Permalink
Add plugins config to README (#114)
Browse files Browse the repository at this point in the history
Closes #113

This adds a `plugins` config to the example in the `Usage` section of
the readme. It should work correctly in both Prettier 2 and 3, but is
now required for 3.
  • Loading branch information
IanVS authored Jul 26, 2023
1 parent 0cf0d27 commit 141f3eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ Add your preferred settings in your prettier config file.

/** @type {import("@ianvs/prettier-plugin-sort-imports").PrettierConfig} */
module.exports = {
printWidth: 80,
tabWidth: 4,
trailingComma: 'all',
// Standard prettier options
singleQuote: true,
semi: true,
// Since prettier 3.0, manually specifying plugins is required
plugins: ['@ianvs/prettier-plugin-sort-imports'],
// This plugin's options
importOrder: ['^@core/(.*)$', '', '^@server/(.*)$', '', '^@ui/(.*)$', '', '^[./]'],
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
Expand Down

0 comments on commit 141f3eb

Please sign in to comment.