Use positional arguments instead of manual string interpolation
This PR is purely technical and does not introduce any behavior changes.
Refactors lint codes to use built-in positional parameters (like {0}) in lint messages.
Personally, I am not convinced to the benefits. This makes it much more susceptible to refactors. It is very easy to desync arguments: and {n} placeholders.
Yes, it is nice that it is built in. But Dart APIs are known to be designed in a pragmatic (???) rather than type safe way. We can build a small type safe wrapper?
Personally, I am not convinced to the benefits. This makes it much more susceptible to refactors. It is very easy to desync
arguments:and{n}placeholders.Yes, it is nice that it is built in. But Dart APIs are known to be designed in a pragmatic (???) rather than type safe way. We can build a small type safe wrapper?
It is indeed unfortunate that the analyzer only accepts positional arguments. The main benefit is that we define the lints the way they're supposed to be defined. In particular, after this refactor, we create only one LintCode with the template string – this way, it's actually easier to keep the messages consistent, in my opinion