Skip to content

Commit 48327b6

Browse files
committed
chore: upgrade to Prettier 3
1 parent 1ad847e commit 48327b6

File tree

24 files changed

+169
-139
lines changed

24 files changed

+169
-139
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"lint-staged": "^15.2.10",
4141
"minimist": "^1.2.8",
4242
"p-series": "^3.0.0",
43-
"prettier": "^2.8.8",
43+
"prettier": "^3.5.2",
4444
"semver": "^7.6.3",
4545
"typedoc": "^0.26.11",
4646
"typedoc-plugin-markdown": "^4.2.10",

packages/playground/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

packages/router/__tests__/RouterLink.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function createLocations<
4747
normalized: RouteLocationResolved
4848
toResolve?: MatcherLocationRaw & Required<RouteQueryAndHash>
4949
}
50-
>
50+
>,
5151
>(locs: T) {
5252
return locs
5353
}

packages/router/__tests__/guards/guardsContext.spec.ts

Lines changed: 81 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ const component = {
1212
describe('beforeRouteLeave', () => {
1313
it('invokes with the component context', async () => {
1414
expect.assertions(2)
15-
const spy = vi
16-
.fn()
17-
.mockImplementationOnce(function (this: any, to, from, next) {
18-
expect(typeof this.counter).toBe('number')
19-
next()
20-
})
15+
const spy = vi.fn().mockImplementationOnce(function (
16+
this: any,
17+
to,
18+
from,
19+
next
20+
) {
21+
expect(typeof this.counter).toBe('number')
22+
next()
23+
})
2124
const WithLeave = defineComponent({
2225
template: `text`,
2326
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings
@@ -54,23 +57,29 @@ describe('beforeRouteLeave', () => {
5457
template: `text`,
5558
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings
5659
data: () => ({ counter: 0 }),
57-
beforeRouteLeave: vi
58-
.fn()
59-
.mockImplementationOnce(function (this: any, to, from, next) {
60-
expect(typeof this.counter).toBe('number')
61-
next()
62-
}),
60+
beforeRouteLeave: vi.fn().mockImplementationOnce(function (
61+
this: any,
62+
to,
63+
from,
64+
next
65+
) {
66+
expect(typeof this.counter).toBe('number')
67+
next()
68+
}),
6369
})
6470
const WithLeaveTwo = defineComponent({
6571
template: `text`,
6672
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings
6773
data: () => ({ counter: 0 }),
68-
beforeRouteLeave: vi
69-
.fn()
70-
.mockImplementationOnce(function (this: any, to, from, next) {
71-
expect(typeof this.counter).toBe('number')
72-
next()
73-
}),
74+
beforeRouteLeave: vi.fn().mockImplementationOnce(function (
75+
this: any,
76+
to,
77+
from,
78+
next
79+
) {
80+
expect(typeof this.counter).toBe('number')
81+
next()
82+
}),
7483
})
7584

7685
const router = createRouter({
@@ -108,23 +117,29 @@ describe('beforeRouteLeave', () => {
108117
template: `<router-view/>`,
109118
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings
110119
data: () => ({ counter: 0 }),
111-
beforeRouteLeave: vi
112-
.fn()
113-
.mockImplementationOnce(function (this: any, to, from, next) {
114-
expect(typeof this.counter).toBe('number')
115-
next()
116-
}),
120+
beforeRouteLeave: vi.fn().mockImplementationOnce(function (
121+
this: any,
122+
to,
123+
from,
124+
next
125+
) {
126+
expect(typeof this.counter).toBe('number')
127+
next()
128+
}),
117129
})
118130
const WithLeave = defineComponent({
119131
template: `text`,
120132
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings
121133
data: () => ({ counter: 0 }),
122-
beforeRouteLeave: vi
123-
.fn()
124-
.mockImplementationOnce(function (this: any, to, from, next) {
125-
expect(typeof this.counter).toBe('number')
126-
next()
127-
}),
134+
beforeRouteLeave: vi.fn().mockImplementationOnce(function (
135+
this: any,
136+
to,
137+
from,
138+
next
139+
) {
140+
expect(typeof this.counter).toBe('number')
141+
next()
142+
}),
128143
})
129144

130145
const router = createRouter({
@@ -167,34 +182,43 @@ describe('beforeRouteLeave', () => {
167182
`,
168183
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings
169184
data: () => ({ counter: 0 }),
170-
beforeRouteLeave: vi
171-
.fn()
172-
.mockImplementationOnce(function (this: any, to, from, next) {
173-
expect(typeof this.counter).toBe('number')
174-
next()
175-
}),
185+
beforeRouteLeave: vi.fn().mockImplementationOnce(function (
186+
this: any,
187+
to,
188+
from,
189+
next
190+
) {
191+
expect(typeof this.counter).toBe('number')
192+
next()
193+
}),
176194
})
177195
const WithLeaveOne = defineComponent({
178196
template: `text`,
179197
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings
180198
data: () => ({ counter: 0 }),
181-
beforeRouteLeave: vi
182-
.fn()
183-
.mockImplementationOnce(function (this: any, to, from, next) {
184-
expect(typeof this.counter).toBe('number')
185-
next()
186-
}),
199+
beforeRouteLeave: vi.fn().mockImplementationOnce(function (
200+
this: any,
201+
to,
202+
from,
203+
next
204+
) {
205+
expect(typeof this.counter).toBe('number')
206+
next()
207+
}),
187208
})
188209
const WithLeaveTwo = defineComponent({
189210
template: `text`,
190211
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings
191212
data: () => ({ counter: 0 }),
192-
beforeRouteLeave: vi
193-
.fn()
194-
.mockImplementationOnce(function (this: any, to, from, next) {
195-
expect(typeof this.counter).toBe('number')
196-
next()
197-
}),
213+
beforeRouteLeave: vi.fn().mockImplementationOnce(function (
214+
this: any,
215+
to,
216+
from,
217+
next
218+
) {
219+
expect(typeof this.counter).toBe('number')
220+
next()
221+
}),
198222
})
199223

200224
const router = createRouter({
@@ -235,12 +259,15 @@ describe('beforeRouteLeave', () => {
235259
describe('beforeRouteUpdate', () => {
236260
it('invokes with the component context', async () => {
237261
expect.assertions(2)
238-
const spy = vi
239-
.fn()
240-
.mockImplementationOnce(function (this: any, to, from, next) {
241-
expect(typeof this.counter).toBe('number')
242-
next()
243-
})
262+
const spy = vi.fn().mockImplementationOnce(function (
263+
this: any,
264+
to,
265+
from,
266+
next
267+
) {
268+
expect(typeof this.counter).toBe('number')
269+
next()
270+
})
244271
const WithParam = defineComponent({
245272
template: `text`,
246273
// we use data to check if the context is the right one because saving `this` in a variable logs a few warnings

packages/router/__tests__/lazyLoading.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function createLazyComponent() {
2626
const [promise, resolve, reject] = fakePromise()
2727

2828
return {
29-
component: vi.fn(() => promise.then(() => ({} as RouteComponent))),
29+
component: vi.fn(() => promise.then(() => ({}) as RouteComponent)),
3030
promise,
3131
resolve,
3232
reject,

packages/router/e2e/encoding/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

packages/router/e2e/guards-instances/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

packages/router/e2e/hash/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

packages/router/e2e/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

packages/router/e2e/keep-alive/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

0 commit comments

Comments
 (0)