Open
Description
Expression.asA(Expression other)
always wraps the code into parentheses. While this is a good default it is not always necessary. The problem for me is that the generated code triggers the linter rule unnecessary_parenthesis in our CI. Unfortunately dart_style auto fixes does not support the removal of unnecessary parenthesis.
My suggestion would be to have an optional parameter.
the following:
becomes
Expression asA(Expression other, { bool parenthesized = true }) {
final exp = BinaryExpression._( expression, other, 'as'));
return parenthesized
? ParenthesizedExpression._(exp)
: exp
}