fix: don't add mode level if only one mode is present #278
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 is primarily for discussion. It addresses bugs I've been seeing with the most recent version of the plugin. I was seeing similar behavior as #271 , #273 and #274.
In my case, our token variables had a collection of
primitives
with a single mode, and then acolors
collection with 2 modes whose values all referred back to primitive values. The desired output would look like so:What came out was very confusing - with a "Value" level in
primitives
, and thecolors
had a mix of values grouped into a top levelvalue
object and others grouped into top levellight
anddark
objects. I couldn't figure out any rhyme or reason to it.The changes here disable adding the mode level if there's only one mode, and with this change, I get what I want in my tokens, but maybe there's a good reason not to do this - I'm not sure. I think it may have already been discussed around #258.