Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite plugin to sort AST #100

Merged
merged 1 commit into from
Aug 14, 2022
Merged

Rewrite plugin to sort AST #100

merged 1 commit into from
Aug 14, 2022

Conversation

Gudahtt
Copy link
Owner

@Gudahtt Gudahtt commented Aug 14, 2022

The plugin now sorts JSON by sorting the AST, instead of using a preprocessor step.

This approach is more flexible because we aren't relying on JSON.parse, so we can handle invalid JSON. This approach also lets us override the sort order imposed by JSON.stringify, specifically that integers always come before string keys.

The plugin now sorts JSON by sorting the AST, instead of using a pre-
processor step.

This approach is more flexible because we aren't relying on
`JSON.parse`, so we can handle invalid JSON. This approach also lets us
override the sort order imposed by `JSON.stringify`, specifically that
integers always come before string keys.
@Gudahtt Gudahtt merged commit ef01da4 into main Aug 14, 2022
@Gudahtt Gudahtt deleted the rewrite-sorting-to-use-ast branch August 14, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant