-
Notifications
You must be signed in to change notification settings - Fork 887
"Variable used before declaration" with renamed import with the same name as another import #1400
Comments
Off topic – excellent issue template by the way :) |
The root case for this issue - change in behavior of I've tracker this to function
I didn't found any notices about such breaking changes in @jkillian, @adidahiya possible fix is to track positions of imported properties that has alias and don't show error if highlighted position matches position of tracked items. This won't introduce any problems for TS1.8. However this method is used across several other rules and may cause other regressions. Is it possible that this is regression in TS? |
This error was gone in TS 2.1.x but reappared in TS 2.2. A type declaration for CSS modules as follows:
and an import in
results in:
|
A workaround for this is to add as many number of lines before the |
seems to be fixed in tslint 5.1 |
@joscha thanks for the confirmation, that makes sense since we switched to |
Just to clarify, |
Having similar issue, but with a code like that. Is this related? import { Component, ViewChild } from '@angular/core';
import { BasePage } from '../core/basepage.component';
@Component({
selector: 'app-page-seller',
templateUrl: 'seller.component.html'
})
export class SellerPageComponent extends BasePage {
@ViewChild('myTabs') tabRef: Tabs;
tab1Root: any = SellerViewComponent;
tab2Root: any = SellerAreaComponent;
tab3Root: any = SellerOrdersComponent; The error: |
Bug Report
3.13.0
2.0.0
TypeScript code being linted
with
tslint.json
configuration:Actual behavior
index.ts[1, 10]: variable 'Test' used before declaration
Expected behavior
No errors. This works correctly with Typescript 1.8.10.
Example repo at https://github.com/tomduncalf/tslint-bug
The text was updated successfully, but these errors were encountered: