Socket
Socket
Sign inDemoInstall

eslint-plugin-typescript-sort-keys

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

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


Version published
Weekly downloads
361K
decreased by-3.44%
Maintainers
1
Weekly downloads
 
Created
Source

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:

Keywords

FAQs

Package last updated on 18 Jun 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc