Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/baselines/reference/narrowingUnionToUnion.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function f1x(obj) {


//// [narrowingUnionToUnion.d.ts]
declare type Falsy = false | 0 | 0n | '' | null | undefined;
type Falsy = false | 0 | 0n | '' | null | undefined;
declare function isFalsy(value: unknown): value is Falsy;
declare function fx1(x: string | number | undefined): void;
declare function fx2<T>(x: T | undefined): void;
Expand Down Expand Up @@ -411,7 +411,7 @@ declare function isMaybeZero(value: number | null | undefined): value is 0 | nul
declare function isEmptyArray<T>(value: T[]): value is [];
declare function isMaybeEmptyArray<T>(value: T[] | null | undefined): value is [] | null | undefined;
declare const TEST_CASES: (((value: string) => void) | ((value: number) => void) | ((value: string[]) => void))[];
declare type EmptyString = '' | null | undefined;
type EmptyString = '' | null | undefined;
declare function isEmpty(value: string | EmptyString): value is EmptyString;
declare let test: string | null | undefined;
declare function assert<T>(value: any): asserts value is T;
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/parseAssertEntriesError.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ ImportInterface;


//// [index.d.ts]
export declare type LocalInterface = import("pkg", { assert: {} });
export type LocalInterface = import("pkg", { assert: {} });
export declare const a: any;
export declare const b: any;
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,5 @@ inJsArrow(2); // no error gets linted as expected


//// [typeTagOnFunctionReferencesGeneric.d.ts]
/**
* @typedef {<T>(m : T) => T} IFn
*/
/**@type {IFn}*/
export function inJs<T>(l: T): T;
export function inJs<T>(m: T): T;
export type IFn = <T>(m: T) => T;
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

/**@type {IFn}*/
export function inJs(l) {
>inJs : <T>(l: T) => T
>inJs : <T>(m: T) => T
>l : T

return l;
>l : T
}
inJs(1); // lints error. Why?
>inJs(1) : 1
>inJs : <T>(l: T) => T
>inJs : <T>(m: T) => T
>1 : 1

/**@type {IFn}*/
Expand Down