Problem/Motivation
Some meta:enum have identical keys and values:
'meta:enum':
primary: primary
secondary: secondary
tertiary: tertiary
black: black
white: white
Sometimes, it is because of bad conversion #3475962: [2.0.0-beta4] Cleaner meta:enum conversion, sometimes it is because of component author negligence.
Proposed resolution
It is not a big deal, it works very well, but it is useless and it is a second list to keep synchronized.
So, let's print a warning when ALL the items of a meta:enum have similar data in keys and enums.
So, this is OK (because it looks deliberate):
'meta:enum':
sm: Small
md: md
lg: lg
Issue fork ui_patterns-3478648
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
smovs commentedComment #4
smovs commentedI am not certain I caught the main idea of this feature and moved in the right direction with this meta:enum checking.
I added this checking into the checkEnumDefault() function and updated the related error component.
Please review MR !235
Comment #5
smovs commentedHi @mogtofu33
Thank you for your feedback.
I refactored the code according to your suggestions. Could you please review it?
Comment #6
mogtofu33 commentedThanks for the work, looks great to me.
Comment #8
pdureau commentedComment #9
pdureau commented