dart-archive / angular_analyzer_plugin

WORK MOVED TO dart-lang/angular repository
https://github.com/dart-lang/angular/tree/master/angular_analyzer_plugin
68 stars 13 forks source link

Providing duplicate directives, style URLs and providers doesn't show any warning #670

Open ghost opened 5 years ago

ghost commented 5 years ago
import 'package:angular/angular.dart';
import 'package:angular_components/angular_components.dart';

@Component(
    selector: 'example-comp',
    templateUrl: 'example_comp.html',
    directives: const [
      MaterialToggleComponent,
      MaterialToggleComponent, // no warning
    ],
    styleUrls: const [
      'example_comp.scss.css',
      'example_comp.scss.css' // no warning
    ],
    providers: [
      popupBindings,
      popupBindings, // no warning
    ],
    exports: [
      ModalComponent,
      ModalComponent,// shows warning
    ])
class ExampleComp{
}

In above example providing duplicate directives, style URLs and providers doesn't show any warning. Warnings are shown only for duplicate values in exports field.

MichaelRFairhurst commented 5 years ago

This is a great feature request to detect this, thanks!! Absolutely would be useful, and shouldn't be too difficult either.

Thanks for filing and for the detailed example!