prettier-plugin-sort-json
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -9,2 +9,8 @@ # Changelog | ||
## [3.1.0] | ||
### Added | ||
- Add `none` sorting algorithm ([#177](https://github.com/Gudahtt/prettier-plugin-sort-json/pull/177)) | ||
- This lets you leave certain properties usorted when defining a custom sort order | ||
- Contributed by @hyperupcall | ||
## [3.0.1] | ||
@@ -58,3 +64,4 @@ ### Fixed | ||
[Unreleased]: https://github.com/Gudahtt/prettier-plugin-sort-json/compare/v3.0.1...HEAD | ||
[Unreleased]: https://github.com/Gudahtt/prettier-plugin-sort-json/compare/v3.1.0...HEAD | ||
[3.1.0]: https://github.com/Gudahtt/prettier-plugin-sort-json/compare/v3.0.1...v3.1.0 | ||
[3.0.1]: https://github.com/Gudahtt/prettier-plugin-sort-json/compare/v3.0.0...v3.0.1 | ||
@@ -61,0 +68,0 @@ [3.0.0]: https://github.com/Gudahtt/prettier-plugin-sort-json/compare/v2.0.0...v3.0.0 |
@@ -60,3 +60,3 @@ "use strict"; | ||
/** | ||
* Make a sort function case-insensitive.. This is meant to wrap | ||
* Make a sort function case-insensitive. This is meant to wrap | ||
* functions meant to be used as the sort function for | ||
@@ -74,2 +74,13 @@ * `Array.prototype.sort`. | ||
/** | ||
* Skip sort function, meant to be used as the sort | ||
* function for `Array.prototype.sort`. | ||
* | ||
* @param _a - First element to compare. | ||
* @param _b - Second element to compare. | ||
* @returns A number indicating which element should come first. | ||
*/ | ||
function noneSort(_a, _b) { | ||
return 0; | ||
} | ||
/** | ||
* Sorting algorithms for categories in a custom sort order definition. | ||
@@ -87,2 +98,3 @@ */ | ||
CategorySort["ReverseNumeric"] = "reverseNumeric"; | ||
CategorySort["None"] = "none"; | ||
})(CategorySort || (CategorySort = {})); | ||
@@ -101,2 +113,3 @@ /** | ||
[CategorySort.ReverseNumeric]: reverseSort(numericSort), | ||
[CategorySort.None]: noneSort, | ||
}; | ||
@@ -103,0 +116,0 @@ /** |
{ | ||
"name": "prettier-plugin-sort-json", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Prettier plugin to sort JSON files alphanumerically by key", | ||
@@ -37,3 +37,3 @@ "repository": { | ||
"eslint": "^8.27.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
@@ -40,0 +40,0 @@ "eslint-plugin-jsdoc": "^39.3.6", |
@@ -116,2 +116,3 @@ # prettier-plugin-sort-json | ||
| `caseInsensitiveReverseNumeric` | Case-insensitive reverse-order numeric sort. | | ||
| `none` | Do not sort. | | ||
@@ -118,0 +119,0 @@ Keys that do not match any defined category are treated as being in an implied last category, with `lexical` sorting. |
Sorry, the diff of this file is not supported yet
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
46037
260
176