feat(swc): support JSONC(json comments) for .swcrc#4236
Merged
kdy1 merged 2 commits intoswc-project:mainfrom Apr 4, 2022
Merged
feat(swc): support JSONC(json comments) for .swcrc#4236kdy1 merged 2 commits intoswc-project:mainfrom
kdy1 merged 2 commits intoswc-project:mainfrom
Conversation
swc-bot
reviewed
Apr 4, 2022
Collaborator
swc-bot
left a comment
There was a problem hiding this comment.
Automated review comment generated by auto-rebase script
This was referenced Sep 28, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
support JSONC(json comments) for .swcrc, as described in this issue: #4146
I went to check the discussion of JSONC in libraries such as
serde_json. There are many discussions, TL;DR, and there is a solution, it is recommended to use json_comments, for details, please refer to this change and the issueI also think this change is relatively controllable and can continue to use the
serde_json, so the overall scope of changes is small, and this part will not affect the performance at all.I submitted a minimal change, and I also think this can continue to be reduced to one parse, there seems to be no problem.(Removing
\u{feff}doesn't seem to have any side effects, don't know why it is separated)If the main maintainer thinks it can continue to be simplified, I am also happy to modify it or modify in another PR later(if one PR only does one thing)
BREAKING CHANGE:
None
Related issue (if exists):