Skip to content

Commit 4184c33

Browse files
committed
🚨(docs) upgrade eslint to v9 with Docs app
We upgraded ESLint to version 9 in the Docs app, which includes several improvements and fixes. This change also involves updating the ESLint configuration files to the new format and ensuring compatibility with the latest ESLint features.
1 parent 3688591 commit 4184c33

File tree

18 files changed

+61
-63
lines changed

18 files changed

+61
-63
lines changed

src/frontend/apps/impress/.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { defineConfig } from '@eslint/config-helpers';
2+
import docsPlugin from 'eslint-plugin-docs';
3+
4+
const eslintConfig = defineConfig([
5+
{
6+
plugins: {
7+
docs: docsPlugin,
8+
},
9+
extends: ['docs/next'],
10+
languageOptions: {
11+
parserOptions: {
12+
tsconfigRootDir: import.meta.dirname,
13+
project: ['./tsconfig.json'],
14+
},
15+
},
16+
settings: {
17+
next: {
18+
rootDir: import.meta.dirname,
19+
},
20+
},
21+
},
22+
]);
23+
24+
export default eslintConfig;

src/frontend/apps/impress/src/components/dropdown-menu/hook/useDropdownKeyboardNav.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,28 @@ export const useDropdownKeyboardNav = ({
3232
.filter((index) => index !== -1);
3333

3434
switch (event.key) {
35-
case 'ArrowDown':
35+
case 'ArrowDown': {
3636
event.preventDefault();
3737
const nextIndex =
3838
focusedIndex < enabledIndices.length - 1 ? focusedIndex + 1 : 0;
3939
const nextEnabledIndex = enabledIndices[nextIndex];
4040
setFocusedIndex(nextIndex);
4141
menuItemRefs.current[nextEnabledIndex]?.focus();
4242
break;
43+
}
4344

44-
case 'ArrowUp':
45+
case 'ArrowUp': {
4546
event.preventDefault();
4647
const prevIndex =
4748
focusedIndex > 0 ? focusedIndex - 1 : enabledIndices.length - 1;
4849
const prevEnabledIndex = enabledIndices[prevIndex];
4950
setFocusedIndex(prevIndex);
5051
menuItemRefs.current[prevEnabledIndex]?.focus();
5152
break;
53+
}
5254

5355
case 'Enter':
54-
case ' ':
56+
case ' ': {
5557
event.preventDefault();
5658
if (focusedIndex >= 0 && focusedIndex < enabledIndices.length) {
5759
const selectedOptionIndex = enabledIndices[focusedIndex];
@@ -62,6 +64,7 @@ export const useDropdownKeyboardNav = ({
6264
}
6365
}
6466
break;
67+
}
6568

6669
case 'Escape':
6770
event.preventDefault();

src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export const QuickSearchInput = ({
5555
</div>
5656
)}
5757
<Command.Input
58-
/* eslint-disable-next-line jsx-a11y/no-autofocus */
5958
autoFocus={true}
6059
aria-label={t('Quick search input')}
6160
onClick={(e) => {

src/frontend/apps/impress/src/custom-next.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-unused-vars */
2-
31
declare module '*.svg' {
42
import * as React from 'react';
53

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/AIButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ type ItemProps = Omit<ItemDefault, 'onClick'> & {
205205
onClick: (e: React.MouseEvent) => void;
206206
};
207207

208-
interface AIMenuItemTransform {
208+
interface AIMenuItemTransformProps {
209209
action: AITransformActions;
210210
docId: string;
211211
icon?: ReactNode;
@@ -216,7 +216,7 @@ const AIMenuItemTransform = ({
216216
action,
217217
children,
218218
icon,
219-
}: PropsWithChildren<AIMenuItemTransform>) => {
219+
}: PropsWithChildren<AIMenuItemTransformProps>) => {
220220
const { mutateAsync: requestAI, isPending } = useDocAITransform();
221221
const editor = useBlockNoteEditor();
222222

@@ -244,7 +244,7 @@ const AIMenuItemTransform = ({
244244
);
245245
};
246246

247-
interface AIMenuItemTranslate {
247+
interface AIMenuItemTranslateProps {
248248
language: string;
249249
docId: string;
250250
icon?: ReactNode;
@@ -255,7 +255,7 @@ const AIMenuItemTranslate = ({
255255
docId,
256256
icon,
257257
language,
258-
}: PropsWithChildren<AIMenuItemTranslate>) => {
258+
}: PropsWithChildren<AIMenuItemTranslateProps>) => {
259259
const { mutateAsync: requestAI, isPending } = useDocAITranslate();
260260
const editor = useBlockNoteEditor();
261261

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/InterlinkingSearchInlineContent.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react-hooks/rules-of-hooks */
21
import { createReactInlineContentSpec } from '@blocknote/react';
32
import { TFunction } from 'i18next';
43

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Interlinking/SearchPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react-hooks/rules-of-hooks */
21
import {
32
PartialCustomInlineContentFromConfig,
43
StyleSchema,

src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/imagePDF.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable jsx-a11y/alt-text */
21
import { DefaultProps } from '@blocknote/core';
32
import { Image, Text, View } from '@react-pdf/renderer';
43

src/frontend/apps/impress/src/features/docs/doc-export/inline-content-mapping/interlinkingLinkPDF.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable jsx-a11y/alt-text */
21
import { Image, Link, Text } from '@react-pdf/renderer';
32

43
import DocSelectedIcon from '../assets/doc-selected.png';

0 commit comments

Comments
 (0)