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@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-ethang-test@wonse/eslint-configeslint-config-line@jterrazz/eslint-config-common@rrrrrrrrrrr/eslint-config-customparallax-common-configprgen@aipmorg/lint@appwise/eslint-config-vue@aptos-labs/eslint-config-petra@anonrig/eslint-config@arietta-studio/lint@agungkes/eslint-config-react-typescript@babybeet/eslint-config-base@b2x/eslint-config@beecode/msh-config@ayahub/lint@barguide/dotfiles@big-whale-labs/eslint-config-bwl@big-whale-labs/bwl-eslint-backend@blubblubinc/eslint-config-blubblub-base@busybox/eslint-config@brettm12345/eslint-config-node@citadel2024/team-lint@chieforz/eslint-config-tslint-base@chieforz/eslint-config-tslint-react@chieforz/tslint-config@chieforz/tslint-config-react@10stars/eslint-config@10stars/config@actinc/eslint-config@abizzle/eslint-config-abizzle@bernardmcmanus/eslint-config-js@dcm/eslint-config@dasa-health/eslint-config-dasa-health-js@dword-design/eslint-config@hakatashi/eslint-config@haldi/dotfiles@fradser/eslint-config@hermeznetwork/eslint-config-react-ts@iden3/eslint-config-react-ts@faustbrian/node-stdbundle@faustbrian/node-stdlint@faustbrian/stdlint@fcodes/lint@egor.xyz/eslint-config@gact/react-store@garvae/eslint-config-garvae@garron/lint@eulerxyz/eslint-config@govey1nw/lobehub-lint@lobehub/lint@liting-yes/eslint-config-base@lazycuh/eslint-config-base@looker/eslint-config@looker/eslint-config-oss@lovverhub/config@itcode-dev/eslint-config@itsjonq/zero@insynergie/eslint-config@irvin93d/eslint-config-next@lurdharry/react-native-eslint@micheldever/eslint-config@matart15/eslint-config-specdest@marcoappio/marco-config@newsteam/eslint@nhcarrigan/eslint-config@nimashoghi/eslint-config@nkzw/eslint-config@nolajs/eslint-config@enouvo/eslint-config-react@enouvo/eslint-config-vue@ewerk/eslint-config@encoura/eslint-config@easynm/eslint-config@ehacke/eslint-config@mblabs/eslint-config@mattietea/eslint-config@megabytelabs/eslint-config@mindedtech/eslint-config
1.1.2

3 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago