Skip to content

4.0.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 18 Mar 13:44
· 34 commits to main since this release
fcf9d7b

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.