forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from bloomberg/isolated-declarations-fixer
Code fixer improvements.
- Loading branch information
Showing
86 changed files
with
3,061 additions
and
1,654 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export const a = [42, 34] as const; | ||
const b = [42, 34] as const; | ||
|
||
export const c: number[] = [42, 34]; | ||
const d = [42, 34]; |
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
function foo() { | ||
return 42; | ||
} | ||
|
||
export const a: number = foo(); | ||
const b = foo(); | ||
|
||
export const c = 42; | ||
const d = 42; | ||
|
||
export const e = "42"; | ||
const f = "42"; | ||
export const g: "42" | "43" = foo() === 0 ? "42" : "43"; | ||
const h = foo() === 0 ? "42" : "43"; | ||
|
||
export const g: "42" | "43" = foo() === 0? "42": "43"; | ||
const h = foo() === 0? "42": "43"; |
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 |
---|---|---|
@@ -1,11 +1,6 @@ | ||
function mixin<T extends new (...a: any) => any>(ctor: T): T { | ||
return ctor; | ||
} | ||
class Point2D { | ||
x = 0; | ||
y = 0; | ||
} | ||
const Point3DBase: typeof Point2D = (mixin(Point2D)); | ||
export class Point3D extends Point3DBase { | ||
z = 0; | ||
} | ||
class Point2D { x = 0; y = 0; } | ||
const Point3DBase: typeof Point2D = mixin(Point2D); | ||
export class Point3D extends Point3DBase { z = 0; } |
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ const __default: { | |
x: number; | ||
y: number; | ||
} = foo(); | ||
export default __default; | ||
export default __default; |
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
6 changes: 4 additions & 2 deletions
6
external-declarations/fixer-test/expected/function_expressions.ts
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
function foo() { | ||
return 42; | ||
} | ||
|
||
export class A { | ||
readonly b = (): number => foo(); | ||
readonly c = function (): number { return foo(); }; | ||
readonly c = function(): number { return foo(); }; | ||
} | ||
|
||
export const b = (): number => foo(); | ||
export const c = function (): number { return foo(); }; | ||
export const c = function(): number { return foo(); }; |
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
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
Oops, something went wrong.