mixin support for camel_case_types

Fixes: https://github.com/dart-lang/linter/issues/2532

Change-Id: Icbc5c9ae4bd8b50c1a4471424bd9ae3d95299257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352976
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
This commit is contained in:
pq 2024-02-20 16:59:03 +00:00 committed by Commit Queue
parent c55a99c855
commit 22520f43f9
2 changed files with 14 additions and 0 deletions

View file

@ -60,6 +60,7 @@ class CamelCaseTypes extends LintRule {
registry.addFunctionTypeAlias(this, visitor);
registry.addEnumDeclaration(this, visitor);
registry.addExtensionTypeDeclaration(this, visitor);
registry.addMixinDeclaration(this, visitor);
}
}
@ -107,4 +108,9 @@ class _Visitor extends SimpleAstVisitor<void> {
void visitGenericTypeAlias(GenericTypeAlias node) {
check(node.name);
}
@override
void visitMixinDeclaration(MixinDeclaration node) {
check(node.name);
}
}

View file

@ -76,4 +76,12 @@ macro class a { }
lint(12, 1),
]);
}
test_mixin_lowerCase() async {
await assertDiagnostics(r'''
mixin m { }
''', [
lint(6, 1),
]);
}
}