prettier-sort-destructure
v0.0.4
Published
A prettier parser that sorts the destructured keys in object assignments
Downloads
25
Readme
Prettier Sort Destructure
Input:
var { b, d, c } = {
b: 1,
d: 2,
c: 3
};
Output:
var { b, c, d } = {
b: 1,
d: 2,
c: 3
};
Setup:
Install:
npm install --save-dev prettier-sort-destructure
Use:
via .prettierrc
:
{
"overrides": [
{
"files": ["*.js", "*.jsx"],
"options": {
"parser": "node_modules/prettier-sort-destructure/index.js"
}
}
]
}
via CLI:
prettier --parser node_modules/prettier-sort-destructure/index.js <...files>