1.1.2 • Published 3 years ago

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

Weekly downloads
90,885
License
ISC
Repository
github
Last release
3 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-config@toptal/eslint-plugin-davinci@ridedott/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-line@barguide/dotfilesdzuelu-eslint-configeslint-config-everywhereeslint-config-ethang-testeslint-config-pikadude-tseslint-config-phseslint-config-lifioneslint-config-lifion-webeslint-config-nirtamir2eslint-config-noamkadosheslint-config-ochoeslint-config-monaverseeslint-config-jag-nodejseslint-config-gbrachettaeslint-config-gbrachetta-stylisticeslint-config-harriseslint-config-hatcheslint-config-meriteslint-config-heimdalleslint-config-madoeslint-config-profitbosseslint-config-r1ckyrockzeslint-config-divvyeslint-config-bkpkeslint-config-centraeslint-config-bananaeslint-config-re-taroeslint-config-rusteslint-config-team-valseslint-config-thealexpatineslint-config-zytraeslint-config-react-tracktoreslint-config-tuxsncteslint-config-upholdeslint-config-rbower-typescripteslint-config-strict-modeeslint-config-vujitaeslint-plugin-usagisaheslint-plugin-team-valsfx-styleeslint-config-skylighteslint-config-stemond-beeslint-config-stemond-feparallax-common-configprgen@liting-yes/eslint-config-base@powership/babel-plugins@powership/boilerplate@newsteam/eslint@nimashoghi/eslint-config@nkzw/eslint-config@psoares/eslint-config@ehacke/eslint-config@egor.xyz/eslint-config@faustbrian/node-stdbundle@faustbrian/node-stdlint@faustbrian/stdlint@enouvo/eslint-config-react@enouvo/eslint-config-vue@ewerk/eslint-config@fcodes/lint@fradser/eslint-config@qest/eslint-config-base@nolajs/eslint-config@qhlab/eslint-plugin@npmextras/eslint-config@rimac-technology/eslint-config@rimac-technology/style-guide@mnao305/eslint-config@micheldever/eslint-config@openpolitica/matomo-next@iden3/eslint-config-react-ts@mindedtech/eslint-config@mondra/code-format-config@paperfeed/eslint-config@lurdharry/react-native-eslint@mblabs/eslint-config@mattietea/eslint-config
1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago