-
Notifications
You must be signed in to change notification settings - Fork 170
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only lint with prefer_interpolation_to_compose_strings when one using at least one string literal #735
Comments
I agree with your point, but your example seems a bit artificial (given that you could have had just one constant from the beginning). In the instances where I have seen this, either string interpolation or using a stringbuffer result in more readable (or efficient) code. Does this example reflect the issue you had in your code? Can you provide a closer one if not? |
This is pretty close to what we have in our code base: var listOfStrings = [];
var baseString = 'base';
var values = [
'value1',
'value2',
'value3',
'value4',
'value5',
'value6',
];
for (var value in values) {
listOfStrings.add(baseString + value);
} |
Thanks for the example @jacehensley-wf! |
Hey there, I think I came across an issue with the
prefer_interpolation_to_compose_strings
lint. When combining two non-literal strings I still get the lint, it seems odd that I should create a new string literal just to combine two existing strings.The text was updated successfully, but these errors were encountered: