From 5c44b6ec87036524f3f0122c5f7131b1cf2d3c97 Mon Sep 17 00:00:00 2001 From: Thomas Beverley Date: Mon, 18 Mar 2024 08:57:49 +0000 Subject: [PATCH] Linter fixes --- .eslintrc.js | 3 ++- src/Redux/Bot/BotSagas.ts | 3 ++- src/Views/Editor/CodeEditor/CodeEditor.tsx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f6d65da..3fafc6c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,6 +9,7 @@ module.exports = { '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/no-misused-promises': 'off', '@typescript-eslint/promise-function-async': 'off', - '@typescript-eslint/prefer-readonly': 'off' + '@typescript-eslint/prefer-readonly': 'off', + '@typescript-eslint/no-unsafe-argument': 'off' } } diff --git a/src/Redux/Bot/BotSagas.ts b/src/Redux/Bot/BotSagas.ts index 9770fd5..69ead7c 100644 --- a/src/Redux/Bot/BotSagas.ts +++ b/src/Redux/Bot/BotSagas.ts @@ -124,7 +124,8 @@ const sendMessageInternal = async (dispatch: AppDispatch, options: SendMessageOp } const getFileLanguage = (fileHandle: FSFileSystemFileHandle) => { - const fileExt = fileHandle.name.split('.').at(-1) as string + const fileExt = fileHandle.name.split('.').at(-1) + if (typeof (fileExt) !== 'string') { return 'code' } switch (fileExt) { case 'js': return 'JavaScript' case 'css': return 'CSS' diff --git a/src/Views/Editor/CodeEditor/CodeEditor.tsx b/src/Views/Editor/CodeEditor/CodeEditor.tsx index c28c01c..4e9dedb 100644 --- a/src/Views/Editor/CodeEditor/CodeEditor.tsx +++ b/src/Views/Editor/CodeEditor/CodeEditor.tsx @@ -164,7 +164,8 @@ class CodeEditor extends React.PureComponent { if (filename === undefined) { return undefined } - const ext = filename.split('.').at(-1) as string + const ext = filename.split('.').at(-1) + if (typeof (ext) !== 'string') { return 'code' } switch (ext) { case 'js': return 'javascript' case 'css': return 'css'