From fe13dadf3be7ec7cbef631fd7a506879a8e8c0cb Mon Sep 17 00:00:00 2001 From: Fedor Abrashin Date: Wed, 22 Jan 2025 19:30:01 +0300 Subject: [PATCH] fix linter --- .eslintrc.json | 3 ++- docs/updates/list/index.mdx | 2 +- .../RecentlyUpdatedArticles.js | 11 +++++++---- .../RecentlyUpdatedArticlesIframe.tsx | 3 ++- src/plugins/docs-plugin-extended/index.js | 16 ++++++---------- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 2aa6aa93..3f999258 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -40,6 +40,7 @@ "prev": ["const", "let", "var"], "next": ["const", "let", "var"] } - ] + ], + "jsx-a11y/click-events-have-key-events": "off" } } diff --git a/docs/updates/list/index.mdx b/docs/updates/list/index.mdx index 7b738c68..60a974a9 100644 --- a/docs/updates/list/index.mdx +++ b/docs/updates/list/index.mdx @@ -1,6 +1,6 @@ --- slug: '/updates/list' -title: 'Новое в платорме' +title: 'Новое в платформе' description: 'Всё про email-рассылки: как создавать выпуски, персонализировать контент и что нужно настраивать дополнительно' sidebar_position: 1 hide_title: true diff --git a/src/components/RecentlyUpdatedArticles/RecentlyUpdatedArticles.js b/src/components/RecentlyUpdatedArticles/RecentlyUpdatedArticles.js index 2160e97b..25705062 100644 --- a/src/components/RecentlyUpdatedArticles/RecentlyUpdatedArticles.js +++ b/src/components/RecentlyUpdatedArticles/RecentlyUpdatedArticles.js @@ -7,8 +7,9 @@ import { truncateString } from './utils/truncateString'; const NBSP = '\u00A0'; -const RecentlyUpdatedArticlesCard = ({ children, slug }) => { +const RecentlyUpdatedArticlesCard = ({ children, slug, index }) => { const handleClick = () => { + // eslint-disable-next-line no-undef document.dispatchEvent(new CustomEvent('redirect', { detail: { slug } })); }; @@ -16,6 +17,8 @@ const RecentlyUpdatedArticlesCard = ({ children, slug }) => {
{children}
@@ -45,8 +48,8 @@ const RecentlyUpdatedArticlesChanges = ({ frontMatter }) => { const RecentlyUpdatedArticles = ({ recentArticles }) => (
- {recentArticles.map(({ title, lastUpdatedAt, frontMatter, slug, description }) => ( - + {recentArticles.map(({ title, lastUpdatedAt, frontMatter, slug, description }, index) => ( +
{title} @@ -65,7 +68,7 @@ const RecentlyUpdatedArticles = ({ recentArticles }) => ( {description && frontMatter.recent_article?.new && ( - {truncateString(description, 180)} + {truncateString(description, 200)} )} ))} diff --git a/src/components/RecentlyUpdatedArticles/RecentlyUpdatedArticlesIframe.tsx b/src/components/RecentlyUpdatedArticles/RecentlyUpdatedArticlesIframe.tsx index ce62d9db..c5b0e194 100644 --- a/src/components/RecentlyUpdatedArticles/RecentlyUpdatedArticlesIframe.tsx +++ b/src/components/RecentlyUpdatedArticles/RecentlyUpdatedArticlesIframe.tsx @@ -41,6 +41,7 @@ export const RecentlyUpdatedArticlesIframe = () => { ref={iframeRef} src={RECENT_ARTICLES_TEMP_URL} name="latest-articles" + title="latest-articles" className="w-full" style={{ border: 'none', @@ -49,7 +50,7 @@ export const RecentlyUpdatedArticlesIframe = () => { }} onLoad={resizeIframe} scrolling="no" - seamless={true} + seamless /> ); }; diff --git a/src/plugins/docs-plugin-extended/index.js b/src/plugins/docs-plugin-extended/index.js index 6dcb0538..8f056dac 100644 --- a/src/plugins/docs-plugin-extended/index.js +++ b/src/plugins/docs-plugin-extended/index.js @@ -1,11 +1,9 @@ -const docsPluginExports = require('@docusaurus/plugin-content-docs'); -const { getRecentlyUpdatedArticles } = require('./getRecentArticles'); -const { RECENT_ARTICLES_TEMP_URL } = require('../../components/RecentlyUpdatedArticles/constants'); - -const defaultDocsPlugin = docsPluginExports.default; +import docsPluginExports from '@docusaurus/plugin-content-docs'; +import { getRecentlyUpdatedArticles } from './getRecentArticles'; +import { RECENT_ARTICLES_TEMP_URL } from '../../components/RecentlyUpdatedArticles/constants'; const docsPluginEnhanced = async (...pluginArgs) => { - const docsPluginInstance = await defaultDocsPlugin(...pluginArgs); + const docsPluginInstance = await docsPluginExports(...pluginArgs); return { ...docsPluginInstance, @@ -35,7 +33,5 @@ const docsPluginEnhanced = async (...pluginArgs) => { }; }; -module.exports = { - ...docsPluginExports, - default: docsPluginEnhanced, -}; +export * from '@docusaurus/plugin-content-docs'; +export default docsPluginEnhanced;