Avoid tslint warnings (All imports are unused)


#1

Hello Experts

Given:

  • IONIC 3

  • ionic serve works perfectly.

  • the console shows
    [13:12:53] tslint: src/pages/login/login.ts, line: 2
    All imports are unused.

     L1:  import { Component } from '@angular/core';
     L2:  import { NgForm } from '@angular/forms';
    

Required

  • Avoid tslint warnings

I would appreciate any help.

Regards
Mahmoud


#2

Although it could be annoying, I wouldn’t recommend turning it off. But if you insist, I suppose you should take a look at the settings over here:

https://palantir.github.io/tslint/rules/no-unused-variable/


#3

Thanks a lot.
It is clear.


#4

Does it hurt the app to have unused imports?
I only see no-unused-variable nothing specific to imports only?
It would be nice to have some ignore-unused-imports per file as a comment.
I tend to have a bunch of pages in app.components.ts I like to hook into for testing / short-cutting the default app workflow.