-
Notifications
You must be signed in to change notification settings - Fork 308
v1.3.8 - Lint task is throwing many "All imports are unused." #1052
Comments
I got this as well when going from v1.3.7 to v1.3.12. After finding your post I verified that indeed the issue would occur when going from v1.3.7 to v1.3.8. Plenty of false positives with I haven't found a solution, but as a work-around, I went to an FWIW, turning Here is what my tslint.json is for now:
|
Same here. |
I'm facing the same problem. A lot of false positives. For example by simple importing OnInit and implement it in my class will trow an warning after the compilation saying the OnInt is not being used. |
I have the same trouble. Ionic team why you didnt test carefully packages before release them? |
Unfortunately, the same issue of many |
Yes, I'm also on 2.0.2 and having this issue. global packages: local packages: System: |
one trick to remove this warning in the import section of our .ts files, is disable temporary the rule 'no-unused-variable at the start of the file, and re-enable after all the imports are done: // tslint:disable: no-unused-variable
import {a, b,c } from 'something'
// tslint:enable: no-unused-variable
@Component({...}) ... |
@AlejandroSilva what do intend wirh re-enable after all imports are done. |
Same issue with version 2.1.0 |
I am getting the same issue on 2.0.2: cli packages:
global packages:
local packages:
System:
|
I've seen this error fire when the imported class isn't being used appropriately. For example, if I import a class and use it as an interface, TSLint doesn't like it: Fires the "All imports are unused":
Passes TSLint:
So, essentially, the imported class isn't recognized as being used, if it's used incorrectly. Edit: In Angular 2x, the
|
Per a comment here, removing |
@jczaplew Thanks for that.... for me it was removing |
Also removed |
Yes the
I believe this issue can be closed. |
Yeah, just remove 'src/declarations.d.ts' file. That did the trick. Thanks a LOT. One less problem in my life. |
Yes removing src/declarations.d.ts worked. We can close this issue. |
Seems inappropriate to close this since others can still run into this and now have to find a closed GitHub issue to resolve it. Removing the file should be baked into an upgrade script. |
I have to import some JavaScript modules files like this removing
Not sure which should be the right behavior of get TSLINT and custom js imports work together |
how to remove this declaration.d.ts file??????? |
@Aqib33 right click + delete ? |
i mean where is this file please guide |
@mebibou ??ill be able to delete only if i know where it is & how to do it |
@Aqib33 I think it was in the |
its not there ;( please tell some, im stuck |
@Aqib33 if you have a specific problem, then either go to stackoverflow or create a new issue, this is not a Q&A |
please help me i am stuck
allmodules are unused , im trying to use geolocation ,
please brother
…On Sat, Jan 20, 2018 at 12:03 AM, Guillaume ***@***.***> wrote:
@Aqib33 <https://github.com/aqib33> I think it was in the src folder
before, but if you dont see it, then it's probably not there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1052 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ah9dzUrGjUso0f4l0KN-G6n1hT4-Z1dYks5tMOb7gaJpZM4OCsdQ>
.
|
Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/
Short description of the problem:
Lint task is throwing many "All imports are unused." kind of error after upgrading to 1.3.8. Some error are false positives.
What behavior are you expecting?
Such false positives should not appear. Not sure if this is issue with tslint version 5.2 or something I need to set in the tslint.json
Steps to reproduce:
Sample code below causes
ERROR: ..../src/utils/translate-utils.ts[1, 1]: All imports are unused.
translate-utils.ts:
tslint.json:
Which @ionic/app-scripts version are you using?
1.3.8
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
The text was updated successfully, but these errors were encountered: