Socket
Socket
Sign inDemoInstall

eslint-plugin-sort-decorators

Package Overview
Dependencies
127
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-sort-decorators

An ESLint plugin to sort decorators


Version published
Weekly downloads
294
decreased by-41.2%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.1.0 (2023-07-01)

Bug Fixes

  • do not try to get decorators from constructor when fixing (46ef8ac)

Features

  • add a basic implementation (427c4e3)

Readme

Source

eslint-plugin-sort-decorators

CI npm version Code coverage

An ESLint plugin to sort decorators

Installation

First, the peer dependencies must be installed:

npm i --save-dev typescript eslint @typescript-eslint/parser

Next, install eslint-plugin-sort-decorators:

npm i --save-dev eslint-plugin-sort-decorators

Usage

As this plugin only works with typescript, the parser must be set in a .eslintrc file:

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

The plugin can then be activated by adding sort-decorators to the plugins property:

{
  "plugins": ["sort-decorators"]
}

The different rules can be defined as follows:

{
  "rules": {
    "sort-decorators/sort-on-classes": "error"
  }
}

All these configuration can be done on a override section: https://eslint.org/docs/latest/use/configure/configuration-files#how-do-overrides-work

Rules

🔧 Automatically fixable by the --fix CLI option.

NameDescription🔧
sort-on-accessorsEnforces order of accessors decorators🔧
sort-on-classesEnforces order of class decorators🔧
sort-on-methodsEnforces order of methods decorators🔧
sort-on-parametersEnforces order of parameters decorators🔧
sort-on-propertiesEnforces order of properties decorators🔧

Keywords

FAQs

Last updated on 01 Jul 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc