Skip to content

Commit 22389e3

Browse files
authored
Merge pull request #273 from matzkoh/fix/add-option-docs
fix: add type declaration file and document packageSortOrder option
2 parents ca9c2ca + 14f93e6 commit 22389e3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,20 @@ module.exports = {
3535
plugins: ['prettier-plugin-packagejson'],
3636
}
3737
```
38+
39+
## Options
40+
41+
### `packageSortOrder`
42+
43+
Custom ordering array for `package.json` fields. This option is passed to [sort-package-json]'s `sortOrder` option.
44+
45+
**Type:** `string[]`
46+
**Default:** `[]` (uses default sort order from sort-package-json)
47+
48+
Example (`.prettierrc`):
49+
50+
```json
51+
{
52+
"packageSortOrder": ["name", "version", "description", "main"]
53+
}
54+
```

0 commit comments

Comments
 (0)