Skip to content

Commit 97a903c

Browse files
chore(deps): update typescript-eslint monorepo to v8 (major) (#3550)
* chore(deps): update typescript-eslint monorepo to v8 * fix: adapt required changes by new eslint version --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Stephan Köninger <[email protected]>
1 parent 407caa6 commit 97a903c

File tree

12 files changed

+91
-16141
lines changed

12 files changed

+91
-16141
lines changed

spring-boot-admin-server-ui/package-lock.json

Lines changed: 0 additions & 16052 deletions
This file was deleted.

spring-boot-admin-server-ui/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"moment": "2.30.1",
4949
"popper.js": "1.16.1",
5050
"pretty-bytes": "6.1.1",
51+
"qs": "^6.13.0",
5152
"random-string": "0.2.0",
5253
"react": "18.3.1",
5354
"react-dom": "18.3.1",
@@ -78,8 +79,8 @@
7879
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
7980
"@types/lodash-es": "^4.17.7",
8081
"@types/testing-library__jest-dom": "^6.0.0",
81-
"@typescript-eslint/eslint-plugin": "^7.0.0",
82-
"@typescript-eslint/parser": "^7.0.0",
82+
"@typescript-eslint/eslint-plugin": "^8.0.0",
83+
"@typescript-eslint/parser": "^8.0.0",
8384
"@vitejs/plugin-vue": "5.1.2",
8485
"@vue/eslint-config-typescript": "^13.0.0",
8586
"@vue/test-utils": "2.4.6",

spring-boot-admin-server-ui/src/main/frontend/mixins/subscribing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export default {
2828
}
2929
},
3030
unsubscribe() {
31-
if (this.subscription) {
31+
if (this.subscription && !this.subscription.closed) {
3232
try {
33-
!this.subscription.closed && this.subscription.unsubscribe();
33+
this.subscription.unsubscribe();
3434
} finally {
3535
this.subscription = null;
3636
}

spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,42 @@
88
* - Please do NOT serve this file on production.
99
*/
1010

11-
const PACKAGE_VERSION = '2.2.9';
12-
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423';
13-
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse');
14-
const activeClientIds = new Set();
11+
const PACKAGE_VERSION = '2.3.5'
12+
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
13+
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
14+
const activeClientIds = new Set()
1515

1616
self.addEventListener('install', function () {
17-
self.skipWaiting();
18-
});
17+
self.skipWaiting()
18+
})
1919

2020
self.addEventListener('activate', function (event) {
21-
event.waitUntil(self.clients.claim());
22-
});
21+
event.waitUntil(self.clients.claim())
22+
})
2323

2424
self.addEventListener('message', async function (event) {
25-
const clientId = event.source.id;
25+
const clientId = event.source.id
2626

2727
if (!clientId || !self.clients) {
28-
return;
28+
return
2929
}
3030

31-
const client = await self.clients.get(clientId);
31+
const client = await self.clients.get(clientId)
3232

3333
if (!client) {
34-
return;
34+
return
3535
}
3636

3737
const allClients = await self.clients.matchAll({
3838
type: 'window',
39-
});
39+
})
4040

4141
switch (event.data) {
4242
case 'KEEPALIVE_REQUEST': {
4343
sendToClient(client, {
4444
type: 'KEEPALIVE_RESPONSE',
45-
});
46-
break;
45+
})
46+
break
4747
}
4848

4949
case 'INTEGRITY_CHECK_REQUEST': {
@@ -53,78 +53,78 @@ self.addEventListener('message', async function (event) {
5353
packageVersion: PACKAGE_VERSION,
5454
checksum: INTEGRITY_CHECKSUM,
5555
},
56-
});
57-
break;
56+
})
57+
break
5858
}
5959

6060
case 'MOCK_ACTIVATE': {
61-
activeClientIds.add(clientId);
61+
activeClientIds.add(clientId)
6262

6363
sendToClient(client, {
6464
type: 'MOCKING_ENABLED',
6565
payload: true,
66-
});
67-
break;
66+
})
67+
break
6868
}
6969

7070
case 'MOCK_DEACTIVATE': {
71-
activeClientIds.delete(clientId);
72-
break;
71+
activeClientIds.delete(clientId)
72+
break
7373
}
7474

