Gathering detailed insights and metrics for eslint-plugin-sort-keys-custom-order-fix
Gathering detailed insights and metrics for eslint-plugin-sort-keys-custom-order-fix
npm install eslint-plugin-sort-keys-custom-order-fix
Typescript
Module System
Min. Node Version
Node Version
NPM Version
84.3
Supply Chain
95.5
Quality
74.8
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
212,506
Last Day
1,150
Last Week
5,257
Last Month
19,891
Last Year
151,310
3 Stars
33 Commits
1 Forks
3 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.1.1
Package Id
eslint-plugin-sort-keys-custom-order-fix@0.1.1
Unpacked Size
87.54 kB
Size
15.21 kB
File Count
9
NPM Version
6.14.12
Node Version
14.16.1
Cumulative downloads
Total Downloads
Last day
21.2%
1,150
Compared to previous day
Last week
-13.3%
5,257
Compared to previous week
Last month
-2%
19,891
Compared to previous month
Last year
163.1%
151,310
Compared to previous year
Fork of eslint rule that sorts keys in objects (https://eslint.org/docs/rules/sort-keys) with a custom order and autofix enabled.
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-sort-keys-custom-order-fix
:
$ npm i eslint-plugin-sort-keys-custom-order-fix --save-dev
Note: If you installed ESLint globally (using the -g
flag), then you must also install eslint-plugin-sort-keys-custom-order-fix
globally.
Add sort-keys-custom-order-fix
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
1{ 2 "plugins": ["sort-keys-custom-order-fix"] 3}
Then add sort-keys-custom-order-fix
rule under the rules section:
1{ 2 "rules": { 3 "sort-keys-custom-order-fix/sort-keys-custom-order-fix": "warn" 4 } 5}
Example using custom
order:
1{ 2 "rules": { 3 "sort-keys-custom-order-fix/sort-keys-custom-order-fix": ["warn", "custom", { "order": ["a", "c", "b"] }] 4 } 5}
Example using custom
order + orderBy
:
1{ 2 "rules": { 3 "sort-keys-custom-order-fix/sort-keys-custom-order-fix": [ 4 "warn", 5 "custom", 6 { "orderBy": "asc", "order": ["a", "c", "b"] } 7 ] 8 } 9}
Often it makes sense to enable sort-keys-custom-order-fix
only for certain files/directories. For cases like that, use override key of eslint config:
1{ 2 "rules": { 3 // ... 4 }, 5 "overrides": [ 6 { 7 "files": ["src/alphabetical.js", "bin/*.js", "lib/*.js"], 8 "rules": { 9 "sort-keys-custom-order-fix/sort-keys-custom-order-fix": "warn" 10 } 11 } 12 ] 13}
For available config options, see official sort-keys reference. All options supported by sort-keys
, besides minKeys
, are supported by sort-keys-custom-order-fix
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
32 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More