leancodepl / flutter_corelibrary

Our core packages used for building the best Flutter apps.
https://pub.dev/publishers/leancode.co
57 stars 7 forks source link

"use_design_system_item" lint should ignore import "hide" instructions #342

Closed KamilSztandur closed 2 months ago

KamilSztandur commented 2 months ago

What's wrong: Leancode Lints throw a warning when you hide a class that has corresponding name to the banned class in one of use_design_system_item lints.

The unexpected result:

image

The expected result: I can hide this member without triggering the warning.

How to reproduce:

  1. Setup leancode_lints for your project.
  2. Add this to your analysis_options.yaml:
    custom_lint:
    rules:
    - use_design_system_item:
      AppBadge:
        - instead_of: Badge
          from_package: flutter
    1. Try to hide Badge class from material import:
      import 'package:flutter/material.dart' hide Badge;