dart-lang / linter

Linter for Dart.
https://dart.dev/tools/linter-rules
BSD 3-Clause "New" or "Revised" License
633 stars 170 forks source link

prefer_single_quotes should lint without looking into string interpolation #812

Closed a14n closed 7 years ago

a14n commented 7 years ago

"hello ${'world'}" should be linted.

aemino commented 7 years ago

At the moment, the prefer_single_quotes rule seems to intentionally allow that syntax. The reasoning is laid out here.

a14n commented 7 years ago

Thanks, it can make sense for some code. And I guess that's why expressions in string interpolation are not linted:

    "${""}"; // OK
    '${''}'; // OK
    '${'${'${'${''}'}'}'}'; // OK
    '${"${'${"${''}"}'}"}'; // OK