Skip to content

Commit 5016eb9

Browse files
committed
🚨(eslint) add missing rules
We recently upgraded to Eslint v9, it seems that it is missing some rules that we had previously. We add them back: - @typescript-eslint/no-inferrable-types - @typescript-eslint/no-floating-promises
1 parent 18feab1 commit 5016eb9

File tree

10 files changed

+15
-11
lines changed

10 files changed

+15
-11
lines changed

src/frontend/apps/e2e/__tests__/app-impress/utils-common.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const overrideConfig = async (
4848
export const keyCloakSignIn = async (
4949
page: Page,
5050
browserName: string,
51-
fromHome: boolean = true,
51+
fromHome = true,
5252
) => {
5353
if (fromHome) {
5454
await page.getByRole('button', { name: 'Start Writing' }).first().click();
@@ -79,8 +79,8 @@ export const createDoc = async (
7979
page: Page,
8080
docName: string,
8181
browserName: string,
82-
length: number = 1,
83-
isMobile: boolean = false,
82+
length = 1,
83+
isMobile = false,
8484
) => {
8585
const randomDocs = randomName(docName, browserName, length);
8686

src/frontend/apps/e2e/__tests__/app-impress/utils-editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export const writeInEditor = async ({
2222
text: string;
2323
}) => {
2424
const editor = await getEditor({ page });
25-
editor.locator('.bn-block-outer').last().fill(text);
25+
await editor.locator('.bn-block-outer').last().fill(text);
2626
return editor;
2727
};

src/frontend/apps/e2e/__tests__/app-impress/utils-share.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const addNewMember = async (
1515
page: Page,
1616
index: number,
1717
role: 'Administrator' | 'Owner' | 'Editor' | 'Reader',
18-
fillText: string = 'user.test',
18+
fillText = 'user.test',
1919
) => {
2020
const responsePromiseSearchUser = page.waitForResponse(
2121
(response) =>

src/frontend/apps/e2e/__tests__/app-impress/utils-sub-pages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const createRootSubPage = async (
1212
page: Page,
1313
browserName: BrowserName,
1414
docName: string,
15-
isMobile: boolean = false,
15+
isMobile = false,
1616
) => {
1717
if (isMobile) {
1818
await page

src/frontend/apps/impress/src/api/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export const backendUrl = () =>
1818
* @param apiVersion - The version of the API (defaults to '1.0').
1919
* @returns The full versioned API base URL as a string.
2020
*/
21-
export const baseApiUrl = (apiVersion: string = '1.0') =>
21+
export const baseApiUrl = (apiVersion = '1.0') =>
2222
`${backendUrl()}/api/v${apiVersion}/`;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { baseApiUrl } from '@/api';
22

3-
export const HOME_URL: string = '/home';
3+
export const HOME_URL = '/home';
44
export const LOGIN_URL = `${baseApiUrl()}authenticate/`;
55
export const LOGOUT_URL = `${baseApiUrl()}logout/`;
66
export const PATH_AUTH_LOCAL_STORAGE = 'docs-path-auth';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function isBlock(block: Block): block is Block {
2222
);
2323
}
2424

25-
const recursiveContent = (content: Block[], base: string = '') => {
25+
const recursiveContent = (content: Block[], base = '') => {
2626
let fullContent = base;
2727
for (const innerContent of content) {
2828
if (innerContent.type === 'text') {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const LinkSelected = ({ url, title }: LinkSelectedProps) => {
5656

5757
const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
5858
e.preventDefault();
59-
router.push(url);
59+
void router.push(url);
6060
};
6161

6262
return (

src/frontend/apps/impress/src/pages/docs/[id]/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ const DocPage = ({ id }: DocProps) => {
115115
// Invalidate when provider store reports a lost connection
116116
useEffect(() => {
117117
if (hasLostConnection && doc?.id) {
118-
queryClient.invalidateQueries({ queryKey: [KEY_DOC, { id: doc.id }] });
118+
void queryClient.invalidateQueries({
119+
queryKey: [KEY_DOC, { id: doc.id }],
120+
});
119121
resetLostConnection();
120122
}
121123
}, [hasLostConnection, doc?.id, queryClient, resetLostConnection]);

src/frontend/packages/eslint-plugin-docs/typescript.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ const typescriptConfig = {
2222
'@typescript-eslint': typescriptEslint,
2323
},
2424
rules: {
25+
'@typescript-eslint/no-inferrable-types': 'error',
2526
'@typescript-eslint/no-explicit-any': 'error',
27+
'@typescript-eslint/no-floating-promises': 'error',
2628
'@typescript-eslint/no-non-null-assertion': 'error',
2729
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
2830
'@typescript-eslint/no-unsafe-argument': 'error',

0 commit comments

Comments
 (0)