Skip to content

Commit f3dcd1e

Browse files
committed
fix non-autofixable biome errors
1 parent afbcd38 commit f3dcd1e

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-15
lines changed

apps/app/src/server/service/config-manager/config-manager.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('ConfigManager test', () => {
3232
});
3333

3434
describe('updateConfig()', () => {
35-
let loadConfigsSpy;
35+
let loadConfigsSpy: ReturnType<typeof vi.spyOn>;
3636
beforeEach(async () => {
3737
loadConfigsSpy = vi.spyOn(configManager, 'loadConfigs');
3838
// Reset mocks
@@ -122,7 +122,7 @@ describe('ConfigManager test', () => {
122122
});
123123

124124
describe('updateConfigs()', () => {
125-
let loadConfigsSpy;
125+
let loadConfigsSpy: ReturnType<typeof vi.spyOn>;
126126
beforeEach(async () => {
127127
loadConfigsSpy = vi.spyOn(configManager, 'loadConfigs');
128128
// Reset mocks

apps/app/src/server/service/s2s-messaging/nchan.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ class NchanDelegator extends AbstractS2sMessagingService {
141141
logger.info('WebSocket client connected.');
142142
});
143143

144-
this.handlableList.forEach((handlable) =>
145-
this.registerMessageHandlerToSocket(handlable),
146-
);
144+
this.handlableList.forEach((handlable) => {
145+
this.registerMessageHandlerToSocket(handlable);
146+
});
147147

148148
this.socket = socket;
149149
}

apps/app/src/server/service/search-delegator/elasticsearch.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class ElasticsearchDelegator
182182
getConnectionInfo() {
183183
let indexName = 'crowi';
184184
let host: string | undefined;
185-
let auth;
185+
let auth: { username: string; password: string } | undefined;
186186

187187
const elasticsearchUri = configManager.getConfig('app:elasticsearchUri');
188188

@@ -642,7 +642,9 @@ class ElasticsearchDelegator
642642

643643
deletePages(pages) {
644644
const body = [];
645-
pages.forEach((page) => this.prepareBodyForDelete(body, page));
645+
pages.forEach((page) => {
646+
this.prepareBodyForDelete(body, page);
647+
});
646648

647649
logger.debug('deletePages(): Sending Request to ES', body);
648650
return this.client.bulk({

apps/app/src/server/service/search-delegator/private-legacy-pages.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,24 @@ class PrivateLegacyPagesDelegator
8585
const { match, not_match: notMatch, prefix, not_prefix: notPrefix } = terms;
8686

8787
if (match.length > 0) {
88-
match.forEach((m) => builder.addConditionToListByMatch(m));
88+
for (const m of match) {
89+
builder.addConditionToListByMatch(m);
90+
}
8991
}
9092
if (notMatch.length > 0) {
91-
notMatch.forEach((nm) => builder.addConditionToListByNotMatch(nm));
93+
for (const nm of notMatch) {
94+
builder.addConditionToListByNotMatch(nm);
95+
}
9296
}
9397
if (prefix.length > 0) {
94-
prefix.forEach((p) => builder.addConditionToListByStartWith(p));
98+
for (const p of prefix) {
99+
builder.addConditionToListByStartWith(p);
100+
}
95101
}
96102
if (notPrefix.length > 0) {
97-
notPrefix.forEach((np) => builder.addConditionToListByNotStartWith(np));
103+
for (const np of notPrefix) {
104+
builder.addConditionToListByNotStartWith(np);
105+
}
98106
}
99107

100108
return builder;

apps/app/src/server/service/slack-event-handler/link-shared.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class LinkSharedEventHandler
6868
unfurlData.map(async (data: DataForUnfurl) => {
6969
const toUrl = urljoin(origin, data.id);
7070

71-
let targetUrl;
71+
let targetUrl: string;
7272
if (data.isPermalink) {
7373
targetUrl = urljoin(origin, data.id);
7474
} else {
@@ -183,15 +183,16 @@ export class LinkSharedEventHandler
183183
const Page = this.crowi.model('Page');
184184
const unfurlData: DataForUnfurl[] = [];
185185

186-
pages.forEach((page) => {
186+
for (const page of pages) {
187187
// not send non-public page
188188
if (page.grant !== PageGrant.GRANT_PUBLIC) {
189-
return unfurlData.push({
189+
unfurlData.push({
190190
isPublic: false,
191191
isPermalink,
192192
id: page._id.toString(),
193193
path: page.path,
194194
});
195+
continue;
195196
}
196197

197198
// public page
@@ -206,7 +207,7 @@ export class LinkSharedEventHandler
206207
updatedAt,
207208
commentCount,
208209
});
209-
});
210+
}
210211

211212
return unfurlData;
212213
}

0 commit comments

Comments
 (0)