Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettier-plugin-sort-json

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-sort-json - npm Package Versions

4.0.0

Diff

Changelog

Source

[4.0.0]

Changed

  • BREAKING: Drop support for Node.js v16 (#203)
  • BREAKING: Update case insensitive sort to use deterministic key order (#189)
    • Previously the "case insensitive" sorting options would leave keys in their original order when they differed only in case. They have been updated to sort identical keys in case order instead, making these sort options deterministic.
    • This change has been made because deterministic sort orders tend to be easier to work with, are more aligned with how Prettier works, and typically lead to less churn. However, if your project needs to preserve original key order, you can emulate the old behavior by defining a custom sort order that has a category for each case-insensitive character. For example, you could set this as your prettierrc.js file:
      {
          jsonSortOrder: JSON.stringify({
              '/^[Aa]/': 'none',
              '/^[Bb]/': 'none',
              '/^[Cc]/': 'none',
              ...
              '/^[Zz]/': 'none',
          })
      }
    
    This should work for small character sets. If you require case-insensitive sorting with a larger character set, please submit a feature request. We can bring back the old sorting order as an option if there is demand for it.
gudahtt
published 3.1.0 •

Changelog

Source

[3.1.0]

Added

  • Add none sorting algorithm (#177)
    • This lets you leave certain properties usorted when defining a custom sort order
    • Contributed by @hyperupcall
gudahtt
published 3.0.1 •

Changelog

Source

[3.0.1]

Fixed

  • Fix accidental removal of trailing newline (#170)
gudahtt
published 3.0.0 •

Changelog

Source

[3.0.0]

Changed

  • BREAKING: Migrate to Prettier v3 (#156)
    • This plugin no longer works with Prettier v2. Prettier v2 support will be maintained on v2 of this plugin however.
    • Prettier v3 will no longer automatically load plugins. Follow these instructions to load this plugin after updating.
gudahtt
published 2.0.0 •

Changelog

Source

[2.0.0]

Changed

gudahtt
published 1.0.0 •

Changelog

Source

[1.0.0]

Changed

  • BREAKING: Change jsonSortOrder option to a JSON string (#118)
    • This configuration option used to accept a file path. Now it accepts a JSON string instead. See the README for more details.
gudahtt
published 0.0.3 •

Changelog

Source

[0.0.3]

Added

  • Add jsonSortOrder option (#92)
    • This also supports case-insensitive sorting (#104)

Changed

  • BREAKING: Rewrite plugin to sort AST (#100)
    • This ensures that symbols are sorted before numbers, as in a normal lexical sort. This is the breaking change, because the sort order may have changed in some edge cases.
    • This ensures that JSON files with mistakes like trailing commas are still sorted properly the first time.
  • BREAKING: Update minimum Node.js version to v14 (#40, #61)
  • BREAKING: Update minimum Prettier version to v2.3.2 (#47)
gudahtt
published 0.0.2 •

Changelog

Source

[0.0.2] - 2021-02-13

Added

  • JSON Recursive Sort option (#23)

Changed

  • [BREAKING] Update minimum prettier version to v2.1.0 (#21, #24)
  • [BREAKING] Move prettier from dependencies to peerDependencies (#22)
  • Fix manifest repository property (#17)

Removed

  • Remove unused @babel/types dependency (#20)
gudahtt
published 0.0.1 •

Changelog

Source

[0.0.1] - 2020-09-22

Added

  • Initial release
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