Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a type error when exactOptionalPropertyTypes is enabled #339

Merged
merged 1 commit into from
Mar 19, 2024
Merged
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
2 changes: 1 addition & 1 deletion lib/router/route-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
model?(params: Dict<unknown>, transition: Transition): PromiseLike<T> | undefined | T;
deserialize?(params: Dict<unknown>, transition: Transition): T | PromiseLike<T> | undefined;
serialize?(model: T | undefined, params: string[]): Dict<unknown> | undefined;
beforeModel?(transition: Transition): PromiseLike<any> | any;

Check warning on line 29 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 29 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 29 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 29 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 29 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 29 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 29 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type

Check warning on line 29 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type
afterModel?(resolvedModel: T | undefined, transition: Transition): PromiseLike<any> | any;

Check warning on line 30 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 30 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 30 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 30 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 30 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 30 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 30 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type

Check warning on line 30 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type
setup?(context: T | undefined, transition: Transition): void;
enter?(transition: Transition): void;
exit?(transition?: Transition): void;
Expand All @@ -47,13 +47,13 @@
readonly queryParams: Dict<unknown>;
readonly metadata: unknown;
find(
predicate: (this: any, routeInfo: RouteInfo, i: number) => boolean,

Check warning on line 50 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 50 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 50 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 50 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type
thisArg?: any

Check warning on line 51 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 51 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 51 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 51 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type
): RouteInfo | undefined;
}

export interface RouteInfoWithAttributes extends RouteInfo {
attributes: any;

Check warning on line 56 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 56 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 56 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 56 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type
}

type RouteInfosKey = InternalRouteInfo<Route>;
Expand Down Expand Up @@ -89,8 +89,8 @@

let routeInfo: RouteInfo = {
find(
predicate: (this: any, routeInfo: RouteInfo, i: number, arr?: RouteInfo[]) => boolean,

Check warning on line 92 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 92 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 92 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 92 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type
thisArg: any

Check warning on line 93 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 93 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 93 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 93 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type
) {
let publicInfo;
let arr: RouteInfo[] = [];
Expand Down Expand Up @@ -179,7 +179,7 @@

function createRouteInfoWithAttributes(
routeInfo: RouteInfo,
context: any

Check warning on line 182 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (12)

Unexpected any. Specify a different type

Check warning on line 182 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (14)

Unexpected any. Specify a different type

Check warning on line 182 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (16)

Unexpected any. Specify a different type

Check warning on line 182 in lib/router/route-info.ts

View workflow job for this annotation

GitHub Actions / Tests (17)

Unexpected any. Specify a different type
): RouteInfoWithAttributes {
let attributes = {
get attributes() {
Expand Down Expand Up @@ -224,7 +224,7 @@
name: string;
params: Dict<unknown> | undefined = {};
queryParams?: Dict<unknown>;
context?: ModelFor<R> | PromiseLike<ModelFor<R>>;
context?: ModelFor<R> | PromiseLike<ModelFor<R>> | undefined;
isResolved = false;

constructor(router: Router<R>, name: string, paramNames: string[], route?: R) {
Expand Down
Loading