Linter: [analyzer] Type aliases are not working well with the `always_specify_types` rule聽

Created on 3 Jun 2021  路  9Comments  路  Source: dart-lang/linter

typedef JsonMap = Map<String, dynamic>;
typedef JsonList = List<JsonMap>;

image

This tracker is for issues related to: Analyzer

  • Dart SDK Version: 2.13.1
  • macOS BigSur
bug false positive new language feature

Most helpful comment

In my opinion, false positives should generally have a high priority because they erode user trust.

All 9 comments

@srawlins Any priority on this? It's preventing us to use type alias since it raises warnings.

@AlexV525 no priority on this yet.

@pq I'm not sure how we prioritize false positives...

In my opinion, false positives should generally have a high priority because they erode user trust.

Another false positive about always_specify_types #2671 .

+1 to what Brian said. As far as prioritizing relative to other false positives, I (informally) apply a multiplier for issues impacting core/recommended/pedantic/flutter lints. I'm looking at making this more formal FWIW... (And if anyone wants to brainstorm about that, let me know!)

I think each false positive would get a priority bump also because they don't require cleanup, if the fix really means that no new cases would be reported.

And now it's the "New feature has come, but it's not really come" thing since we can't really put it into production... 馃槗 An issue for a new feature might have a priority bump too?

Can you not // ignore the lint reported? I don't think this should block adoption of new type aliases.

We could, but we shouldn't. The profit that type aliases bring is less than the code quality drop's effects. Consider that we have multiple classes that would need to use Json alias, then we'll going to ignore it everywhere when we use it.

Was this page helpful?
0 / 5 - 0 ratings