Skip to content

Conversation

@RichardTMiles
Copy link

Added the ability to return an array of strings for custom user functions.

Added two new switch case statements, all and none to localsConvention. Where all is self explanatory and none applies no hash/localization tokens[className] = value;

…lsConvention gets non breaking changes. Custom functions can return array of strings and new case statements locals
@madyankin madyankin requested a review from Copilot March 13, 2025 07:27
Copy link

Copilot AI left a 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);

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 |

Copy link

Copilot AI Mar 13, 2025

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'.

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 |

Copilot uses AI. Check for mistakes.
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 |

Copy link

Copilot AI Mar 13, 2025

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.

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 |

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant