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

remove eslint-disable-next-line @typescript-eslint/no-explicit-any lines

Yuki Takei 2 месяцев назад
Родитель
Сommit
037926a42e
30 измененных файлов с 8 добавлено и 49 удалено
  1. 0 1
      apps/app/src/client/components/Admin/App/MaskedInput.tsx
  2. 0 1
      apps/app/src/client/components/Admin/App/SesSetting.tsx
  3. 0 1
      apps/app/src/client/components/Admin/App/SmtpSetting.tsx
  4. 0 1
      apps/app/src/client/components/Me/ProfileImageSettings.tsx
  5. 0 2
      apps/app/src/client/components/PageAccessoriesModal/ShareLink/ShareLinkList.tsx
  6. 0 1
      apps/app/src/client/components/PageDeleteModal/PageDeleteModal.tsx
  7. 0 1
      apps/app/src/client/components/SearchTypeahead.tsx
  8. 0 1
      apps/app/src/client/util/apiv3-client.ts
  9. 0 1
      apps/app/src/features/opentelemetry/server/logger.ts
  10. 0 1
      apps/app/src/server/crowi/setup-models.ts
  11. 0 1
      apps/app/src/server/models/password-reset-order.ts
  12. 0 1
      apps/app/src/server/routes/apiv3/invited.ts
  13. 0 1
      apps/app/src/server/routes/apiv3/user-ui-settings.ts
  14. 0 1
      apps/app/src/server/routes/forgot-password.ts
  15. 0 1
      apps/app/src/server/routes/user-activation.ts
  16. 0 2
      apps/app/src/server/service/config-manager/config-manager.ts
  17. 0 1
      apps/app/src/server/service/g2g-transfer.ts
  18. 0 2
      apps/app/src/server/service/growi-info/growi-info.integ.ts
  19. 0 1
      apps/app/src/server/service/import/get-model-from-collection-name.ts
  20. 0 2
      apps/app/src/server/service/import/overwrite-function.ts
  21. 0 1
      apps/app/src/server/service/in-app-notification.ts
  22. 0 1
      apps/app/src/server/service/installer.ts
  23. 0 2
      apps/app/src/server/service/page-listing/page-listing.integ.ts
  24. 0 1
      apps/app/src/server/service/passport.ts
  25. 0 3
      apps/app/src/server/service/slack-command-handler/error-handler.ts
  26. 0 1
      apps/app/src/server/service/slack-event-handler/link-shared.ts
  27. 0 1
      apps/app/src/server/service/user-notification/index.ts
  28. 0 2
      apps/app/src/server/service/yjs/yjs.ts
  29. 8 12
      apps/app/src/stores/search.tsx
  30. 0 1
      packages/editor/src/interfaces/delta.ts

+ 0 - 1
apps/app/src/client/components/Admin/App/MaskedInput.tsx

@@ -10,7 +10,6 @@ type Props = {
   value?: string;
   onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
   tabIndex?: number | undefined;
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   register?: UseFormRegister<any>;
   fieldName?: string;
 };

+ 0 - 1
apps/app/src/client/components/Admin/App/SesSetting.tsx

@@ -7,7 +7,6 @@ import { withUnstatedContainers } from '../../UnstatedUtils';
 
 type Props = {
   adminAppContainer?: AdminAppContainer;
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   register: UseFormRegister<any>;
 };
 

+ 0 - 1
apps/app/src/client/components/Admin/App/SmtpSetting.tsx

@@ -8,7 +8,6 @@ import { withUnstatedContainers } from '../../UnstatedUtils';
 
 type Props = {
   adminAppContainer?: AdminAppContainer;
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   register: UseFormRegister<any>;
 };
 

+ 0 - 1
apps/app/src/client/components/Me/ProfileImageSettings.tsx

@@ -66,7 +66,6 @@ const ProfileImageSettings = (): JSX.Element => {
           }),
         );
 
-        // eslint-disable-next-line @typescript-eslint/no-explicit-any
         setUploadedPictureSrc((response as any).attachment.filePathProxied);
       } catch (err) {
         toastError(err);

+ 0 - 2
apps/app/src/client/components/PageAccessoriesModal/ShareLink/ShareLinkList.tsx

@@ -5,7 +5,6 @@ import { useTranslation } from 'next-i18next';
 import { CopyDropdown } from '../../Common/CopyDropdown';
 
 type ShareLinkTrProps = {
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   shareLink: any;
   isAdmin?: boolean;
   onDelete?: () => void;
@@ -68,7 +67,6 @@ const ShareLinkTr = (props: ShareLinkTrProps): JSX.Element => {
 };
 
 type Props = {
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   shareLinks: any[];
   onClickDeleteButton?: (shareLinkId: string) => void;
   isAdmin?: boolean;

+ 0 - 1
apps/app/src/client/components/PageDeleteModal/PageDeleteModal.tsx

@@ -38,7 +38,6 @@ const deleteIconAndKey = {
   },
 };
 
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
 const isIPageInfoForEntityForDeleteModal = (
   pageInfo: any | undefined,
 ): pageInfo is IPageInfoForEntity => {

+ 0 - 1
apps/app/src/client/components/SearchTypeahead.tsx

@@ -287,7 +287,6 @@ const SearchTypeahead: ForwardRefRenderFunction<IFocusable, Props> = (
         id="search-typeahead-asynctypeahead"
         ref={typeaheadRef}
         delay={400}
-        // eslint-disable-next-line @typescript-eslint/no-explicit-any
         inputProps={{ autoComplete: 'off', ...((inputProps as any) ?? {}) }}
         isLoading={isLoading}
         labelKey={labelKey}

+ 0 - 1
apps/app/src/client/util/apiv3-client.ts

@@ -28,7 +28,6 @@ const apiv3ErrorHandler = (_err: any): any[] => {
   return errs;
 };
 
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
 export async function apiv3Request<T = any>(
   method: string,
   path: string,

+ 0 - 1
apps/app/src/features/opentelemetry/server/logger.ts

@@ -29,7 +29,6 @@ class DiagLoggerBunyanAdapter implements DiagLogger {
 
     // merge additional data
     if (args.length > 0) {
-      // eslint-disable-next-line @typescript-eslint/no-explicit-any
       const argsData = (args as any).reduce((acc, arg) => {
         if (typeof arg === 'string') {
           try {

+ 0 - 1
apps/app/src/server/crowi/setup-models.ts

@@ -7,7 +7,6 @@ import type Crowi from '.';
 const logger = loggerFactory('growi:crowi:setup-models');
 
 export type ModelsMapDependentOnCrowi = {
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   [modelName: string]: Model<any>;
 };
 

+ 0 - 1
apps/app/src/server/models/password-reset-order.ts

@@ -9,7 +9,6 @@ import { getOrCreateModel } from '../util/mongoose-utils';
 export interface IPasswordResetOrder {
   token: string;
   email: string;
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   relatedUser: any;
   isRevoked: boolean;
   createdAt: Date;

+ 0 - 1
apps/app/src/server/routes/apiv3/invited.ts

@@ -76,7 +76,6 @@ module.exports = (crowi: Crowi): Router => {
         return res.apiv3Err(req.form.errors, 400);
       }
 
-      // eslint-disable-next-line @typescript-eslint/no-explicit-any
       const User = mongoose.model<IUser, any>('User');
 
       const user = req.user;

+ 0 - 1
apps/app/src/server/routes/apiv3/user-ui-settings.ts

@@ -69,7 +69,6 @@ module.exports = () => {
    *                 preferCollapsedModeByUser:
    *                   type: boolean
    */
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   router.put(
     '/',
     validatorForPut,

+ 0 - 1
apps/app/src/server/routes/forgot-password.ts

@@ -41,7 +41,6 @@ export const checkForgotPasswordEnabledMiddlewareFactory = (
 };
 
 type Crowi = {
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   nextApp: any;
 };
 

+ 0 - 1
apps/app/src/server/routes/user-activation.ts

@@ -4,7 +4,6 @@ import type { UserActivationErrorCode } from '~/interfaces/errors/user-activatio
 import type { ReqWithUserRegistrationOrder } from '~/server/middlewares/inject-user-registration-order-by-token-middleware';
 
 type Crowi = {
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   nextApp: any;
 };
 

+ 0 - 2
apps/app/src/server/service/config-manager/config-manager.ts

@@ -93,9 +93,7 @@ export class ConfigManager
   /**
    * @deprecated
    */
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   getConfigLegacy<T = any>(key: string, source?: ConfigSource): T {
-    // eslint-disable-next-line @typescript-eslint/no-explicit-any
     return this.getConfig(key as any, source) as T;
   }
 

+ 0 - 1
apps/app/src/server/service/g2g-transfer.ts

@@ -287,7 +287,6 @@ export class G2GTransferPusherService implements Pusher {
       };
     }
 
-    // eslint-disable-next-line @typescript-eslint/no-explicit-any
     const User = mongoose.model<IUser, any>('User');
     const activeUserCount = await User.countActiveUsers();
     if ((destGROWIInfo.userUpperLimit ?? Infinity) < activeUserCount) {

+ 0 - 2
apps/app/src/server/service/growi-info/growi-info.integ.ts

@@ -74,7 +74,6 @@ describe('GrowiInfoService', () => {
       expect(growiInfo.osInfo?.arch).toBeTruthy();
       expect(growiInfo.osInfo?.totalmem).toBeTruthy();
 
-      // eslint-disable-next-line @typescript-eslint/no-explicit-any
       delete (growiInfo as any).osInfo;
 
       expect(growiInfo).toEqual({
@@ -105,7 +104,6 @@ describe('GrowiInfoService', () => {
       expect(growiInfo.osInfo?.arch).toBeTruthy();
       expect(growiInfo.osInfo?.totalmem).toBeTruthy();
 
-      // eslint-disable-next-line @typescript-eslint/no-explicit-any
       delete (growiInfo as any).osInfo;
 
       expect(growiInfo).toEqual({

+ 0 - 1
apps/app/src/server/service/import/get-model-from-collection-name.ts

@@ -8,7 +8,6 @@ import mongoose from 'mongoose';
  * @param collectionName collection name
  * @return instance of mongoose model
  */
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
 export const getModelFromCollectionName = (
   collectionName: string,
 ): Model<any, unknown, unknown, unknown, any> | undefined => {

+ 0 - 2
apps/app/src/server/service/import/overwrite-function.ts

@@ -51,9 +51,7 @@ export const keepOriginal: OverwriteFunction = (
   }
 
   // _id
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   if (propertyName === '_id' && ObjectId.isValid(value as any)) {
-    // eslint-disable-next-line @typescript-eslint/no-explicit-any
     return new ObjectId(value as any);
   }
 

+ 0 - 1
apps/app/src/server/service/in-app-notification.ts

@@ -137,7 +137,6 @@ export default class InAppNotificationService {
         Object.assign(paginateOptions, { status });
       }
       // TODO: import @types/mongoose-paginate-v2 and use PaginateResult as a type after upgrading mongoose v6.0.0
-      // eslint-disable-next-line @typescript-eslint/no-explicit-any
       const paginationResult = await (InAppNotification as any).paginate(
         paginateOptions,
         {

+ 0 - 1
apps/app/src/server/service/installer.ts

@@ -84,7 +84,6 @@ export class InstallerService {
     if (initialPagesCreatedAt != null) {
       try {
         // TODO typescriptize models/user.js and remove eslint-disable-next-line
-        // eslint-disable-next-line @typescript-eslint/no-explicit-any
         const Page = mongoose.model('Page') as any;
 
         // Increment timestamp to avoid difference for order in VRT

+ 0 - 2
apps/app/src/server/service/page-listing/page-listing.integ.ts

@@ -13,7 +13,6 @@ import { pageListingService } from './page-listing';
 vi.mock('~/server/service/page-operation', () => ({
   pageOperationService: {
     generateProcessInfo: vi.fn((pageOperations: IPageOperation[]) => {
-      // eslint-disable-next-line @typescript-eslint/no-explicit-any
       const processInfo: Record<string, any> = {};
       pageOperations.forEach((pageOp) => {
         const pageId = pageOp.page._id.toString();
@@ -37,7 +36,6 @@ describe('page-listing store integration tests', () => {
   let rootPage: HydratedDocument<IPage>;
 
   // Helper function to validate IPageForTreeItem type structure
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   const validatePageForTreeItem = (page: any): void => {
     expect(page).toBeDefined();
     expect(page._id).toBeDefined();

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

@@ -1122,7 +1122,6 @@ class PassportService implements S2sMessageHandlable {
     const User = this.crowi.model('User');
 
     passport.serializeUser((user, done) => {
-      // eslint-disable-next-line @typescript-eslint/no-explicit-any
       done(null, (user as any).id);
     });
     passport.deserializeUser(async (id, done) => {

+ 0 - 3
apps/app/src/server/service/slack-command-handler/error-handler.ts

@@ -19,7 +19,6 @@ function generateRespondBodyForInternalServerError(
   };
 }
 
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
 async function handleErrorWithWebClient(
   error: Error,
   client: WebClient,
@@ -49,14 +48,12 @@ export async function handleError(
   responseUrl?: string,
 ): Promise<void>;
 
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
 export async function handleError(
   error: Error,
   client: WebClient,
   body: any,
 ): Promise<ChatPostEphemeralResponse>;
 
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
 export async function handleError(
   error: SlackCommandHandlerError | Error,
   ...args: any[]

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

@@ -175,7 +175,6 @@ export class LinkSharedEventHandler
     return [...unfurlDataFromNormalLinks, ...unfurlDataFromPermalinks];
   }
 
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   private generateDataForUnfurl(
     pages: any,
     isPermalink: boolean,

+ 0 - 1
apps/app/src/server/service/user-notification/index.ts

@@ -31,7 +31,6 @@ export class UserNotificationService {
    * @param {IRevisionHasId} previousRevision
    * @param {Comment} comment
    */
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   async fire(
     page,
     user,

+ 0 - 2
apps/app/src/server/service/yjs/yjs.ts

@@ -47,9 +47,7 @@ class YjsService implements IYjsService {
     const mdb = new MongodbPersistence(
       {
         // TODO: Required upgrading mongoose and unifying the versions of mongodb to omit 'as any'
-        // eslint-disable-next-line @typescript-eslint/no-explicit-any
         client: mongoose.connection.getClient() as any,
-        // eslint-disable-next-line @typescript-eslint/no-explicit-any
         db: mongoose.connection.db as any,
       },
       {

+ 8 - 12
apps/app/src/stores/search.tsx

@@ -81,18 +81,14 @@ export const useSWRxSearch = (
     ([endpoint, , fixedConfigurations]) => {
       const { limit, offset, sort, order } = fixedConfigurations;
 
-      return apiGet(
-        endpoint,
-        {
-          q: encodeURIComponent(rawQuery),
-          nq: typeof nqName === 'string' ? encodeURIComponent(nqName) : null,
-          limit,
-          offset,
-          sort,
-          order,
-        },
-        // eslint-disable-next-line @typescript-eslint/no-explicit-any
-      ).then((result) => result as IFormattedSearchResult);
+      return apiGet(endpoint, {
+        q: encodeURIComponent(rawQuery),
+        nq: typeof nqName === 'string' ? encodeURIComponent(nqName) : null,
+        limit,
+        offset,
+        sort,
+        order,
+      }).then((result) => result as IFormattedSearchResult);
     },
     {
       keepPreviousData: true,

+ 0 - 1
packages/editor/src/interfaces/delta.ts

@@ -1,4 +1,3 @@
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
 export type Delta = Array<{
   insert?: string | object | Array<any>;
   delete?: number;