Skip to content

feat(swc): support JSONC(json comments) for .swcrc#4236

Merged
kdy1 merged 2 commits intoswc-project:mainfrom
aircloud:feat/swcrc_jsonc
Apr 4, 2022
Merged

feat(swc): support JSONC(json comments) for .swcrc#4236
kdy1 merged 2 commits intoswc-project:mainfrom
aircloud:feat/swcrc_jsonc

Conversation

@aircloud
Copy link
Copy Markdown
Contributor

@aircloud aircloud commented Apr 3, 2022

Description:

support JSONC(json comments) for .swcrc, as described in this issue: #4146

In fact, I really need this feature, especially in the case of team collaboration.
So, I investigated how to add this little feature quickly and easily.

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 issue

I 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):

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 3, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!


swc-bump:

  • swc

@kdy1 kdy1 added this to the v1.2.164 milestone Apr 4, 2022
@kdy1 kdy1 enabled auto-merge (squash) April 4, 2022 03:57
Copy link
Copy Markdown
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit 8008b79 into swc-project:main Apr 4, 2022
@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Comments in .swcrc files

4 participants