This plugin automatically imports when inject is used but not imported.
- ✒️ The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
Rules for automatically importing when inject
is used but not imported. Since @rdlabo/rules/deny-constructor-di
alone could not auto fix the import statement, made the rule independent.
Deny: use inject
function, but not imported.
import { Component } from '@angular/core';
@Component(...)
export class SigninPage {
private navCtrl = inject(NavController);
public helper = inject(HelperService);
}
Allow: use inject
function, and imported.
import { Component, inject } from '@angular/core';
@Component(...)
export class SigninPage {
private navCtrl = inject(NavController);
public helper = inject(HelperService);
}
No Options.