Răsfoiți Sursa

fix lint errors

Yuki Takei 4 ani în urmă
părinte
comite
35a033316d

+ 6 - 4
packages/app/src/components/IdenticalPathPage.tsx

@@ -10,7 +10,6 @@ import { useCurrentPagePath } from '~/stores/context';
 import PageListItem from './Page/PageListItem';
 import PageListItem from './Page/PageListItem';
 
 
 
 
-
 type IdenticalPathAlertProps = {
 type IdenticalPathAlertProps = {
   path? : string | null,
   path? : string | null,
 }
 }
@@ -28,13 +27,17 @@ const IdenticalPathAlert : FC<IdenticalPathAlertProps> = (props: IdenticalPathAl
     _pageName = devidedPath.latter;
     _pageName = devidedPath.latter;
   }
   }
 
 
+
   return (
   return (
     <div className="alert alert-warning py-3">
     <div className="alert alert-warning py-3">
       <h5 className="font-weight-bold mt-1">{t('duplicated_page_alert.same_page_name_exists', { pageName: _pageName })}</h5>
       <h5 className="font-weight-bold mt-1">{t('duplicated_page_alert.same_page_name_exists', { pageName: _pageName })}</h5>
       <p>
       <p>
         {t('duplicated_page_alert.same_page_name_exists_at_path',
         {t('duplicated_page_alert.same_page_name_exists_at_path',
           { path: _path, pageName: _pageName })}<br />
           { path: _path, pageName: _pageName })}<br />
-        <p dangerouslySetInnerHTML={{ __html: t('See_more_detail_on_new_schema', { url: t('GROWI.5.0_new_schema') }) }} />
+        <p
+          // eslint-disable-next-line react/no-danger
+          dangerouslySetInnerHTML={{ __html: t('See_more_detail_on_new_schema', { url: t('GROWI.5.0_new_schema') }) }}
+        />
       </p>
       </p>
       <p className="mb-1">{t('duplicated_page_alert.select_page_to_see')}</p>
       <p className="mb-1">{t('duplicated_page_alert.select_page_to_see')}</p>
     </div>
     </div>
@@ -42,7 +45,6 @@ const IdenticalPathAlert : FC<IdenticalPathAlertProps> = (props: IdenticalPathAl
 };
 };
 
 
 
 
-
 type IdenticalPathPageProps= {
 type IdenticalPathPageProps= {
   // add props and types here
   // add props and types here
 }
 }
@@ -50,7 +52,7 @@ type IdenticalPathPageProps= {
 
 
 const jsonNull = 'null';
 const jsonNull = 'null';
 
 
-const IdenticalPathPage:FC<IdenticalPathPageProps> = (props:IdenticalPathPageProps) => {
+const IdenticalPathPage:FC<IdenticalPathPageProps> = (props: IdenticalPathPageProps) => {
 
 
   const identicalPageDocument = document.getElementById('identical-path-page');
   const identicalPageDocument = document.getElementById('identical-path-page');
   const pageDataList = JSON.parse(identicalPageDocument?.getAttribute('data-identical-page-data-list') || jsonNull);
   const pageDataList = JSON.parse(identicalPageDocument?.getAttribute('data-identical-page-data-list') || jsonNull);

+ 3 - 3
packages/app/src/stores/context.tsx

@@ -5,7 +5,7 @@ import { pagePathUtils } from '@growi/core';
 
 
 import { IUser } from '../interfaces/user';
 import { IUser } from '../interfaces/user';
 
 
-import { useStaticSWR } from "./use-static-swr";
+import { useStaticSWR } from './use-static-swr';
 
 
 import { TargetAndAncestors, NotFoundTargetPathOrId } from '../interfaces/page-listing-results';
 import { TargetAndAncestors, NotFoundTargetPathOrId } from '../interfaces/page-listing-results';
 
 
@@ -88,11 +88,11 @@ export const useHasChildren = (initialData?: Nullable<any>): SWRResponse<Nullabl
 };
 };
 
 
 export const useTemplateTagData = (initialData?: Nullable<any>): SWRResponse<Nullable<any>, Error> => {
 export const useTemplateTagData = (initialData?: Nullable<any>): SWRResponse<Nullable<any>, Error> => {
-  return useStaticSWR<Nullable<any>, Error>('templateTagData', initialData );
+  return useStaticSWR<Nullable<any>, Error>('templateTagData', initialData);
 };
 };
 
 
 export const useShareLinksNumber = (initialData?: Nullable<any>): SWRResponse<Nullable<any>, Error> => {
 export const useShareLinksNumber = (initialData?: Nullable<any>): SWRResponse<Nullable<any>, Error> => {
-  return useStaticSWR<Nullable<any>, Error>('shareLinksNumber', initialData );
+  return useStaticSWR<Nullable<any>, Error>('shareLinksNumber', initialData);
 };
 };
 
 
 export const useShareLinkId = (initialData?: Nullable<any>): SWRResponse<Nullable<any>, Error> => {
 export const useShareLinkId = (initialData?: Nullable<any>): SWRResponse<Nullable<any>, Error> => {

+ 6 - 2
packages/app/src/stores/ui.tsx

@@ -1,5 +1,5 @@
 import useSWR, {
 import useSWR, {
-  useSWRConfig, SWRResponse, Key, Fetcher, mutate,
+  useSWRConfig, SWRResponse, Key, Fetcher,
 } from 'swr';
 } from 'swr';
 import useSWRImmutable from 'swr/immutable';
 import useSWRImmutable from 'swr/immutable';
 
 
@@ -322,6 +322,7 @@ export const useIsAbleToShowPageManagement = (): SWRResponse<boolean, Error> =>
 
 
   return useSWRImmutable(
   return useSWRImmutable(
     includesUndefined ? null : key,
     includesUndefined ? null : key,
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     () => isPageExist! && !isTrashPage && !isSharedUser,
     () => isPageExist! && !isTrashPage && !isSharedUser,
   );
   );
 };
 };
@@ -341,6 +342,7 @@ export const useIsAbleToShowTagLabel = (): SWRResponse<boolean, Error> => {
 
 
   return useSWRImmutable(
   return useSWRImmutable(
     includesUndefined ? null : key,
     includesUndefined ? null : key,
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     () => !isUserPage && !isSharedPage(currentPagePath!) && !isIdenticalPath && !(isViewMode && isNotFoundPage),
     () => !isUserPage && !isSharedPage(currentPagePath!) && !isIdenticalPath && !(isViewMode && isNotFoundPage),
   );
   );
 };
 };
@@ -356,7 +358,8 @@ export const useIsAbleToShowPageEditorModeManager = (): SWRResponse<boolean, Err
 
 
   return useSWRImmutable(
   return useSWRImmutable(
     includesUndefined ? null : key,
     includesUndefined ? null : key,
-    () => !isNotCreatable && !isForbidden && !isTrashPage && !isSharedUser);
+    () => !isNotCreatable && !isForbidden && !isTrashPage && !isSharedUser,
+  );
 };
 };
 
 
 export const useIsAbleToShowPageAuthors = (): SWRResponse<boolean, Error> => {
 export const useIsAbleToShowPageAuthors = (): SWRResponse<boolean, Error> => {
@@ -368,6 +371,7 @@ export const useIsAbleToShowPageAuthors = (): SWRResponse<boolean, Error> => {
 
 
   return useSWRImmutable(
   return useSWRImmutable(
     includesUndefined ? null : key,
     includesUndefined ? null : key,
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     () => isPageExist! && !isUserPage,
     () => isPageExist! && !isUserPage,
   );
   );
 };
 };