Files
sdk/pkg/analyzer/tool/wolf
Sam Rawlins db35cbf6d9 linter: Fix unnecessary_parenthesis with list literals
Fixes https://github.com/dart-lang/linter/issues/3046

The diff looks bigger than it is. The gist is:

* There is a check for if the ParenthesizedExpression is immediately
  wrapped with parens. Move that check higher.
* There are broad exceptions for ConditionalExpressions and
  TypeLiterals being wrapped with parens. Also move those higher.
* Add allowances for wrapped expressions which "directly" contain
  whitespace, except for a few cases where the parens are still
  considered unnecessary, such as an expression that is an argument.
* Add allowances for PrefixExpressions and PostfixExpressions which
  are the "targets" of property access or method invocations.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I808586df874b20b064d4f4a0bd7775b2ec28442a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366891
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-07-17 14:46:20 +00:00
..