-
-
Notifications
You must be signed in to change notification settings - Fork 86
Non-breaking additions to makeLocalsConventionReducer #154
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
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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);
| | **`'all'`** | `{String}` | Apply camelCase, dashes, and the orignional naming convention | | ||
| | **`'none'`** | `{String}` | Only use the orignional naming convention with out locals | | ||
|
|
Copilot
AI
Mar 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in 'orignional'; it should be 'original'.
| | **`'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 | |
| | **`'all'`** | `{String}` | Apply camelCase, dashes, and the orignional naming convention | | ||
| | **`'none'`** | `{String}` | Only use the orignional naming convention with out locals | | ||
|
|
Copilot
AI
Mar 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in 'orignional' and 'with out'; they should be 'original' and 'without', respectively.
| | **`'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 | |
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;