Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

tslint@next does not recognize some reassignation #1898

Closed
saschanaz opened this issue Dec 18, 2016 · 1 comment
Closed

tslint@next does not recognize some reassignation #1898

saschanaz opened this issue Dec 18, 2016 · 1 comment

Comments

@saschanaz
Copy link

saschanaz commented Dec 18, 2016

Bug Report

  • TSLint version: tslint@next
  • TypeScript version: typescript@next
  • Running TSLint via: Node.js API

TypeScript code being linted

From microsoft/TypeScript#13006:

https://github.com/SaschaNaz/TypeScript/blob/27a60e4580076b544fa7f822df84414b7ea2c357/src/services/navigationBar.ts#L32

export function getNavigationTree(sourceFile: SourceFile): NavigationTree {
    curSourceFile = sourceFile;
    const result = convertToTree(rootNavigationBarNode(sourceFile));
    curSourceFile = undefined;
    return result;
}
let curSourceFile: SourceFile;
// Identifier 'curSourceFile' is never reassigned; use 'const' instead of 'let'.

https://github.com/SaschaNaz/TypeScript/blob/27a60e4580076b544fa7f822df84414b7ea2c357/src/harness/unittests/session.ts#L395

let response: protocol.Response;
try {
    ({ response } = this.executeCommand(msg));
}
//  Identifier 'response' is never reassigned; use 'const' instead of 'let'.

with tslint.json configuration: https://github.com/Microsoft/TypeScript/blob/b15d1449550759f57759097a802abf14943e69cf/tslint.json

Actual behavior

Identifier '(variable name)' is never reassigned; use 'const' instead of 'let'.

Expected behavior

The variable is being reassigned so tslint shouldn't error out

@nchen63
Copy link
Contributor

nchen63 commented Dec 23, 2016

fixed by #1906 and #1908

@nchen63 nchen63 closed this as completed Dec 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants