1.1.2 • Published 4 years ago

eslint-plugin-sort-keys-fix v1.1.2

Weekly downloads
90,885
License
ISC
Repository
github
Last release
4 years ago

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:

$ 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:

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

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

{
    "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:

{
  "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. All options supported by sort-keys, besides minKeys, are supported by sort-keys-fix.

@she11sh0cked/eslint-configeslint-config-quartz@usehatchapp/eslint-config-hatch@happ/eslint-config@happ/eslint-plugin@zentus/eslint-config-esmeslint-config-quarkeslint-config-rbower@fellwork/eslint-config-foremaneslint-config-sunrocketzeslint-config-sunrocketz-node@progressivestudio/eslint-config-reacteslint-config-typescript-react-pro-beautifuleslint-beautiful-config-react-typescript-pro@aldertv/eslint-config@infinitebrahmanuniverse/nolb-eslint-plugin-s@cneuro/eslint-config-alphaeslint-config-sandbox@everything-registry/sub-chunk-1614eslint-config-ethang-test@wonse/eslint-config@crx-eslint/eslint-config-standard@crx-eslint/eslint-plugin-standardeslint-config-shaw996@washingtondc/eslint@websummit/codestyle@websummit/eslint-config@websummit/eslint-config-codestyle@wonse/eslint-config-react@tuling-ai/lint@tstv/eslint-config@toptal/eslint-plugin-davinci@tool-belt/eslint-config@thecodejs/eslint-config-js@thecodejs/eslint-config-react@thecodejs/eslint-config-react-ts@the-arc-gmbh/eslint-base-config@the-arc-gmbh/eslint-config@the-arc-gmbh/eslint-config-next@th2025/eslint-config@the-ui-developer/eslint-config@versini/dev-dependencies-eslint@unlock-protocol/networks@usehatchapp/eslint-config@xylabs/eslint-config-react@xylabs/eslint-config-react-base@xylabs/eslint-config@xylabs/eslint-config-base@zentus/eslint-config-zenbackend-handler@govey1nw/lobehub-lint@haldi/dotfiles@hakatashi/eslint-config@easynm/eslint-config@ehacke/eslint-configeslint-config-line@jterrazz/eslint-config-common@rrrrrrrrrrr/eslint-config-custom@lobehub/lint@liting-yes/eslint-config-base@lazycuh/eslint-config-base@looker/eslint-config@looker/eslint-config-oss@lovverhub/config@newsteam/eslint@nhcarrigan/eslint-configparallax-common-configprgencarmerce-design-systemda-vinci-uibtc-bubblefx-style@shiftsmartinc/dotfiles@stevefan1999/eslint-config@techsky/eslint-config@spotmonkeystudios/eslint-config@sweetlikepete/eslint@swind/babel-plugins@swind/boilerplate@tamland/eslintdzuelu-eslint-configeslint-config-meriteslint-config-profitbosseslint-config-r1ckyrockzeslint-config-rbower-typescripteslint-config-re-taroeslint-config-react-tracktoreslint-config-lifioneslint-config-lifion-webeslint-config-pikadude-tseslint-config-phseslint-config-ochoeslint-config-thealexpatineslint-config-nirtamir2eslint-config-noamkadosheslint-config-tuxsncteslint-config-upholdeslint-config-strict-modeeslint-config-stemond-beeslint-config-stemond-fe
1.1.2

4 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago