Skip to content

Commit c4eeff8

Browse files
committed
fix prettier
1 parent 115a85b commit c4eeff8

10 files changed

Lines changed: 46 additions & 62 deletions

File tree

packages/router_js/lib/route-info.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@ import { Promise } from 'rsvp';
33
import type { Dict, Option } from './core';
44
import type { SerializerFunc } from './router';
55
import type Router from './router';
6-
import type {
7-
PublicTransition as Transition} from './transition';
6+
import type { PublicTransition as Transition } from './transition';
87
import type InternalTransition from './transition';
9-
import {
10-
isTransition,
11-
PARAMS_SYMBOL,
12-
prepareResult,
13-
QUERY_PARAMS_SYMBOL,
14-
} from './transition';
8+
import { isTransition, PARAMS_SYMBOL, prepareResult, QUERY_PARAMS_SYMBOL } from './transition';
159
import { isParam, isPromise, merge } from './utils';
1610
import { throwIfAborted } from './transition-aborted-error';
1711

packages/router_js/lib/router.ts

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,19 @@ import type { MatchCallback, Params, QueryParams } from 'route-recognizer';
33
import RouteRecognizer from 'route-recognizer';
44
import { Promise } from 'rsvp';
55
import type { Dict, Maybe, Option } from './core';
6-
import type {
7-
ModelFor,
8-
Route,
9-
RouteInfo,
10-
RouteInfoWithAttributes} from './route-info';
6+
import type { ModelFor, Route, RouteInfo, RouteInfoWithAttributes } from './route-info';
117
import type InternalRouteInfo from './route-info';
12-
import {
13-
toReadOnlyRouteInfo,
14-
} from './route-info';
15-
import type {
16-
OpaqueTransition,
17-
PublicTransition as Transition} from './transition';
18-
import InternalTransition, {
19-
logAbort,
20-
QUERY_PARAMS_SYMBOL,
21-
STATE_SYMBOL,
22-
} from './transition';
8+
import { toReadOnlyRouteInfo } from './route-info';
9+
import type { OpaqueTransition, PublicTransition as Transition } from './transition';
10+
import InternalTransition, { logAbort, QUERY_PARAMS_SYMBOL, STATE_SYMBOL } from './transition';
2311
import { throwIfAborted, isTransitionAborted } from './transition-aborted-error';
2412
import type { TransitionIntent } from './transition-intent';
2513
import NamedTransitionIntent from './transition-intent/named-transition-intent';
2614
import URLTransitionIntent from './transition-intent/url-transition-intent';
2715
import type { TransitionError } from './transition-state';
2816
import TransitionState from './transition-state';
29-
import type {
30-
ChangeList,
31-
ModelsAndQueryParams} from './utils';
32-
import {
33-
extractQueryParams,
34-
forEach,
35-
getChangelist,
36-
log,
37-
merge,
38-
promiseLabel,
39-
} from './utils';
17+
import type { ChangeList, ModelsAndQueryParams } from './utils';
18+
import { extractQueryParams, forEach, getChangelist, log, merge, promiseLabel } from './utils';
4019

4120
export interface SerializerFunc<T> {
4221
(model: T, params: string[]): Dict<unknown>;

packages/router_js/lib/transition-intent/named-transition-intent.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
/* eslint-disable no-prototype-builtins */
22
import type { Dict } from '../core';
3-
import type {
4-
ModelFor,
5-
ResolvedRouteInfo,
6-
Route} from '../route-info';
3+
import type { ModelFor, ResolvedRouteInfo, Route } from '../route-info';
74
import type InternalRouteInfo from '../route-info';
8-
import {
9-
UnresolvedRouteInfoByObject,
10-
UnresolvedRouteInfoByParam,
11-
} from '../route-info';
5+
import { UnresolvedRouteInfoByObject, UnresolvedRouteInfoByParam } from '../route-info';
126
import type { ParsedHandler } from '../router';
137
import type Router from '../router';
148
import { TransitionIntent } from '../transition-intent';

packages/router_js/lib/transition-intent/url-transition-intent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Route} from '../route-info';
1+
import type { Route } from '../route-info';
22
import { UnresolvedRouteInfoByParam } from '../route-info';
33
import type Router from '../router';
44
import { TransitionIntent } from '../transition-intent';

packages/router_js/lib/transition.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { Promise } from 'rsvp';
22
import type { Dict, Maybe, Option } from './core';
3-
import type {
4-
ModelFor,
5-
Route,
6-
RouteInfo,
7-
RouteInfoWithAttributes,
8-
} from './route-info';
3+
import type { ModelFor, Route, RouteInfo, RouteInfoWithAttributes } from './route-info';
94
import type InternalRouteInfo from './route-info';
105
import type Router from './router';
11-
import type { TransitionAbortedError} from './transition-aborted-error';
6+
import type { TransitionAbortedError } from './transition-aborted-error';
127
import { buildTransitionAborted } from './transition-aborted-error';
138
import type { OpaqueIntent } from './transition-intent';
149
import type { TransitionError } from './transition-state';

