haxe-checkstyle
haxe-checkstyle copied to clipboard
Add check for string interpolation
It would be cool to add a rule which prefers string interpolation over using + on strings.
E.g.
var s = "Hello " + name; // Error
var s = 'Hello ${name}' // No error
It's probably easy to find all String constants, but using string interpolation might not make sense in all cases. e.g. when splitting strings over multiple lines for formatting or when you have a long and complicated expression instead of just name.
That particular example should probably still error, because $name should be preferred over ${name}.
@AlexHaxe that makes sense. Perhaps the check could cater for only checking single line expressions?