Skip to content

Commit

Permalink
Prefix options with cssDeclarationSorter
Browse files Browse the repository at this point in the history
Closes #22
  • Loading branch information
Siilwyn committed Jul 29, 2023
1 parent 28e440d commit dfc6add
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ After installation Prettier should automatically use this plugin.

### Configuration
This plugin adds two configurable keys to Prettier:
- [`order`](https://github.com/Siilwyn/css-declaration-sorter#order) defaults to `concentric-css`.
- [`keepOverrides`](https://github.com/Siilwyn/css-declaration-sorter#keepoverrides) defaults to `true`, for a new codebase `false` is recommended.
- [`cssDeclarationSorterOrder`](https://github.com/Siilwyn/css-declaration-sorter#order) defaults to `concentric-css`.
- [`cssDeclarationSorterKeepOverrides`](https://github.com/Siilwyn/css-declaration-sorter#keepoverrides) defaults to `true`, for a new codebase `false` is recommended.

[npm]: https://www.npmjs.com/package/prettier-plugin-css-order
[npm-badge]: https://tinyshields.dev/npm/prettier-plugin-css-order.svg
8 changes: 4 additions & 4 deletions src/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const syntaxMapping = {
function parseSort(text, options) {
return postcss([
cssDeclarationSorter({
order: options.order,
keepOverrides: options.keepOverrides,
order: options.cssDeclarationSorterOrder,
keepOverrides: options.cssDeclarationSorterKeepOverrides,
}),
])
.process(text, {
Expand All @@ -33,7 +33,7 @@ function parseSort(text, options) {

export default {
options: {
order: {
cssDeclarationSorterOrder: {
type: "choice",
description: "One of the built-in sort orders.",
category: "css-declaration-sorter",
Expand All @@ -56,7 +56,7 @@ export default {
},
],
},
keepOverrides: {
cssDeclarationSorterKeepOverrides: {
type: "boolean",
description: "",
category: "css-declaration-sorter",
Expand Down

0 comments on commit dfc6add

Please sign in to comment.