packages/router_js/tests/route_info_test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import type { Transition } from '../index';
22
import type { Dict } from '../lib/core';
3-
import type {
4-
IModel,
5-
Route} from '../lib/route-info';
3+
import type { IModel, Route } from '../lib/route-info';
64
import {
75
ResolvedRouteInfo,
86
toReadOnlyRouteInfo,

packages/router_js/tests/router_test.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,9 +3102,15 @@ scenarios.forEach(function (scenario) {
31023102
router.isActive('showPost', posts[1]),
31033103
'The showPost handler is active with the appropriate context'
31043104
);
3105-
assert.notOk(router.isActive('showPost', posts[2]), 'The showPost handler is inactive when the context is different');
3105+
assert.notOk(
3106+
router.isActive('showPost', posts[2]),
3107+
'The showPost handler is inactive when the context is different'
3108+
);
31063109
assert.notOk(router.isActive('adminPost'), 'The adminPost handler is inactive');
3107-
assert.notOk(router.isActive('showPost', null), 'The showPost handler is inactive with a null context');
3110+
assert.notOk(
3111+
router.isActive('showPost', null),
3112+
'The showPost handler is inactive with a null context'
3113+
);
31083114

31093115
transitionTo(router, 'adminPost', admin, adminPost);
31103116
assert.ok(router.isActive('adminPost'), 'The adminPost handler is active');
@@ -5198,8 +5204,14 @@ scenarios.forEach(function (scenario) {
51985204
router.isActive('child', { one: 'a', two: 'b' }, { three: 'c', four: 'd' }),
51995205
'child(1:a, 2:b, 3:c, 4:d)'
52005206
);
5201-
assert.notOk(router.isActive('child', { one: 'e', two: 'b' }, { three: 'c', four: 'd' }), '!child(1:e, 2:b, 3:c, 4:d)');
5202-
assert.notOk(router.isActive('child', { one: 'a', two: 'b' }, { three: 'c', four: 'e' }), '!child(1:a, 2:b, 3:c, 4:e)');
5207+
assert.notOk(
5208+
router.isActive('child', { one: 'e', two: 'b' }, { three: 'c', four: 'd' }),
5209+
'!child(1:e, 2:b, 3:c, 4:d)'
5210+
);
5211+
assert.notOk(
5212+
router.isActive('child', { one: 'a', two: 'b' }, { three: 'c', four: 'e' }),
5213+
'!child(1:a, 2:b, 3:c, 4:e)'
5214+
);
52035215
});
52045216

52055217
test('isActive supports multiple soaked up string/number params (mixed)', function (assert) {

packages/router_js/tests/test_helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Backburner from 'backburner.js';
22
import type { Route, Transition } from '../index';
33
import Router from '../index';
44
import type { Dict } from '../lib/core';
5-
import type { IModel} from '../lib/route-info';
5+
import type { IModel } from '../lib/route-info';
66
import RouteInfo, { UnresolvedRouteInfoByParam } from '../lib/route-info';
77
import type { PublicTransition } from '../lib/transition';
88
import { logAbort } from '../lib/transition';

packages/router_js/tests/transition_intent_test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ scenarios.forEach(function (scenario) {
226226
let handlerInfos = newState.routeInfos;
227227

228228
assert.equal(handlerInfos.length, 2);
229-
assert.notStrictEqual(handlerInfos[0], startingHandlerInfo, 'The starting foo resolved handlerInfo was overridden because the new had different params');
229+
assert.notStrictEqual(
230+
handlerInfos[0],
231+
startingHandlerInfo,
232+
'The starting foo resolved handlerInfo was overridden because the new had different params'
233+
);
230234
assert.ok(
231235
handlerInfos[1] instanceof UnresolvedRouteInfoByParam,
232236
'generated state consists of UnresolvedHandlerInfoByParam, 2'
@@ -247,7 +251,11 @@ scenarios.forEach(function (scenario) {
247251
let handlerInfos = newState.routeInfos;
248252

249253
assert.equal(handlerInfos.length, 2);
250-
assert.notStrictEqual(handlerInfos[0], startingHandlerInfo, 'The starting foo resolved handlerInfo gets overridden because the new one has a different name');
254+
assert.notStrictEqual(
255+
handlerInfos[0],
256+
startingHandlerInfo,
257+
'The starting foo resolved handlerInfo gets overridden because the new one has a different name'
258+
);
251259
assert.ok(
252260
handlerInfos[1] instanceof UnresolvedRouteInfoByParam,
253261
'generated state consists of UnresolvedHandlerInfoByParam, 2'

packages/router_js/tests/transition_state_test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import type { Transition } from '../index';
22
import type { Dict } from '../lib/core';
3-
import { type Route, UnresolvedRouteInfoByObject, UnresolvedRouteInfoByParam } from '../lib/route-info';
3+
import {
4+
type Route,
5+
UnresolvedRouteInfoByObject,
6+
UnresolvedRouteInfoByParam,
7+
} from '../lib/route-info';
48
import TransitionState, { type TransitionError } from '../lib/transition-state';
59
import { Promise, resolve } from 'rsvp';
610
import {

0 commit comments

Comments
 (0)