# @elsikora/eslint-plugin-sort-decorators

> An ESLint plugin to sort decorators

Latest version **0.2.9** (published 2026-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @elsikora/eslint-plugin-sort-decorators
pnpm add @elsikora/eslint-plugin-sort-decorators
yarn add @elsikora/eslint-plugin-sort-decorators
bun add @elsikora/eslint-plugin-sort-decorators
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.9 |
| Published | 2026-05-21 |
| First published | 2024-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 77.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ElsiKora |
| Maintainers | dmitryv_devops, michail-elsikora, admin-elsikora, dmitry-elsikora, aleksandr-elsikora |
| Keywords | eslint, eslintplugin, decorators, sort, plugin |

## Links

- npm: https://www.npmjs.com/package/@elsikora/eslint-plugin-sort-decorators
- Repository: https://github.com/ElsiKora/ESLint-Plugin-Sort-Decorators
- Issues: https://github.com/ElsiKora/ESLint-Plugin-Sort-Decorators/issues
- npm.io page: https://npm.io/package/@elsikora/eslint-plugin-sort-decorators

## Dependencies (1)

- [@typescript-eslint/utils](https://npm.io/package/@typescript-eslint/utils.md) ^8.59.4

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 0.2.9 (latest) — 2026-05-21
- 0.2.9-dev.1 (beta) — 2026-05-21
- 0.2.8 — 2024-03-15
- 0.2.7 — 2024-03-15
- 0.2.6 — 2024-03-15

## README

# ESLint-Plugin-Sort-Decorators

[![CI](https://github.com/heap-code/eslint-plugin-sort-decorators/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/heap-code/eslint-plugin-sort-decorators/actions/workflows/ci.yml)
[![npm version](https://img.shields.io/npm/v/eslint-plugin-sort-decorators)](https://www.npmjs.com/package/eslint-plugin-sort-decorators)
![Code coverage](.badges/code/coverage.svg)

An ESLint plugin to sort decorators

## Installation

First, the peer dependencies must be installed:

- [eslint](http://eslint.org)
- [typescript](http://www.typescriptlang.org/)
- [@typescript-eslint/parser](https://typescript-eslint.io/packages/parser/)

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

Next, install `eslint-plugin-sort-decorators`:

```bash
npm i --save-dev @elsikora/eslint-plugin-sort-decorators
```

## Usage

As this plugin only works with _typescript_,
the parser must be set in a [.eslintrc](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-file-formats)
file:

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

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

```json
{
  "plugins": ["@elsikora/sort-decorators"]
}
```

The different rules can be defined as follows:

```json
{
  "rules": {
    "@elsikora/sort-decorators/sort-on-classes": "error"
  }
}
```

Or simply extends a configuration preset:

```json
{
  "extends": ["plugin:@elsikora/sort-decorators/recommended"]
}
```

### Configuration presets

| Name                                           | Description                                                    |
|:-----------------------------------------------|:---------------------------------------------------------------|
| `plugin:@elsikora/sort-decorators/recommended` | Enables all rules with a `warn` security level.                |
| `plugin:@elsikora/sort-decorators/strict`      | Enables 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

<!-- begin auto-generated rules list -->

💼 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](https://eslint.org/docs/user-guide/command-line-interface#--fix).

| Name                                                   | Description                             | 💼 | ⚠️ | 🔧 |
| :----------------------------------------------------- | :-------------------------------------- | :- | :- | :- |
| [sort-on-accessors](docs/rules/sort-on-accessors.md)   | Enforces order of accessors decorators  | 🔒 | ✅  | 🔧 |
| [sort-on-classes](docs/rules/sort-on-classes.md)       | Enforces order of class decorators      | 🔒 | ✅  | 🔧 |
| [sort-on-methods](docs/rules/sort-on-methods.md)       | Enforces order of methods decorators    | 🔒 | ✅  | 🔧 |
| [sort-on-parameters](docs/rules/sort-on-parameters.md) | Enforces order of parameters decorators | 🔒 | ✅  | 🔧 |
| [sort-on-properties](docs/rules/sort-on-properties.md) | Enforces order of properties decorators | 🔒 | ✅  | 🔧 |

<!-- end auto-generated rules list -->

## Releases

See information about breaking changes and release notes [here](https://github.com/heap-code/eslint-plugin-sort-decorators/blob/HEAD/CHANGELOG.md).

---
_Source: https://npm.io/package/@elsikora/eslint-plugin-sort-decorators · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
