https://github.com/tocttou/prettier-sort-destructure
A prettier parser that sorts the destructured keys in object assignments
https://github.com/tocttou/prettier-sort-destructure
destructure prettier sort
Last synced: 3 months ago
JSON representation
A prettier parser that sorts the destructured keys in object assignments
- Host: GitHub
- URL: https://github.com/tocttou/prettier-sort-destructure
- Owner: tocttou
- Created: 2019-08-07T13:12:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-08T10:43:07.000Z (almost 6 years ago)
- Last Synced: 2025-02-15T14:39:15.767Z (4 months ago)
- Topics: destructure, prettier, sort
- Language: JavaScript
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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>
```