فهرست منبع

fix lint errors

Yuki Takei 5 ماه پیش
والد
کامیت
bad663dd93

+ 5 - 1
apps/app/src/components/PageView/PageAlerts/FixPageGrantAlert/FixPageGrantAlert.tsx

@@ -68,7 +68,11 @@ export const FixPageGrantAlert = (): JSX.Element => {
     currentUser != null ? pageId : null,
   );
 
-  if (pageId == null || !hasParent || !dataIsGrantNormalized?.isGrantNormalized) {
+  if (
+    pageId == null ||
+    !hasParent ||
+    !dataIsGrantNormalized?.isGrantNormalized
+  ) {
     // biome-ignore lint/complexity/noUselessFragments: ignore
     return <></>;
   }

+ 12 - 6
apps/app/src/components/PageView/PageAlerts/FixPageGrantAlert/dynamic.tsx

@@ -12,16 +12,22 @@ export const FixPageGrantAlertLazyLoaded = (): JSX.Element => {
   const pageId = pageData?._id;
 
   const hasParent = pageData != null ? pageData.parent != null : false;
-  const { data: dataIsGrantNormalized } = useSWRxCurrentGrantData(currentUser != null ? pageId : null);
+  const { data: dataIsGrantNormalized } = useSWRxCurrentGrantData(
+    currentUser != null ? pageId : null,
+  );
 
-  const isActive = !isNotFound
-    && hasParent
-    && dataIsGrantNormalized?.isGrantNormalized != null
-    && !dataIsGrantNormalized.isGrantNormalized;
+  const isActive =
+    !isNotFound &&
+    hasParent &&
+    dataIsGrantNormalized?.isGrantNormalized != null &&
+    !dataIsGrantNormalized.isGrantNormalized;
 
   const FixPageGrantAlert = useLazyLoader<Record<string, unknown>>(
     'fix-page-grant-alert',
-    () => import('./FixPageGrantAlert').then((mod) => ({ default: mod.FixPageGrantAlert })),
+    () =>
+      import('./FixPageGrantAlert').then((mod) => ({
+        default: mod.FixPageGrantAlert,
+      })),
     isActive,
   );
 

+ 6 - 2
apps/app/src/components/PageView/PageAlerts/FullTextSearchNotCoverAlert/FullTextSearchNotCoverAlert.tsx

@@ -8,9 +8,13 @@ export type FullTextSearchNotCoverAlertProps = {
   isActive: boolean;
 };
 
-export const FullTextSearchNotCoverAlert = ({ isActive }: FullTextSearchNotCoverAlertProps): JSX.Element => {
+export const FullTextSearchNotCoverAlert = ({
+  isActive,
+}: FullTextSearchNotCoverAlertProps): JSX.Element => {
   const { t } = useTranslation();
-  const elasticsearchMaxBodyLengthToIndex = useAtomValue(elasticsearchMaxBodyLengthToIndexAtom);
+  const elasticsearchMaxBodyLengthToIndex = useAtomValue(
+    elasticsearchMaxBodyLengthToIndexAtom,
+  );
 
   // Display condition is controlled by the isActive prop from dynamic.tsx
   if (!isActive) {

+ 4 - 6
apps/app/src/components/PageView/PageAlerts/PageRedirectedAlert/PageRedirectedAlert.tsx

@@ -20,9 +20,8 @@ const PageRedirectedAlertSubstance = React.memo(
         return;
       }
       try {
-        const unlink = (
-          await import('~/client/services/page-operation')
-        ).unlink;
+        const unlink = (await import('~/client/services/page-operation'))
+          .unlink;
         await unlink(currentPagePath);
         setIsUnlinked(true);
       } catch (err) {
@@ -42,9 +41,8 @@ const PageRedirectedAlertSubstance = React.memo(
     return (
       <div className="alert alert-pink d-edit-none py-3 px-4 d-flex align-items-center justify-content-between">
         <span>
-          <strong>{t('Redirected')}:</strong>{' '}
-          {t('page_page.notice.redirected')} <code>{redirectFrom}</code>{' '}
-          {t('page_page.notice.redirected_period')}
+          <strong>{t('Redirected')}:</strong> {t('page_page.notice.redirected')}{' '}
+          <code>{redirectFrom}</code> {t('page_page.notice.redirected_period')}
         </span>
         <button
           type="button"

+ 4 - 1
apps/app/src/components/PageView/PageAlerts/PageRedirectedAlert/dynamic.tsx

@@ -9,7 +9,10 @@ export const PageRedirectedAlertLazyLoaded = (): JSX.Element => {
 
   const PageRedirectedAlert = useLazyLoader<Record<string, unknown>>(
     'page-redirected-alert',
-    () => import('./PageRedirectedAlert').then((mod) => ({ default: mod.PageRedirectedAlert })),
+    () =>
+      import('./PageRedirectedAlert').then((mod) => ({
+        default: mod.PageRedirectedAlert,
+      })),
     isActive,
   );
 

+ 4 - 1
apps/app/src/components/PageView/PageAlerts/TrashPageAlert/dynamic.tsx

@@ -8,7 +8,10 @@ export const TrashPageAlertLazyLoaded = (): JSX.Element => {
 
   const TrashPageAlert = useLazyLoader<Record<string, unknown>>(
     'trash-page-alert',
-    () => import('./TrashPageAlert').then((mod) => ({ default: mod.TrashPageAlert })),
+    () =>
+      import('./TrashPageAlert').then((mod) => ({
+        default: mod.TrashPageAlert,
+      })),
     isTrashPage,
   );
 

+ 7 - 2
apps/app/src/features/search/client/components/SearchPage/SearchOptionModal/dynamic.tsx

@@ -11,12 +11,17 @@ type SearchOptionModalProps = {
   onIncludeTrashPagesSwitched?: (isChecked: boolean) => void;
 };
 
-export const SearchOptionModalLazyLoaded = (props: SearchOptionModalProps): JSX.Element => {
+export const SearchOptionModalLazyLoaded = (
+  props: SearchOptionModalProps,
+): JSX.Element => {
   const { isOpen } = props;
 
   const SearchOptionModal = useLazyLoader<SearchOptionModalProps>(
     'search-option-modal',
-    () => import('./SearchOptionModal').then(mod => ({ default: mod.SearchOptionModal })),
+    () =>
+      import('./SearchOptionModal').then((mod) => ({
+        default: mod.SearchOptionModal,
+      })),
     isOpen,
   );