How to enforce error on impossible equality check?

  Kiến thức lập trình

There is a linter to it https://dart.dev/tools/linter-rules/unrelated_type_equality_checks but it just shows a warning, rendering it almost useless for large projects.

How to convert the warning into errors ?

Example:

void giveAccessToEverything() {
  /// nuclear codes
}
void main () {
  final isAdmin = "isAdmin"; // Database guy Changed to enum 

  if (isAdmin != true) {
    return;
  }
  giveAccessToEverything();
}

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT