The problem line:
Surely, it must be:
return componentType.replace(/_/g, '-');
For now, typeClass() incorrectly handles multiword setting types, for example: my_setting_type => my-setting_type because JavaScript String.replace() method replaces only the first occurence by default.
typeClass()
my_setting_type
my-setting_type
String.replace()
Thanks. Just pushed a fix
https://github.com/discourse/discourse/commit/95c8ec50a872fab0e37ef7da7f2678542003c504
(next time you can submit a PR if you want)