Skip to main content

avoid-implicitly-nullable-extension-types

added in: 1.22.0
🛠
Pro+

Warns when an extension type declaration does not have the implements clause.

Not adding the implements clause (when applicable) implicitly makes the extension type nullable even when the representation type is not.

Additional resources:

Example

❌ Bad:

extension type ET1(String s) {} // LINT

extension type ET3(String? s) {}

✅ Good:

extension type ET1(String s) implements String {}

extension type ET3(String? s) {}