2.0.0 • Published 1 year ago

eslint-plugin-sort-destructure-keys v2.0.0

Weekly downloads
43,057
License
ISC
Repository
github
Last release
1 year ago

eslint-plugin-sort-destructure-keys

require object destructure key to be sorted

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-sort-destructure-keys:

$ npm install eslint-plugin-sort-destructure-keys --save-dev

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

Usage

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

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

Then configure the rule under the rules section.

{
  "rules": {
    "sort-destructure-keys/sort-destructure-keys": 2
  }
}

Rule Options

{
  "sort-destructure-keys/sort-destructure-keys": [2, { "caseSensitive": false }]
}

caseSensitive

When true the rule will enforce properties to be in case-sensitive order. Default is true.

Example of incorrect code for the {"caseSensitive": false} option:

let { B, a, c } = obj;

Example of correct code for the {"caseSensitive": false} option:

let { a, B, c } = obj;

Example of incorrect code for the {"caseSensitive": true} option:

let { a, B, c } = obj;

Example of correct code for the {"caseSensitive": true} option:

let { B, a, c } = obj;

Changelog

2.0.0

  • Drop support for ESLint versions older than 5. (#269)

1.6.0

  • Add compatibility for ESLint 9. (#267, by ptb)

1.5.0

  • Allow sorting properties with defaults when the default doesn't reference other properties (#215, by ianobermiller).

1.4.0

  • Add compatibility with eslint 8. (#123)

1.3.5

  • Add ^7.0.0 to eslint peer dependency. (#53, by dsernst)

1.3.4

  • Fixes TypeError issue with multiple property expressions. (#20)

1.3.3

  • Add 6.0.0 to eslint peer dependency. (#21, by @7rulnik)

1.3.2

  • Fix bug where computed properties were causing the rule to throw errors. (#15, thanks @TSMMark!)

1.3.1

1.3.0

  • Add support for --fix eslint cli flag

1.2.0

  • Add peer dependency support for eslint ^5.0.0

1.1.0

@alfabank/eslint-config-siteeslint-config-tantalum@zentus/eslint-config-esmeslint-config-rbowereslint-config-sunrocketzeslint-config-sunrocketz-node@aldertv/eslint-config@infinitebrahmanuniverse/nolb-eslint-plugin-s@mafalda/eslint-config@cneuro/eslint-config-alphaeslint-config-sandbox@everything-registry/sub-chunk-1614@alt-research/dev@wonse/eslint-configwttj-configwttj-config-front@rosinfo.tech/cli@rosinfo.tech/eslint-config-javascript@tantalum-config/eslint-configeslint-config-shaw996mastarmlzinik-eslint-configs@websublime/eslint-config@venusui/eslint-config@voxpelli/eslint-config@wonse/eslint-config-react@xeraph-dev/eslint-config@u3u/eslint-config@tools-aoeur/eslint-config@tetcoin/dev@the-ui-developer/eslint-config@vavra7/eslint@untile/eslint-config-untile@uvarovag/eslint-config-ts@xyzproject/react-linting-standards@zcloak/dev@zentus/eslint-config-zen@zzcwoshizz/dev@15gifts/eslint-config@1pedro/eslint-config@5ire/dev@abizzle/eslint-config-abizzle@axiasolar/dev@axiasolar-js/dev@b2x/eslint-config@agm-stack/eslint-config-next@cneuro/eslint-config-functional@colussi/eslint-config@alejandrov44/eslint-configeslint-config-line@rrrrrrrrrrr/eslint-config-custom@big-whale-labs/eslint-config-bwl@big-whale-labs/bwl-eslint-backend@bitool/eslint-config@billomat/eslint-config-base@breadlee/eslint-config@busybox/eslint-config@byintera/eslint-config@labforward/eslint-config-base@krypto-wealth/dev@kununu/eslint-config@liveauctioneers/eslint-config-hammer-ui@lastline/eslint-config-lastline-react@lottiefiles/eslint-plugin@liferay/eslint-config@liferay/eslint-plugin@mservicestech/eslint-config@mservicestech/eslint-config-react@myposter/eslint-config@new-black/eva-frontend-config@ptb/eslint-config@psdevs/eslint-config@reef-defi/dev@redspot/dev-cli@polkadot/dev@pawk3k/eslint-config-frontend@pawk3k/eslint-config-frontend1@patract/dev@parsleyhealth/eslint-config-cephalopod@paperfeed/eslint-config@repodog/eslint-config@rimac-technology/eslint-config@rimac-technology/style-guideomnicalculator-eslint-configpatchedpickbin-eslint-configprgenpressbooks-build-tools@shcherbin/eslint-config-node-typescript@shcherbin/eslint-config-svelte-kit-typescript@shcherbin/eslint-config-typescript@substrate-dev/node-dev@techsky/eslint-config@spotmonkeystudios/eslint-configeslint-config-lzinikeslint-config-meriteslint-config-pwerkseslint-config-rbower-typescripteslint-config-liferayeslint-config-lifion
1.6.0

1 year ago

2.0.0

1 year ago

1.5.0

3 years ago

1.4.0

4 years ago

1.3.5

5 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago