Non-breaking additions to makeLocalsConventionReducer#154
Open
RichardTMiles wants to merge 5 commits intomadyankin:masterfrom
Open
Non-breaking additions to makeLocalsConventionReducer#154RichardTMiles wants to merge 5 commits intomadyankin:masterfrom
RichardTMiles wants to merge 5 commits intomadyankin:masterfrom
Conversation
…lsConvention gets non breaking changes. Custom functions can return array of strings and new case statements locals
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces non-breaking additions to the makeLocalsConventionReducer function by allowing custom user functions to return an array of strings and adding two new switch cases ("all" and "none") for localsConvention.
- Added support for custom user function returning an array of strings
- Introduced new switch cases ("all" and "none") in localsConvention
- Updated documentation and test configuration to reflect these changes
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/test.js.yml | Updated Node.js versions in the test matrix |
| src/localsConvention.js | Added array handling for custom functions and new switch cases for "all" and "none" |
| README.md | Updated type signature and added documentation for the new "all" and "none" cases |
Comments suppressed due to low confidence (1)
src/localsConvention.js:16
- [nitpick] Avoid shadowing the outer 'convention' variable in the forEach callback; consider using a distinct name for the parameter, e.g. 'local'.
convention.forEach(convention => tokens[convention] = value);
Comment on lines
+205
to
207
| | **`'all'`** | `{String}` | Apply camelCase, dashes, and the orignional naming convention | | ||
| | **`'none'`** | `{String}` | Only use the orignional naming convention with out locals | | ||
|
|
There was a problem hiding this comment.
Typo in 'orignional'; it should be 'original'.
Suggested change
| | **`'all'`** | `{String}` | Apply camelCase, dashes, and the orignional naming convention | | |
| | **`'none'`** | `{String}` | Only use the orignional naming convention with out locals | | |
| | **`'all'`** | `{String}` | Apply camelCase, dashes, and the original naming convention | | |
| | **`'none'`** | `{String}` | Only use the original naming convention without locals | |
Comment on lines
+205
to
207
| | **`'all'`** | `{String}` | Apply camelCase, dashes, and the orignional naming convention | | ||
| | **`'none'`** | `{String}` | Only use the orignional naming convention with out locals | | ||
|
|
There was a problem hiding this comment.
Typo in 'orignional' and 'with out'; they should be 'original' and 'without', respectively.
Suggested change
| | **`'all'`** | `{String}` | Apply camelCase, dashes, and the orignional naming convention | | |
| | **`'none'`** | `{String}` | Only use the orignional naming convention with out locals | | |
| | **`'all'`** | `{String}` | Apply camelCase, dashes, and the original naming convention | | |
| | **`'none'`** | `{String}` | Only use the original naming convention without locals | |
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.
Added the ability to return an array of strings for custom user functions.
Added two new switch case statements,
allandnoneto localsConvention. Where all is self explanatory and none applies no hash/localizationtokens[className] = value;