New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-sort-decorators

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-sort-decorators

An ESLint plugin to sort decorators

  • 0.2.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
124
decreased by-15.07%
Maintainers
1
Weekly downloads
 
Created
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"
  }
}

Or simply extends a configuration preset:

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

Configuration presets

NameDescription
plugin:sort-decorators/recommendedEnables all rules with a warn security level.
plugin:sort-decorators/strictEnables all rules with a error security level and autoFix.

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

Rules

💼 Configurations enabled in.
⚠️ Configurations set to warn in.
✅ Set in the recommended configuration.
🔒 Set in the strict configuration.
🔧 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🔒🔧

Releases

See information about breaking changes and release notes here.

Keywords

FAQs

Package last updated on 24 Mar 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

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