eslint-plugin-json-format
Advanced tools
Comparing version 1.2.0 to 2.0.0
@@ -116,3 +116,3 @@ const _ = require('lodash') | ||
debug('sorting JSON') | ||
const sorted = formatJSON(sortPkgJSON(parsed, pluginSettings['package-json-sort-order'])) | ||
const sorted = formatJSON(sortPkgJSON(parsed, pluginSettings['sort-package-json'])) | ||
@@ -190,3 +190,3 @@ if (sorted !== formatted) { | ||
if (pluginSettings[SETTINGS['sort-package-json']]) { | ||
if (pluginSettings[SETTINGS['sort-package-json']] !== false) { | ||
if (['package.json', '__package.json'].includes(basename)) { | ||
@@ -193,0 +193,0 @@ return 'package-json' |
@@ -19,14 +19,4 @@ const debug = require('debug')('json-settings') | ||
'sort-package-json': { | ||
type: 'boolean', | ||
default: true, | ||
}, | ||
'ignore-files': { | ||
type: 'array', | ||
default: [ | ||
'**/package-lock.json', | ||
], | ||
}, | ||
'package-json-sort-order': { | ||
type: ['array'], | ||
default: 'pro', | ||
type: ['array', 'boolean'], | ||
default: 'standard', | ||
presets: { | ||
@@ -60,2 +50,13 @@ 'standard': [], | ||
}, | ||
'ignore-files': { | ||
type: 'array', | ||
default: [ | ||
'**/package-lock.json', | ||
], | ||
}, | ||
'package-json-sort-order': { | ||
type: 'boolean', | ||
deprecated: true, | ||
renamed: 'sort-package-json', | ||
}, | ||
} | ||
@@ -62,0 +63,0 @@ |
{ | ||
"name": "eslint-plugin-json-format", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "lint and auto-fix json", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -66,3 +66,3 @@ <div align="center"> | ||
"json/json-with-comments-files": ["**/tsconfig.json", ".vscode/**"], | ||
"json/package-json-sort-order": "pro" | ||
"json/package-json-sort-order": "standard" | ||
} | ||
@@ -75,10 +75,10 @@ ``` | ||
By default the sort order is `"pro"` (will change to "standard" in next major version) | ||
> By default the sort order is `"standard"` | ||
#### Available sorting options | ||
**"pro"**: places scripts and depenedencies at the top, reducing need to scroll down to view them. Pros only. | ||
**"standard"**: default from [`sort-package-json`](https://github.com/keithamus/sort-package-json). This is a sane, standard order. | ||
**"pro"**: places scripts and dependencies at the top, reducing need to scroll down to view them. Pros only. | ||
**["your", "custom", "order", "here"]**: provide an array to manually set the sort order. | ||
@@ -85,0 +85,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22439
518