Coder Social home page Coder Social logo

thdk / eslint-plugin-typescript-sort-keys Goto Github PK

View Code? Open in Web Editor NEW

This project forked from infctr/eslint-plugin-typescript-sort-keys

0.0 1.0 0.0 541 KB

A linter plugin to require sorting interface and string enum keys

License: ISC License

JavaScript 2.81% TypeScript 97.19%

eslint-plugin-typescript-sort-keys's Introduction

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: โœ”๏ธ = recommended, ๐Ÿ”ง = fixable

Name Description โœ”๏ธ ๐Ÿ”ง
typescript-sort-keys/interface require interface keys to be sorted โœ”๏ธ ๐Ÿ”ง
typescript-sort-keys/string-enum require string enum members to be sorted โœ”๏ธ ๐Ÿ”ง

eslint-plugin-typescript-sort-keys's People

Contributors

dependabot[bot] avatar entropitor avatar infctr avatar ivangabriele avatar johnmartel avatar kai-dorschner-twinsity avatar nhannah avatar noelebrun avatar szamanr avatar worldlee78 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.