isInDfSaferDartPackage function

bool isInDfSaferDartPackage(
  1. RuleContext context
)

Whether the library analysed in context belongs to the package named df_safer_dart.

df_safer_dart is the package that defines the safe types and the @unsafeOrError primitives, so its own implementation legitimately does what several rules forbid. Those rules are for consumers and skip it.

Implementation

bool isInDfSaferDartPackage(RuleContext context) {
  return pubspecNameOf(context) == 'df_safer_dart';
}