Socket
Socket
Sign inDemoInstall

eslint-plugin-sort-annotation

Package Overview
Dependencies
126
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-sort-annotation

Lint rule to autofix unsorted object's keys or array


Version published
Weekly downloads
14K
decreased by-40.55%
Maintainers
1
Install size
3.61 MB
Created
Weekly downloads
 

Readme

Source

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/sortsort-annotation/sort-keys
sortsort-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

Keywords

FAQs

Last updated on 26 Apr 2024

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