Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion components/AlgoliaSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/* eslint-disable no-underscore-dangle */
import type { DocSearchHit, InternalDocSearchHit, StoredDocSearchHit } from '@docsearch/react';
import { DocSearchModal } from '@docsearch/react';
import clsx from 'clsx';
import dynamic from 'next/dynamic';
import Head from 'next/head';
import Link from 'next/link';
import { useRouter } from 'next/router';
import React, { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react';
import { createPortal } from 'react-dom';

const DocSearchModal = dynamic(
() => import('@docsearch/react').then((mod) => ({ default: mod.DocSearchModal })),
{ ssr: false }
);
Comment on lines +11 to +14

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the Prettier errors before merge.

ESLint reports prettier/prettier errors on Lines 11-14. Run the repository formatter.

Proposed formatting fix
-const DocSearchModal = dynamic(
-  () => import('`@docsearch/react`').then((mod) => ({ default: mod.DocSearchModal })),
-  { ssr: false }
-);
+const DocSearchModal = dynamic(() => import('`@docsearch/react`').then((mod) => ({ default: mod.DocSearchModal })), {
+  ssr: false
+});
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const DocSearchModal = dynamic(
() => import('@docsearch/react').then((mod) => ({ default: mod.DocSearchModal })),
{ ssr: false }
);
const DocSearchModal = dynamic(() => import('`@docsearch/react`').then((mod) => ({ default: mod.DocSearchModal })), {
ssr: false
});
🧰 Tools
🪛 ESLint

[error] 11-12: Replace ⏎··()·=>·import('@docsearch/react').then((mod)·=>·({·default:·mod.DocSearchModal·})), with ()·=>·import('@docsearch/react').then((mod)·=>·({·default:·mod.DocSearchModal·})),·{

(prettier/prettier)


[error] 13-14: Replace ·{·ssr:·false·}⏎ with ·ssr:·false⏎}

(prettier/prettier)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/AlgoliaSearch.tsx` around lines 11 - 14, Run the repository
formatter on the DocSearchModal dynamic import declaration in AlgoliaSearch.tsx
and apply the resulting Prettier formatting without changing its behavior.

Source: Linters/SAST tools


export const INDEX_NAME = 'asyncapi';
export const DOCS_INDEX_NAME = 'asyncapi-docs';
const APP_ID = 'Z621OGRI9Y';
Expand Down
1 change: 0 additions & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import url(https://cdn.jsdelivr.net/gh/tonsky/FiraCode@4/distr/fira_code.css);
@import url(https://cdn.jsdelivr.net/npm/@docsearch/css@3);

@import "swiper/css";
@import "swiper/css/a11y";
Expand Down
Loading