Skip to main content

avoid-extensions-on-records

added in: 1.10.0
Dart 3.0+
Pro+

Warns when an extension is declared on a record type.

Example

❌ Bad:

typedef Record = (String, String);

extension Extension on (String, String) {} // LINT

extension RecordX on Record {} // LINT

✅ Good:

class InsteadOfExtension {
// ...
}