Closed
Description
My pubspec.yaml has:
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
Using dartanalyzer version 2.2.1-edge.a8f3a5dae6203d1064726a5953cf06a7d484249c against the following code triggers:
final mySet = Set<String>();
lint • Use collection literals when possible at ... • prefer_collection_literals
But if I change the code to:
final mySet = <String>{};
then I get:
hint • Set literals were not supported until version 2.2, but this code is required to be able to run on earlier versions at ... • sdk_version_set_literal
So I can't win. I could add // ignore: prefer_collection_literals
, but then I won't get the lint when I do upgrade the minimum SDK version.
Should the prefer_collection_literals
lint should take the minimum SDK version into account to restrict "when possible"?