# eslint-plugin-sort-keys-fix

> Fork of eslint rule that sorts keys in objects (https://eslint.org/docs/rules/sort-keys) with autofix enabled

Latest version **1.1.2** (published 2021-08-02) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2021-08-02 |
| First published | 2018-11-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 4 |
| Unpacked size | 84.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 102 |
| Author | Leonid Buneev |
| Maintainers | leo-buneev |
| Keywords | eslint, eslintplugin, eslint-plugin |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-sort-keys-fix
- Repository: https://github.com/leo-buneev/eslint-plugin-sort-keys-fix
- npm.io page: https://npm.io/package/eslint-plugin-sort-keys-fix

## Dependencies (4)

- [espree](https://npm.io/package/espree.md) ^6.1.2
- [esutils](https://npm.io/package/esutils.md) ^2.0.2
- [requireindex](https://npm.io/package/requireindex.md) ~1.2.0
- [natural-compare](https://npm.io/package/natural-compare.md) ^1.4.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2021-08-02
- 1.1.1 — 2020-04-22
- 1.1.0 — 2019-11-13
- 1.0.1 — 2018-11-07
- 1.0.0 — 2018-11-07

## README

# eslint-plugin-sort-keys-fix

Fork of eslint rule that sorts keys in objects (https://eslint.org/docs/rules/sort-keys) with autofix enabled

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
$ npm i eslint --save-dev
```

Next, install `eslint-plugin-sort-keys-fix`:

```
$ npm install eslint-plugin-sort-keys-fix --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-sort-keys-fix` globally.

## Usage

Add `sort-keys-fix` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
  "plugins": [
    "sort-keys-fix"
  ]
}
```


Then add sort-keys-fix rule under the rules section.

```json
{
    "rules": {
        "sort-keys-fix/sort-keys-fix": "warn"
    }
}
```

Often it makes sense to enable `sort-keys-fix` only for certain files/directories. For cases like that, use override key of eslint config:

```jsonc
{
  "rules": {
    // ...
  },
  "overrides": [
    {
      "files": ["src/alphabetical.js", "bin/*.js", "lib/*.js"],
      "rules": {
        "sort-keys-fix/sort-keys-fix": "warn"
      }
    }
  ]
}
```

## Rule configuration

For available config options, see [official sort-keys reference](https://eslint.org/docs/rules/sort-keys#require-object-keys-to-be-sorted-sort-keys). All options supported by `sort-keys`, besides `minKeys`, are supported by `sort-keys-fix`.

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