This package has been deprecated

Author message:

Moved to 'eslint-plugin-annotation' to support a wider range of annotations, not just sort.

eslint-plugin-sort-annotation

1.0.7 • Public • Published

eslint-plugin-sort-annotation

NPM version Build Status

An ESLint plugin for sorting interface properties, object keys and array values if code has annotation. Rules support auto fix and Typescript also.

sort-annotation/sort sort-annotation/sort-keys
sort sort-keys

Installation

You’ll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-sort-annotation:

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

Usage

Here’s a suggested ESLint configuration that:

{
  "parserOptions": { ... }, // Nothing changed
  "plugins": [..., "sort-annotation"], // Add 'sort-annotation' next to old plugins
  "rules": {
    ...
    // Add below rules next to old rules 
    'sort-annotation/sort-keys': 'error',
    'sort-annotation/sort': 'error',
  }
}

Supported Rules

  • sort-keys : Sort interface properties or object keys if has @sort-keys annotation

  • sort : Sort array values if has @sort annotation

License

BSD License

Package Sidebar

Install

npm i eslint-plugin-sort-annotation

Weekly Downloads

25,697

Version

1.0.7

License

MIT

Unpacked Size

74.4 kB

Total Files

35

Last publish

Collaborators

  • ronpark