Ver Fonte

remove eslint-disable-next-line @typescript-eslint/no-non-null-assertion lines

Yuki Takei há 2 meses atrás
pai
commit
7e35827240

+ 4 - 8
apps/app/src/server/routes/apiv3/in-app-notification.ts

@@ -139,8 +139,7 @@ module.exports = (crowi) => {
     }),
     loginRequiredStrictly,
     async (req: CrowiRequest, res: ApiV3Response) => {
-      // user must be set by loginRequiredStrictly
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+      // biome-ignore lint/style/noNonNullAssertion: user must be set by loginRequiredStrictly
       const user = req.user!;
 
       const limit =
@@ -229,8 +228,7 @@ module.exports = (crowi) => {
     }),
     loginRequiredStrictly,
     async (req: CrowiRequest, res: ApiV3Response) => {
-      // user must be set by loginRequiredStrictly
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+      // biome-ignore lint/style/noNonNullAssertion: user must be set by loginRequiredStrictly
       const user = req.user!;
 
       try {
@@ -280,8 +278,7 @@ module.exports = (crowi) => {
     }),
     loginRequiredStrictly,
     async (req: CrowiRequest, res: ApiV3Response) => {
-      // user must be set by loginRequiredStrictly
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+      // biome-ignore lint/style/noNonNullAssertion: user must be set by loginRequiredStrictly
       const user = req.user!;
 
       const id = req.body.id;
@@ -319,8 +316,7 @@ module.exports = (crowi) => {
     loginRequiredStrictly,
     addActivity,
     async (req: CrowiRequest, res: ApiV3Response) => {
-      // user must be set by loginRequiredStrictly
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+      // biome-ignore lint/style/noNonNullAssertion: user must be set by loginRequiredStrictly
       const user = req.user!;
 
       try {

+ 1 - 1
apps/app/src/server/service/page-listing/page-listing.ts

@@ -32,8 +32,8 @@ export interface IPageListingService {
 let pageOperationService: IPageOperationService;
 async function getPageOperationServiceInstance(): Promise<IPageOperationService> {
   if (pageOperationService == null) {
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     pageOperationService = await import('../page-operation').then(
+      // biome-ignore lint/style/noNonNullAssertion: the module must export pageOperationService
       (mod) => mod.pageOperationService!,
     );
   }

+ 1 - 2
apps/app/src/server/service/page/index.ts

@@ -3292,8 +3292,7 @@ class PageService implements IPageService {
       contentAge: page.getContentAge(),
       descendantCount: page.descendantCount,
       commentCount: page.commentCount,
-      // the page must have a revision if it is not empty
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+      // biome-ignore lint/style/noNonNullAssertion: the page must have a revision if it is not empty
       latestRevisionId: getIdStringForRef(page.revision!),
     } satisfies IPageInfoBasicForEntity;
 

+ 1 - 1
apps/slackbot-proxy/src/services/InstallerService.ts

@@ -67,7 +67,7 @@ export class InstallerService {
         fetchInstallation: async (installQuery: InstallationQuery<boolean>) => {
           const id = installQuery.enterpriseId || installQuery.teamId;
 
-          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+          // biome-ignore lint/style/noNonNullAssertion: id must be set --- IGNORE ---
           const installation = await repository.findByTeamIdOrEnterpriseId(id!);
 
           if (installation == null) {

+ 1 - 1
apps/slackbot-proxy/src/services/RegisterService.ts

@@ -199,9 +199,9 @@ export class RegisterService
 
     const installationId =
       authorizeResult.enterpriseId || authorizeResult.teamId;
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const installation =
       await this.installationRepository.findByTeamIdOrEnterpriseId(
+        // biome-ignore lint/style/noNonNullAssertion: installationId must be set --- IGNORE ---
         installationId!,
       );
 

+ 1 - 1
apps/slackbot-proxy/src/services/SelectGrowiService.ts

@@ -214,9 +214,9 @@ export class SelectGrowiService
       authorizeResult.enterpriseId || authorizeResult.teamId;
     let installation: Installation | undefined;
     try {
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       installation =
         await this.installationRepository.findByTeamIdOrEnterpriseId(
+          // biome-ignore lint/style/noNonNullAssertion: installationId must be set --- IGNORE ---
           installationId!,
         );
     } catch (err) {

+ 2 - 2
apps/slackbot-proxy/src/services/UnregisterService.ts

@@ -47,9 +47,9 @@ export class UnregisterService
     // get growi urls
     const installationId =
       authorizeResult.enterpriseId || authorizeResult.teamId;
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const installation =
       await this.installationRepository.findByTeamIdOrEnterpriseId(
+        // biome-ignore lint/style/noNonNullAssertion: installationId must be set --- IGNORE ---
         installationId!,
       );
     const relations = await this.relationRepository
@@ -193,9 +193,9 @@ export class UnregisterService
       authorizeResult.enterpriseId || authorizeResult.teamId;
     let installation: Installation | undefined;
     try {
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       installation =
         await this.installationRepository.findByTeamIdOrEnterpriseId(
+          // biome-ignore lint/style/noNonNullAssertion: installationId must be set --- IGNORE ---
           installationId!,
         );
     } catch (err) {

+ 2 - 2
apps/slackbot-proxy/src/services/growi-uri-injector/ActionsBlockPayloadDelegator.ts

@@ -59,8 +59,8 @@ export class ActionsBlockPayloadDelegator
     );
 
     // collect elements
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const elements = actionsBlocks.flatMap(
+      // biome-ignore lint/style/noNonNullAssertion: elements must be set --- IGNORE ---
       (actionBlock) => actionBlock.elements!,
     );
 
@@ -94,7 +94,7 @@ export class ActionsBlockPayloadDelegator
       }
     }
 
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+    // biome-ignore lint/style/noNonNullAssertion: growiUriWithOriginalData must be set --- IGNORE ---
     return growiUriWithOriginalData!;
   }
 }

+ 0 - 1
apps/slackbot-proxy/src/services/growi-uri-injector/SectionBlockPayloadDelegator.ts

@@ -66,7 +66,6 @@ export class SectionBlockPayloadDelegator
     );
 
     // collect elements
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const accessories = sectionBlocks.flatMap(
       (sectionBlock) => sectionBlock.accessory,
     );

+ 1 - 1
apps/slackbot-proxy/src/services/growi-uri-injector/ViewInteractionPayloadDelegator.ts

@@ -58,8 +58,8 @@ export class ViewInteractionPayloadDelegator
   }
 
   extract(data: ViewInteractionPayload): GrowiUriWithOriginalData {
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const restoredData: GrowiUriWithOriginalData = JSON.parse(
+      // biome-ignore lint/style/noNonNullAssertion: private_metadata must be set --- IGNORE ---
       data.view.private_metadata!,
     ); // private_metadata must not be null at this moment
     data.view.private_metadata = restoredData.originalData;

+ 1 - 1
apps/slackbot-proxy/src/services/growi-uri-injector/block-elements/CheckboxesActionPayloadDelegator.ts

@@ -70,7 +70,7 @@ export class CheckboxesActionPayloadDelegator
       oneOfRestoredData = restoredData;
     });
 
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+    // biome-ignore lint/style/noNonNullAssertion: oneOfRestoredData must be set --- IGNORE ---
     return oneOfRestoredData!;
   }
 }

+ 5 - 2
packages/editor/src/main.tsx

@@ -8,8 +8,11 @@ import './main.scss';
 
 const rootElem = document.getElementById('root');
 
-// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-ReactDOM.createRoot(rootElem!).render(
+if (rootElem === null) {
+  throw new Error('Failed to find the root element');
+}
+
+ReactDOM.createRoot(rootElem).render(
   <React.StrictMode>
     <Playground />
     <ToastContainer />