7575
case 'CLIENT_CLOSED': {
76-
activeClientIds.delete(clientId);
76+
activeClientIds.delete(clientId)
7777

7878
const remainingClients = allClients.filter((client) => {
79-
return client.id !== clientId;
80-
});
79+
return client.id !== clientId
80+
})
8181

8282
// Unregister itself when there are no more clients
8383
if (remainingClients.length === 0) {
84-
self.registration.unregister();
84+
self.registration.unregister()
8585
}
8686

87-
break;
87+
break
8888
}
8989
}
90-
});
90+
})
9191

9292
self.addEventListener('fetch', function (event) {
93-
const { request } = event;
93+
const { request } = event
9494

9595
// Bypass navigation requests.
9696
if (request.mode === 'navigate') {
97-
return;
97+
return
9898
}
9999

100100
// Opening the DevTools triggers the "only-if-cached" request
101101
// that cannot be handled by the worker. Bypass such requests.
102102
if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
103-
return;
103+
return
104104
}
105105

106106
// Bypass all requests when there are no active clients.
107107
// Prevents the self-unregistered worked from handling requests
108108
// after it's been deleted (still remains active until the next reload).
109109
if (activeClientIds.size === 0) {
110-
return;
110+
return
111111
}
112112

113113
// Generate unique request ID.
114-
const requestId = crypto.randomUUID();
115-
event.respondWith(handleRequest(event, requestId));
116-
});
114+
const requestId = crypto.randomUUID()
115+
event.respondWith(handleRequest(event, requestId))
116+
})
117117

118118
async function handleRequest(event, requestId) {
119-
const client = await resolveMainClient(event);
120-
const response = await getResponse(event, client, requestId);
119+
const client = await resolveMainClient(event)
120+
const response = await getResponse(event, client, requestId)
121121

122122
// Send back the response clone for the "response:*" life-cycle events.
123123
// Ensure MSW is active and ready to handle the message, otherwise
124124
// this message will pend indefinitely.
125125
if (client && activeClientIds.has(client.id)) {
126-
(async function () {
127-
const responseClone = response.clone();
126+
;(async function () {
127+
const responseClone = response.clone()
128128

129129
sendToClient(
130130
client,
@@ -141,73 +141,73 @@ async function handleRequest(event, requestId) {
141141
},
142142
},
143143
[responseClone.body],
144-
);
145-
})();
144+
)
145+
})()
146146
}
147147

148-
return response;
148+
return response
149149
}
150150

151151
// Resolve the main client for the given event.
152152
// Client that issues a request doesn't necessarily equal the client
153153
// that registered the worker. It's with the latter the worker should
154154
// communicate with during the response resolving phase.
155155
async function resolveMainClient(event) {
156-
const client = await self.clients.get(event.clientId);
156+
const client = await self.clients.get(event.clientId)
157157

158158
if (client?.frameType === 'top-level') {
159-
return client;
159+
return client
160160
}
161161

162162
const allClients = await self.clients.matchAll({
163163
type: 'window',
164-
});
164+
})
165165

166166
return allClients
167167
.filter((client) => {
168168
// Get only those clients that are currently visible.
169-
return client.visibilityState === 'visible';
169+
return client.visibilityState === 'visible'
170170
})
171171
.find((client) => {
172172
// Find the client ID that's recorded in the
173173
// set of clients that have registered the worker.
174-
return activeClientIds.has(client.id);
175-
});
174+
return activeClientIds.has(client.id)
175+
})
176176
}
177177

