Skip to content

A prettier parser that sorts the destructured keys in object assignments

Notifications You must be signed in to change notification settings

tocttou/prettier-sort-destructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

A prettier parser that sorts the destructured keys in object assignments

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published