# eslint-plugin-sort-exports

> Sort ES6 exports

Latest version **0.9.1** (published 2024-01-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-sort-exports
pnpm add eslint-plugin-sort-exports
yarn add eslint-plugin-sort-exports
bun add eslint-plugin-sort-exports
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.1 |
| Published | 2024-01-24 |
| First published | 2019-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 22.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 36 |
| Author | jrdrg |
| Maintainers | jrdrg |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-sort-exports
- Repository: https://github.com/jrdrg/eslint-plugin-sort-exports
- Homepage: https://github.com/jrdrg/eslint-plugin-sort-exports#readme
- Issues: https://github.com/jrdrg/eslint-plugin-sort-exports/issues
- npm.io page: https://npm.io/package/eslint-plugin-sort-exports

## Dependencies (1)

- [minimatch](https://npm.io/package/minimatch.md) ^9.0.3

## Recent versions

- 0.9.1 (latest) — 2024-01-24
- 0.8.0 — 2022-11-12
- 0.7.0 — 2022-07-07
- 0.6.0 — 2021-10-04
- 0.5.0 — 2021-09-06
- 0.4.1 — 2021-08-12
- 0.4.0 — 2021-04-11
- 0.3.6 — 2021-04-11
- 0.3.5 — 2021-04-11
- 0.3.4 — 2021-04-11
- 0.3.3 — 2021-04-11
- 0.3.2 — 2020-09-02
- 0.3.1 — 2020-09-02
- 0.3.0 — 2020-09-02
- 0.2.0 — 2019-10-24
- … 2 more at https://npm.io/package/eslint-plugin-sort-exports/versions

## README

# eslint-plugin-sort-exports

Sort export declarations in modules, similarly to [sort-imports](https://eslint.org/docs/rules/sort-imports)

## Installation

First install [ESLint](https://www.eslint.org)

```
yarn add -d eslint
```

Then install `eslint-plugin-sort-exports`

```
yarn add --dev 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, sortExportKindFirst: "type" }
    ]
}
```

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.
- `sortExportKindFirst`: Can be `type`, `value`, or `none`. Determines whether `export` or `export type` are sorted first, if not `none`.
- `disableAutofixer`: If there's a bug in the autofixer and you want to disable it but leave other rules alone, you can set this to true.
- `pattern`: Glob pattern to select or exclude specific filenames. E.g. `**/index.ts`.

---
_Source: https://npm.io/package/eslint-plugin-sort-exports · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
