šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-sort

Package Overview
Dependencies
Maintainers
0
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-sort

Auto-fixable sort rules for ESLint.

4.0.0
latest
Source
npm
Version published
Weekly downloads
24K
-4.55%
Maintainers
0
Weekly downloads
Ā 
Created
Source

eslint-plugin-sort

Build status npm semantic-release

Auto-fixable sort rules for ESLint.

Installation

npm

npm install -D eslint-plugin-sort

Yarn

yarn add -D eslint-plugin-sort

pnpm

pnpm add -D eslint-plugin-sort

bun

bun 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.

Flat config (eslint.config.js)

import sort from "eslint-plugin-sort"

export default [
  sort.configs["flat/recommended"],
  {
    rules: {
      // Customize rules...
    },
  },
]

Legacy config (.eslintrc)

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

List of Supported Rules

āœ”: Enabled in the recommended configuration.
šŸ”§: Fixable with eslint --fix.

āœ”šŸ”§RuleDescription
āœ”šŸ”§sort/destructuring-propertiesSorts object destructuring properties
āœ”šŸ”§sort/exportsSorts exports
āœ”šŸ”§sort/export-membersSorts export members
āœ”šŸ”§sort/importsSorts imports
āœ”šŸ”§sort/import-membersSorts import members
āœ”šŸ”§sort/object-propertiesSorts object properties
šŸ”§sort/type-propertiesSorts TypeScript type properties
šŸ”§sort/string-enumsSorts TypeScript string enums
šŸ”§sort/string-unionsSorts TypeScript string unions

Keywords

eslint

FAQs

Package last updated on 23 Oct 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