Shun Miyazawa 8 месяцев назад
Родитель
Сommit
14da75e4f3

+ 5 - 5
packages/remark-lsx/src/client/components/Lsx.tsx

@@ -57,7 +57,7 @@ const LsxSubstance = React.memo(
 
     const ErrorMessage = useCallback((): JSX.Element => {
       if (!hasError) {
-        return <></>;
+        return;
       }
 
       return (
@@ -73,10 +73,10 @@ const LsxSubstance = React.memo(
 
     const Loading = useCallback((): JSX.Element => {
       if (hasError) {
-        return <></>;
+        return;
       }
       if (!isLoading) {
-        return <></>;
+        return;
       }
 
       return (
@@ -116,14 +116,14 @@ const LsxSubstance = React.memo(
       const lastResult = data?.at(-1);
 
       if (lastResult == null) {
-        return <></>;
+        return;
       }
 
       const { cursor, total } = lastResult;
       const leftItemsNum = total - cursor;
 
       if (leftItemsNum === 0) {
-        return <></>;
+        return;
       }
 
       return (

+ 1 - 1
packages/remark-lsx/src/client/components/LsxPageList/LsxPage.tsx

@@ -102,7 +102,7 @@ export const LsxPage = React.memo((props: Props): JSX.Element => {
 
   const pageListMetaElement: JSX.Element = useMemo(() => {
     if (pageNode.page == null) {
-      return <></>;
+      return;
     }
 
     const { page } = pageNode;

+ 1 - 0
packages/remark-lsx/src/client/utils/page-node.spec.ts

@@ -8,6 +8,7 @@ import { generatePageNodeTree } from './page-node';
 
 function omitPageData(pageNode: PageNode): Omit<PageNode, 'page'> {
   // Destructure to omit 'page', and recursively process children
+  // biome-ignore lint/correctness/noUnusedVariables: ignore
   const { page, children, ...rest } = pageNode;
   return {
     ...rest,

+ 2 - 4
packages/remark-lsx/src/server/index.ts

@@ -1,10 +1,8 @@
+import { SCOPE } from '@growi/core/dist/interfaces';
 import type { NextFunction, Request, Response } from 'express';
 import { query, validationResult } from 'express-validator';
 import { FilterXSS } from 'xss';
-
 import type { LsxApiOptions } from '../interfaces/api';
-
-import { SCOPE } from '@growi/core/dist/interfaces';
 import { listPages } from './routes/list-pages';
 
 const loginRequiredFallback = (req: Request, res: Response) => {
@@ -28,7 +26,7 @@ const lsxValidator = [
         }
 
         return jsonData;
-      } catch (err) {
+      } catch {
         throw new Error('Invalid JSON format in options');
       }
     }),