With app-scripts 1.3.12, when an import is only use as declaration, tslint will display this import as never used
No warning
Steps to reproduce:
Code
import {Slides} from 'ionic-angular';
@Component({
templateUrl: 'test.html',
selector: 'test'
})
export class TestPage {
@ViewChildren('mySlider') private slides: QueryList<Slides>;
}
* tslint output *
[11:34:13] tslint: src/pages/test.ts, line: 5 'Slides' is declared but never used.
L5: import {Slides} from 'ionic-angular';
Which @ionic/app-scripts version are you using?
1.3.12
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Gulp CLI : CLI version 1.2.2 Local version 3.9.1
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 1.3.12
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-gulp : 1.0.1
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.5.0
System:
Node : v8.1.3
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.0
ios-sim : 5.0.13
npm : 5.0.4
slightly related i'm getting linting error where I've disabled linting with comment
// tslint:disable has no effect
Same issue here
Duplicate of #1052, where the same issue was already occurring on 1.3.8.
Another example:
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'bookingStatusForRating' })
export class BookingStatusForRatingPipe implements PipeTransform {
results in " 'PipeTransform' is declared but never used." when it clearly is.
I'm facing this issue as well. In my case, I've upgraded from [email protected] to (current) latest [email protected]. If someone, in Ionic stuff, need a live example, I can provide you with the entire project. Thanks.
Also a problem for me. I just updated the Ionic scripts today and got lots of ' ... is declared but never used.' for imports that are actually being used. Really annoying. But the build works normally.
My env:
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils : 1.7.0
ionic (Ionic CLI) : 3.7.0
global packages:
Cordova CLI : 6.5.0
local packages:
@ionic/app-scripts : 2.1.3
@ionic/cli-plugin-cordova : 1.4.1
Cordova Platforms : android 6.1.2
Ionic Framework : ionic-angular 3.6.0
System:
Android SDK Tools : 25.2.5
Node : v6.9.1
OS : Windows 8.1
npm : 4.1.1
I've got the same issue as @rroque6428 above, but I'm on 3.7.0.
Ionic info:
cli packages: (C:\git\mobile\node_modules)
@ionic/cli-plugin-cordova : 1.6.2
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils : 1.7.0
ionic (Ionic CLI) : 3.7.0
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 2.1.3
Cordova Platforms : android 6.2.3 ios 4.3.1
Ionic Framework : ionic-angular 3.6.0
System:
Android SDK Tools : 25.2.5
Node : v6.10.3
OS : Windows 8.1
npm : 3.10.8
Same issue as @lostdev @rroque6428 @peterpeterparker.
cli packages: (//node_modules)
@ionic/cli-plugin-cordova : 1.6.1
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils : 1.7.0
ionic (Ionic CLI) : 3.7.0
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 1.3.12
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.0.1
System:
Node : v6.11.2
OS : Linux 4.10
npm : 3.10.10
strange, I also just updated my dependencies, now my app does not work anymore :/
Same issue here:
cli packages: (/Users/pichonx/Development/tendbe/tb-mobile/node_modules)
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
local packages:
@ionic/app-scripts : 2.1.0
Ionic Framework : ionic-angular 3.5.3
System:
Node : v6.9.1
npm : 3.10.8
OS : macOS Sierra
does sombody have found something yet?
Solved. Check #1052
In short: just remove 'src/declarations.d.ts' file (refer to the above thread for details)
Thx @rroque6428 but the issue you listed doesn't solve this issue.
My project already doesn't contains any declarations.d.ts
The issue is therefore still open.
Thx @rroque6428 the issue you listed did solve this issue.
not sure if removing the file is the right solution, we need the declaration file because we import third part javascript files.
is the problem solved for anyone ?
Here is the solution
https://github.com/ionic-team/ionic-app-scripts/issues/1052#issuecomment-324613840
Removing declarations.d.ts didn't help me either. It seems like this issue is supposed to be fixed in newer typescript versions, but I am still having issues even with ts 1.5.3: https://github.com/palantir/tslint/issues/2470
I also have this issue and deleting the declaration.d.ts file removed some of the false positive warnings I have but not all of them.
Most helpful comment
Solved. Check #1052
In short: just remove 'src/declarations.d.ts' file (refer to the above thread for details)