1.0.5 • Published 4 years ago

eslint-plugin-typescript-custom-sort-keys v1.0.5

Weekly downloads
22
License
ISC
Repository
github
Last release
4 years ago

eslint-plugin-typescript-custom-sort-keys

This plugin sorts your typescript and interfaces in a custom defined order.

References:

Installation

yarn add -D eslint-plugin-typescript-custom-sort-keys

Usage

{
  "plugins": ["typescript-custom-sort-keys"]
}

Then configure the rules you want to use under the rules section.

displayFirst: Define array of fields that you want to show on top

showFunctionsAtEnd: keep it true if you want to show your functions in end

{
  "rules": {
    "typescript-custom-sort-keys/interface": [
      "warn",
      "asc",
      {
        "caseSensitive": true,
        "displayFirst": ["id"],
        "showFunctionsAtEnd": true,
      },
    ],
  }
}

Example:

BeforeAfter