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

fix: add ts-ignore comments for deep type instantiation issues with Scope

Yuki Takei 2 месяцев назад
Родитель
Сommit
54736a4fac

+ 2 - 0
apps/app/src/client/components/Me/AccessTokenForm.tsx

@@ -16,6 +16,8 @@ type AccessTokenFormProps = {
 type FormInputs = {
   expiredAt: string;
   description: string;
+  // biome-ignore lint/suspicious/noTsIgnore: Suppress auto fix by lefthook
+  // @ts-ignore - Scope type causes "Type instantiation is excessively deep" with tsgo
   scopes: Scope[];
 };
 

+ 2 - 0
apps/app/src/client/util/scope-util.ts

@@ -1,6 +1,8 @@
 import { ALL_SIGN, type Scope } from '@growi/core/dist/interfaces';
 
 // Data structure for the final merged scopes
+// biome-ignore lint/suspicious/noTsIgnore: Suppress auto fix by lefthook
+// @ts-ignore - Scope type causes "Type instantiation is excessively deep" with tsgo
 interface ScopeMap {
   [key: string]: Scope | ScopeMap;
 }

+ 2 - 0
apps/app/src/interfaces/access-token.ts

@@ -3,6 +3,8 @@ import type { Scope } from '@growi/core/dist/interfaces';
 export type IAccessTokenInfo = {
   expiredAt: Date;
   description: string;
+  // biome-ignore lint/suspicious/noTsIgnore: Suppress auto fix by lefthook
+  // @ts-ignore - Scope type causes "Type instantiation is excessively deep" with tsgo
   scopes: Scope[];
 };
 

+ 2 - 0
apps/app/src/server/models/access-token.ts

@@ -19,6 +19,8 @@ type GenerateTokenResult = {
   token: string;
   _id: Types.ObjectId;
   expiredAt: Date;
+  // biome-ignore lint/suspicious/noTsIgnore: Suppress auto fix by lefthook
+  // @ts-ignore - Scope type causes "Type instantiation is excessively deep" with tsgo
   scopes?: Scope[];
   description?: string;
 };

+ 2 - 0
apps/app/src/server/util/scope-utils.ts

@@ -5,6 +5,8 @@ import {
   type Scope,
 } from '@growi/core/dist/interfaces';
 
+// biome-ignore lint/suspicious/noTsIgnore: Suppress auto fix by lefthook
+// @ts-ignore - Scope type causes "Type instantiation is excessively deep" with tsgo
 export const isValidScope = (scope: Scope): boolean => {
   const scopeParts = scope
     .split(':')