Skip to content

FxxxdChicken/eslint-plugin-sort-exports

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-sort-exports

Sort export declarations in modules, similarly to sort-imports

Installation

First install ESLint

yarn add -d eslint

Then install eslint-plugin-sort-exports

yarn add --dev https://github.com/FxxxdChicken/eslint-plugin-sort-exports
// or
npm i -D https://github.com/FxxxdChicken/eslint-plugin-sort-exports

Note: If you installed ESLint globally, you must also install eslint-plugin-sort-exports globally.

Usage

Add sort-exports to the plugins section of your .eslintrc and configure the rule under the rules section.

{
    "plugins": ["sort-exports"],
    "rules": {
        "sort-exports/sort-exports": ["error", {"sortDir": "asc"}]
    }
}

Supported rules

sort-exports

Configuration

{
    "sort-exports/sort-exports": [
        "error",
        { sortDir: "asc", ignoreCase: true }
    ]
}

Options can be any of the following properties:

  • sortDir: Can be either asc (default) or desc signifying ascending or descending sort order, respectively.
  • ignoreCase: If true, sorting is case-insensitive.

About

ESLint plugin to sort exports in modules

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%