This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto-fix for no-var-keyword (#1547)
Note, we just replace with `let` which can cause errors if the identifier is referenced before the declaration or outside the scope. TypeScript will catch these at type-check time.
- Loading branch information
Showing
2 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
let foo; | ||
|
||
function tmp(t: any) { | ||
let x = 3; | ||
} | ||
|
||
let i, | ||
j; | ||
|
||
let [a, b] = [1, 2]; | ||
|
||
for (let n; false;); | ||
for (let n1 in foo); | ||
for (let n2 of foo); | ||
|
||
export let exportVar0 = 0; | ||
export let exportVar1 = 1; | ||
export let exportVar2 = 2, | ||
exportVar21 = 21; | ||
export /* var tst */ let exportVar3 = 3; | ||
|
||
module quz { | ||
export let i; | ||
} | ||
|
||
declare var tmp2: any; | ||
|
||
let bar; | ||
const qux; | ||
|
||
let k, | ||
l; | ||
|
||
let [x, y] = [1, 2]; | ||
|
||
for (n; false;); | ||
for (let n; false;); | ||
for (let name in foo); | ||
for (let name of foo); | ||
for (const name in foo); | ||
for (const name of foo); | ||
|
||
export let exportLet = 1; | ||
export const exportConst = 1; |