Skip to content

di-unused does not work for directive/component's controller #516

@maksimr

Description

@maksimr

STR:

  • Install eslint and eslint-plugin-angular
  • create javascript file with
angular.module('app')
  .component('foo', {
    template: '<div/>',
    controller: function($log, $q) {
      var $ctrl = this;
      $ctrl.$q = $q;
    }
  })
  • Add di-unused rule to .eslintrc

ER: Lint should throw error about unused $log
AR: No error

Gist with stub project
https://gist.github.com/maksimr/ef6c3f25c94a56616577191ce878f9f1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions