[WIP] Add more options to CamelCasePlugin#1658
Open
wirekang wants to merge 2 commits intokysely-org:masterfrom
Open
[WIP] Add more options to CamelCasePlugin#1658wirekang wants to merge 2 commits intokysely-org:masterfrom
wirekang wants to merge 2 commits intokysely-org:masterfrom
Conversation
|
@wirekang is attempting to deploy a commit to the Kysely Team Team on Vercel. A member of the Team first needs to authorize it. |
wirekang
commented
Dec 12, 2025
| ['asis', 'asis'], | ||
| ['foo_bar', 'fooBar'], | ||
| ['a_f_o_o_bar', 'aFOOBar'], | ||
| ['_id', '_Id'], |
Contributor
Author
There was a problem hiding this comment.
Currently, this test case is passing. I think it should modified like ['_id', 'id']
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR will add more properties to
CamelCasePluginOptions:ignoreSurroundingUnderscores?: booleanremoveSurroudingUnderscores?: booleancustomMapping?: Record<string,string>In case of #1627, I think
_id->_Idconversion is a bug. So What's the correct one?_idorid? When I tested a bunch of snake_case to camelCase implementations, the golden rule was to remove leading underscores(_id->id). But it would be great if there are more options to control some opinioned behavior, since there is no standard.Closes #1627
WIP
First of all, I added a test file to test CamelCasePlugin independently.
Since the maintainer might reject this approach, I haven't implemented anything yet and also haven't declared all the test cases.