🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

eslint-plugin-typescript-sort-keys

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-typescript-sort-keys

Sort interface and string enum keys

3.3.0
latest
Version published
Weekly downloads
351K
-12.14%
Maintainers
0
Weekly downloads
 
Created

Tests

eslint-plugin-typescript-sort-keys

Sort interface and string enum keys

Inspired by and sourced from eslint/sort-keys

Installation

You'll first need to install

yarn add -D eslint typescript @typescript-eslint/parser

Next, install eslint-plugin-typescript-sort-keys:

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

Note: If you installed ESLint globally then you must also install eslint-plugin-typescript-sort-keys globally.

Usage

Specify the parser for typescript files in your .eslintrc configuration file:

{
  "parser": "@typescript-eslint/parser"
}

Add typescript-sort-keys to the plugins section. You can omit the eslint-plugin- prefix:

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

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

{
  "rules": {
    "typescript-sort-keys/interface": "error",
    "typescript-sort-keys/string-enum": "error"
  }
}

Or enable all rules with defaults

{
  "extends": ["plugin:typescript-sort-keys/recommended"]
}

Supported Rules

Key: :heavy_check_mark: = recommended, :wrench: = fixable

NameDescription:heavy_check_mark::wrench:
typescript-sort-keys/interfacerequire interface keys to be sorted:heavy_check_mark::wrench:
typescript-sort-keys/string-enumrequire string enum members to be sorted:heavy_check_mark::wrench:

FAQs

Package last updated on 05 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts