Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use arrays instead of CSV strings for config file types #300

Merged
merged 1 commit into from Nov 27, 2022

Conversation

bmish
Copy link
Owner

@bmish bmish commented Nov 27, 2022

Type Before Type Before Example After Type After Example
configEmoji string[] 'my-config,馃構' string[][] ['my-config', '馃構']
ruleDocNotices string 'fixableAndHasSuggestions,deprecated' NOTICE_TYPE[] ['fixableAndHasSuggestions', 'deprecated']
ruleListColumns string 'name,type' COLUMN_TYPE[] ['name', 'type']

Using actual arrays of the proper enum types is much safer, cleaner, and more elegant vs. having the user provide CSV strings. Actual arrays are easier to work with in JS/JSON objects and avoid hacks like using .join(','). This also enables us to specify the actual enum types which provide the user with additional type information / type-checking capability.

@bmish bmish added the breaking label Nov 27, 2022
@bmish bmish changed the title Use arrays instead of CSV for config file types Use arrays instead of CSV strings for config file types Nov 27, 2022
@bmish bmish force-pushed the array-types-not-csv branch 2 times, most recently from baaff79 to 9b15801 Compare November 27, 2022 21:13
@bmish bmish merged commit aa0b21c into main Nov 27, 2022
@bmish bmish deleted the array-types-not-csv branch November 27, 2022 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants