run method
void
run(
- CustomLintResolver resolver,
- ErrorReporter reporter,
- CustomLintContext context
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.addInstanceCreationExpression((node) {
final createdType = node.constructorName.type.type;
if ((createdType.toString() == 'Text' ||
createdType.toString() == 'AutoSizeText') &&
node.argumentList.arguments.isNotEmpty &&
node.argumentList.arguments.first is StringLiteral) {
reporter.reportErrorForNode(_code, node, []);
}
});
}