2.0.0 • Published 10 days ago

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

Weekly downloads
43,057
License
ISC
Repository
github
Last release
10 days 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

@polkadot/dev@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@b2x/eslint-config@big-whale-labs/bwl-eslint-backend@big-whale-labs/eslint-config-bwl@asl-19/eslint-config@alexlit/config-eslint@aptos-labs/eslint-config-petra@bitool/eslint-config@billomat/eslint-config-base@busybox/eslint-config@byintera/eslint-config@breadlee/eslint-config@axiasolar-js/dev@axiasolar/dev@axiacoin/dev@axia-js/dev@cneuro/eslint-config-functional@datacamp/eslint-config@dan28/eslint-config@colussi/eslint-config@dkimura/eslint-config@digitalex/eslint-config@dust-defi/dev@eulerxyz/eslint-config@ephys/eslint-config@dvukovic/eslint-config@grantheaslip/eslint-config@gilbarbara/eslint-config@ghadyani-eslint/eslint-config-core@ghslp/eslint-config@ellreka/configs@hermeznetwork/eslint-config-react-ts@horse-racing/dev@foxone/dev@functorfactory/eslint-config@itsjonq/zero@jaz-dev/devpickbin-eslint-configprgenpressbooks-build-toolseslint-config-jkarczmeslint-config-liferayeslint-config-lifioneslint-config-lifion-webeslint-config-orceslint-config-omletteeslint-config-madoeslint-config-meriteslint-config-molindoeslint-config-15giftseslint-config-pagarme-reacteslint-config-gbrachettaeslint-config-gbrachetta-stylisticeslint-config-brandingbrandeslint-config-caju-baseeslint-config-caju-reacteslint-config-rbower-typescripteslint-config-seegnoeslint-config-pickbineslint-config-sandokaneslint-config-upholdeslint-config-rocketeslint-config-suiyobieslint-config-pwerkseslint-config-skylighteslint-config-divvypatchedeslint-config-linewttj-configwttj-config-front@5ire/dev@abizzle/eslint-config-abizzle@15gifts/eslint-config@1pedro/eslint-config@kitstigator/eslint-config-functional@labforward/eslint-config-base@kitnato/eslint-config-succinct@krypto-wealth/dev@keegan-lillo/eslint-config-base@kununu/eslint-config@lastline/eslint-config-lastline-react@lottiefiles/eslint-plugin@liveauctioneers/eslint-config-hammer-ui@iden3/eslint-config-react-ts@liferay/eslint-config@liferay/eslint-plugin@matali/eslint-config
1.6.0

10 days ago

2.0.0

10 days ago

1.5.0

1 year ago

1.4.0

3 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago