-
Notifications
You must be signed in to change notification settings - Fork 96
Enforce "noUnusedLocals" : Report errors on unused locals. #200
Enforce "noUnusedLocals" : Report errors on unused locals. #200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@@ -64,6 +63,7 @@ export class BaseView implements View { | |||
/** true if the view was registered */ | |||
registered = false; | |||
/** An object to log information to */ | |||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we disabling if we want to avoid redundant definitions?
@@ -30,6 +29,7 @@ export abstract class SpanBase implements types.Span { | |||
/** Indicates if this span was ended */ | |||
private endedLocal = false; | |||
/** Indicates if this span was forced to end */ | |||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we disabling if we want to avoid redundant definitions?
@@ -40,6 +38,7 @@ export class CoreTracer implements types.Tracer { | |||
/** A list of end span event listeners */ | |||
private eventListenersLocal: types.SpanEventListener[] = []; | |||
/** A list of ended root spans */ | |||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we disabling if we want to avoid redundant definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, I added to suppress errors. I am not completely aware of CoreTracer properties, hence didnt remove that variable. Anyways, I will remove it in next PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, I added to suppress errors. I am not completely aware of CoreTracer properties, hence didnt remove that variable. Anyways, I will remove it in next PR.
How users will use Typescript for their projects in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like each case it's a private unused variable, so we should clean them up. Let's just remove them in the next PR like @mayurkale22 suggested. They aren't api breaking to remove since they're private.
Add
--noUnusedLocals
Compiler Options to disallows unused imports, variables, functions andprivate class members.