178178
async function getResponse(event, client, requestId) {
179-
const { request } = event;
179+
const { request } = event
180180

181181
// Clone the request because it might've been already used
182182
// (i.e. its body has been read and sent to the client).
183-
const requestClone = request.clone();
183+
const requestClone = request.clone()
184184

185185
function passthrough() {
186-
const headers = Object.fromEntries(requestClone.headers.entries());
186+
const headers = Object.fromEntries(requestClone.headers.entries())
187187

188188
// Remove internal MSW request header so the passthrough request
189189
// complies with any potential CORS preflight checks on the server.
190190
// Some servers forbid unknown request headers.
191-
delete headers['x-msw-intention'];
191+
delete headers['x-msw-intention']
192192

193-
return fetch(requestClone, { headers });
193+
return fetch(requestClone, { headers })
194194
}
195195

196196
// Bypass mocking when the client is not active.
197197
if (!client) {
198-
return passthrough();
198+
return passthrough()
199199
}
200200

201201
// Bypass initial page load requests (i.e. static assets).
202202
// The absence of the immediate/parent client in the map of the active clients
203203
// means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
204204
// and is not ready to handle requests.
205205
if (!activeClientIds.has(client.id)) {
206-
return passthrough();
206+
return passthrough()
207207
}
208208

209209
// Notify the client that a request has been intercepted.
210-
const requestBuffer = await request.arrayBuffer();
210+
const requestBuffer = await request.arrayBuffer()
211211
const clientMessage = await sendToClient(
212212
client,
213213
{
@@ -230,38 +230,38 @@ async function getResponse(event, client, requestId) {
230230
},
231231
},
232232
[requestBuffer],
233-
);
233+
)
234234

235235
switch (clientMessage.type) {
236236
case 'MOCK_RESPONSE': {
237-
return respondWithMock(clientMessage.data);
237+
return respondWithMock(clientMessage.data)
238238
}
239239

240240
case 'PASSTHROUGH': {
241-
return passthrough();
241+
return passthrough()
242242
}
243243
}
244244

245-
return passthrough();
245+
return passthrough()
246246
}
247247

248248
function sendToClient(client, message, transferrables = []) {
249249
return new Promise((resolve, reject) => {
250-
const channel = new MessageChannel();
250+
const channel = new MessageChannel()
251251

252252
channel.port1.onmessage = (event) => {
253253
if (event.data && event.data.error) {
254-
return reject(event.data.error);
254+
return reject(event.data.error)
255255
}
256256

257-
resolve(event.data);
258-
};
257+
resolve(event.data)
258+
}
259259

260260
client.postMessage(
261261
message,
262262
[channel.port2].concat(transferrables.filter(Boolean)),
263-
);
264-
});
263+
)
264+
})
265265
}
266266

267267
async function respondWithMock(response) {
@@ -270,15 +270,15 @@ async function respondWithMock(response) {
270270
// instance will have status code set to 0. Since it's not possible to create
271271
// a Response instance with status code 0, handle that use-case separately.
272272
if (response.status === 0) {
273-
return Response.error();
273+
return Response.error()
274274
}
275275

276-
const mockedResponse = new Response(response.body, response);
276+
const mockedResponse = new Response(response.body, response)
277277

278278
Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, {
279279
value: true,
280280
enumerable: true,
281-
});
281+
})
282282

283-
return mockedResponse;
283+
return mockedResponse
284284
}

spring-boot-admin-server-ui/src/main/frontend/services/startup-actuator.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ import { cloneDeep } from 'lodash-es';
1717
import { beforeEach, describe, expect, it } from 'vitest';
1818

1919
import { StartupActuatorService } from './startup-actuator';
20+
import fixture from './startup-actuator.fixture.spec.json';
2021

2122
describe('StartupActuatorService', () => {
22-
let data = {};
23-
let events = {};
23+
let data: any = {};
24+
let events: any = {};
2425

2526
beforeEach(() => {
2627
// eslint-disable-next-line @typescript-eslint/no-var-requires
27-
data = cloneDeep(require('./startup-actuator.fixture.spec.json'));
28+
data = cloneDeep(fixture);
2829
events = data.timeline.events;
2930
});
3031

spring-boot-admin-server-ui/src/main/frontend/shell/sba-nav-language-selector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const mapLocale = (locale) => {
8686
locale,
8787
label,
8888
};
89-
} catch (e) {
89+
} catch {
9090
return {
9191
locale,
9292
label: locale,

spring-boot-admin-server-ui/src/main/frontend/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ export default class ApplicationStore {
135135
}
136136

137137
stop() {
138-
if (this.subscription) {
138+
if (this.subscription && !this.subscription.closed) {
139139
try {
140-
!this.subscription.closed && this.subscription.unsubscribe();
140+
this.subscription.unsubscribe();
141141
} finally {
142142
this.subscription = null;
143143
}

0 commit comments

Comments
 (0)