run method
Emits lints for a given file.
run will only be invoked with files respecting filesToAnalyze
Implementation
@override
void run(
CustomLintResolver resolver,
ErrorReporter reporter,
CustomLintContext context,
) {
context.registry.addExpressionStatement((node) {
final expression = node.expression;
if (expression is AssignmentExpression) {
return;
}
final type = expression.staticType;
if (type == null || type is VoidType || type is NeverType) {
return;
}
if (_checker.isSuperTypeOf(type)) {
reporter.atNode(expression, code);
}
});
}