avoid-nested-extension-types
Warns when the representation field of an extension type is also an extension type.
⚙️ Config
Set acceptable-level
(default is 2
) to configure the acceptable nesting level.
dart_code_metrics:
...
rules:
...
- avoid-nested-extension-types:
acceptable-level: 2
Example
❌ Bad:
extension type ET1(String s) {}
extension type ET2(ET1 inner) {}
extension type ET3(ET2 inner) {} // LINT
✅ Good:
extension type ET1(String s) {}
extension type ET2(ET1 inner) {}