Просмотр исходного кода

fix non-autofixable biome errors (type annotations, forEach fix)

Futa Arai 4 месяцев назад
Родитель
Сommit
68756c38cd

+ 18 - 12
apps/app/src/server/service/activity.ts

@@ -110,33 +110,39 @@ class ActivityService {
     // Set base action group
     switch (auditLogActionGroupSize) {
       case ActionGroupSize.Small:
-        AllSmallGroupActions.forEach((action) =>
-          availableActionsSet.add(action),
-        );
+        AllSmallGroupActions.forEach((action) => {
+          availableActionsSet.add(action);
+        });
         break;
       case ActionGroupSize.Medium:
-        AllMediumGroupActions.forEach((action) =>
-          availableActionsSet.add(action),
-        );
+        AllMediumGroupActions.forEach((action) => {
+          availableActionsSet.add(action);
+        });
         break;
       case ActionGroupSize.Large:
-        AllLargeGroupActions.forEach((action) =>
-          availableActionsSet.add(action),
-        );
+        AllLargeGroupActions.forEach((action) => {
+          availableActionsSet.add(action);
+        });
         break;
     }
 
     // Add additionalActions
     const additionalActions = parseActionString(auditLogAdditionalActions);
-    additionalActions.forEach((action) => availableActionsSet.add(action));
+    additionalActions.forEach((action) => {
+      availableActionsSet.add(action);
+    });
 
     // Delete excludeActions
     const excludeActions = parseActionString(auditLogExcludeActions);
-    excludeActions.forEach((action) => availableActionsSet.delete(action));
+    excludeActions.forEach((action) => {
+      availableActionsSet.delete(action);
+    });
 
     // Add essentialActions
     if (isIncludeEssentialActions) {
-      AllEssentialActions.forEach((action) => availableActionsSet.add(action));
+      AllEssentialActions.forEach((action) => {
+        availableActionsSet.add(action);
+      });
     }
 
     return Array.from(availableActionsSet);

+ 1 - 1
apps/app/src/server/service/passport.spec.ts

@@ -8,7 +8,7 @@ import { configManager } from './config-manager';
 import PassportService from './passport';
 
 describe('PassportService test', () => {
-  let crowiMock;
+  let crowiMock: Crowi;
 
   beforeAll(async () => {
     crowiMock = mock<Crowi>({

+ 3 - 1
apps/app/src/server/service/search.ts

@@ -589,7 +589,9 @@ class SearchService implements SearchQueryParser, SearchResolver {
         }
 
         // increment elasticSearchResult
-        let elasticSearchResult;
+        let elasticSearchResult:
+          | { snippet: string | null; highlightedPath: string | null }
+          | undefined;
         const highlightData = data._highlight;
         if (highlightData != null) {
           const snippet = this.canShowSnippet(pageData, user, userGroups)

+ 3 - 3
apps/app/src/server/service/slack-integration.ts

@@ -282,7 +282,7 @@ export class SlackIntegrationService implements S2sMessageHandlable {
     const { growiCommandType } = growiCommand;
     const modulePath = `./slack-command-handler/${growiCommandType}`;
 
-    let handler;
+    let handler: any;
     try {
       handler = require(modulePath)(this.crowi);
     } catch (err) {
@@ -317,7 +317,7 @@ export class SlackIntegrationService implements S2sMessageHandlable {
 
     const modulePath = `./slack-command-handler/${commandName}`;
 
-    let handler;
+    let handler: any;
     try {
       handler = require(modulePath)(this.crowi);
     } catch (err) {
@@ -349,7 +349,7 @@ export class SlackIntegrationService implements S2sMessageHandlable {
 
     const modulePath = `./slack-command-handler/${commandName}`;
 
-    let handler;
+    let handler: any;
     try {
       handler = require(modulePath)(this.crowi);
     } catch (err) {