Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-sort

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-sort

Autofixable sort rules for ESLint.

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.2K
increased by11.41%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-sort

Build status npm semantic-release All Contributors

Autofixable sort rules for ESLint.

Installation

# npm
npm install -D eslint-plugin-sort

# Yarn
yarn add -D eslint-plugin-sort

Usage

After installing, add sort to your list of ESLint plugins and extend the recommended configuration. This will enable all available rules as warnings.

{
  "extends": ["plugin:sort/recommended"],
  "plugins": ["sort"]
}

Rules

While the recommended configuration is the simplest way to use this plugin, you can also configure the rules manually based on your needs.

sort/destructured-properties 🔧

Sorts properties in object destructuring patterns.

Examples of incorrect code for this rule.

let { b, c, a } = {}
let { C, b } = {}
let { b: a, a: b } = {}

Examples of correct code for this rule.

let { a, b, c } = {}
let { b, C } = {}
let { a: b, b: a } = {}

sort/imported-variables 🔧

Sorts imported variable names alphabetically and case insensitive.

Examples of incorrect code for this rule.

import { b, c, a } from "a"
import { C, b } from "a"
import { b as a, a as b } from "a"

Examples of correct code for this rule.

import { a, b, c } from "a"
import { b, C } from "a"
import { a as b, b as a } from "a"

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Mark Skelton
Mark Skelton

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

FAQs

Package last updated on 25 Apr 2020

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