Socket
Socket
Sign inDemoInstall

eslint-plugin-json-format

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-json-format - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

4

lib/index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc