prettier-plugin-packagejson
Advanced tools
Comparing version 2.3.0 to 2.4.0
const requireSafe = require('./require') | ||
const { parsers } = requireSafe('prettier/parser-babel') || requireSafe('prettier/parser-babylon') | ||
const sortPackageJson = require('sort-package-json') | ||
const sortPackageJson = require('./sort-package-json') | ||
const { parsers } = | ||
requireSafe('prettier/parser-babel') || | ||
// istanbul ignore next | ||
requireSafe('prettier/parser-babylon') | ||
const parser = parsers['json-stringify'] | ||
/** @type {import('prettier').Plugin['parsers']} */ | ||
exports.parsers = { | ||
@@ -10,2 +16,3 @@ 'json-stringify': { | ||
preprocess(text, options) { | ||
// istanbul ignore next | ||
if (parser.preprocess) { | ||
@@ -16,3 +23,3 @@ text = parser.preprocess(text, options) | ||
return options.filepath && /(^|\\|\/)package\.json$/.test(options.filepath) | ||
? sortPackageJson(text) | ||
? sortPackageJson.default(text) | ||
: text | ||
@@ -19,0 +26,0 @@ }, |
{ | ||
"name": "prettier-plugin-packagejson", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Prettier package.json plugin to make the order of properties nice.", | ||
@@ -21,8 +21,6 @@ "keywords": [ | ||
"scripts": { | ||
"ci:test": "run-s test send:coverage", | ||
"fix": "run-p fix:*", | ||
"fix:prettier": "npm run lint:prettier -- --write", | ||
"lint": "run-p lint:*", | ||
"lint:prettier": "prettier -l \"**/*.{js,json,md,yaml,yml}\"", | ||
"send:coverage": "npx codecov", | ||
"lint:prettier": "prettier -c .", | ||
"test": "run-s lint test:*", | ||
@@ -32,8 +30,9 @@ "test:unit": "jest" | ||
"dependencies": { | ||
"sort-package-json": "1.57.0" | ||
"sort-package-json": "2.1.0", | ||
"synckit": "0.8.4" | ||
}, | ||
"devDependencies": { | ||
"jest": "29.1.1", | ||
"jest": "29.3.1", | ||
"npm-run-all": "4.1.5", | ||
"prettier": "2.7.1" | ||
"prettier": "2.8.3" | ||
}, | ||
@@ -40,0 +39,0 @@ "peerDependencies": { |
[![npm-badge]][npm] | ||
[![downloads-badge]][npm] | ||
[![circleci-badge]][circleci] | ||
[![actions-badge]][actions] | ||
[![renovate-badge]][renovate] | ||
@@ -10,4 +10,4 @@ [![codecov-badge]][codecov] | ||
[downloads-badge]: https://img.shields.io/npm/dw/prettier-plugin-packagejson?color=blue | ||
[circleci-badge]: https://circleci.com/gh/matzkoh/prettier-plugin-packagejson.svg?style=shield | ||
[circleci]: https://circleci.com/gh/matzkoh/prettier-plugin-packagejson | ||
[actions-badge]: https://github.com/matzkoh/prettier-plugin-packagejson/actions/workflows/release.yml/badge.svg | ||
[actions]: https://github.com/matzkoh/prettier-plugin-packagejson/actions/workflows/release.yml | ||
[renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen | ||
@@ -14,0 +14,0 @@ [renovate]: https://renovatebot.com/ |
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
15835
10
51
3
+ Addedsynckit@0.8.4
+ Added@pkgr/utils@2.4.2(transitive)
+ Addedbig-integer@1.6.52(transitive)
+ Addedbplist-parser@0.2.0(transitive)
+ Addedbundle-name@3.0.0(transitive)
+ Addedcross-spawn@7.0.5(transitive)
+ Addeddefault-browser@4.0.0(transitive)
+ Addeddefault-browser-id@3.0.0(transitive)
+ Addeddefine-lazy-prop@3.0.0(transitive)
+ Addeddetect-indent@7.0.1(transitive)
+ Addeddetect-newline@4.0.1(transitive)
+ Addedexeca@5.1.17.2.0(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedgit-hooks-list@3.1.0(transitive)
+ Addedglobby@13.2.2(transitive)
+ Addedhuman-signals@2.1.04.3.1(transitive)
+ Addedis-docker@2.2.13.0.0(transitive)
+ Addedis-inside-container@1.0.0(transitive)
+ Addedis-plain-obj@4.1.0(transitive)
+ Addedis-stream@2.0.13.0.0(transitive)
+ Addedis-wsl@2.2.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmimic-fn@2.1.04.0.0(transitive)
+ Addednpm-run-path@4.0.15.3.0(transitive)
+ Addedonetime@5.1.26.0.0(transitive)
+ Addedopen@9.1.0(transitive)
+ Addedpath-key@3.1.14.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedrun-applescript@5.0.0(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedslash@4.0.0(transitive)
+ Addedsort-package-json@2.1.0(transitive)
+ Addedstrip-final-newline@2.0.03.0.0(transitive)
+ Addedsynckit@0.8.4(transitive)
+ Addedtitleize@3.0.0(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addeduntildify@4.0.0(transitive)
+ Addedwhich@2.0.2(transitive)
- Removed@types/glob@7.2.0(transitive)
- Removed@types/minimatch@5.1.2(transitive)
- Removed@types/node@22.9.0(transitive)
- Removedarray-union@2.1.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddetect-indent@6.1.0(transitive)
- Removeddetect-newline@3.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedgit-hooks-list@1.0.3(transitive)
- Removedglob@7.2.3(transitive)
- Removedglobby@10.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-plain-obj@2.1.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedslash@3.0.0(transitive)
- Removedsort-package-json@1.57.0(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedsort-package-json@2.1.0