diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78f336cdf..33dcece14 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: # with: # version: 1.4.1 - name: Run Biome - run: node_modules/.bin/biome ci ./src; ls -llh; pwd + run: node_modules/.bin/biome ci ./src - name: (Frontend) Setup Config CMD Tools working-directory: ./ run: ls -llh; chmod +x ./utils/bin/jq-linux; ./utils/bin/jq-linux -s '.[0] * .[1]' config/config.json config/config.ci.json > /tmp/config.json; cp /tmp/config.json ./config/config.json diff --git a/biome.json b/biome.json index fbebb7145..925d35036 100644 --- a/biome.json +++ b/biome.json @@ -18,6 +18,7 @@ }, "suspicious": { "noExplicitAny": "warn", + "noImplicitAnyLet": "warn", "noAssignInExpressions": "warn", "noDuplicateJsxProps": "error", "noDuplicateObjectKeys": "error", diff --git a/src/widgets/ArticleSettingMenu/Menu/PinItem.tsx b/src/widgets/ArticleSettingMenu/Menu/PinItem.tsx index 510d0fe0b..3a8efecd4 100644 --- a/src/widgets/ArticleSettingMenu/Menu/PinItem.tsx +++ b/src/widgets/ArticleSettingMenu/Menu/PinItem.tsx @@ -13,7 +13,7 @@ import { MenuItem } from '../styles/menu' const PinItem: FC = () => { const { article } = useViewingArticle() const [result, pinPost] = useMutation(S.pinPost) - const [result2, undoPinPost] = useMutation(S.undoPinPost) + const [_result2, undoPinPost] = useMutation(S.undoPinPost) const [pin, setPin] = useState(article.isPinned) diff --git a/src/widgets/ArticleSettingMenu/SubMenu/Mirror2Home.tsx b/src/widgets/ArticleSettingMenu/SubMenu/Mirror2Home.tsx index 3a26ffa48..90d643443 100644 --- a/src/widgets/ArticleSettingMenu/SubMenu/Mirror2Home.tsx +++ b/src/widgets/ArticleSettingMenu/SubMenu/Mirror2Home.tsx @@ -1,8 +1,8 @@ -import { FC, useState, useEffect } from 'react' +import { FC } from 'react' import { useMutation } from 'urql' import useViewingArticle from '@/hooks/useViewingArticle' -// import { toast, updateViewingArticle } from '@/signal' +import { toast, updateViewingArticle } from '@/signal' import S from '../schema' import useTouched from '../useTouched' @@ -22,17 +22,17 @@ const Mirrow2Home: FC = ({ onBack }) => { const handleUpdate = () => { const params = { id: article.id } console.log('## handle action') - // updatePost(params).then((result) => { - // if (result.error) { - // toast('修改失败', 'error') - // } else { - // toast('修改完成') - // const newTitle = result.data.updatePost.title - // setTitle(newTitle) - // updateViewingArticle({ id: article.id, title: newTitle }) - // resetTouched() - // } - // }) + updatePost(params).then((result) => { + if (result.error) { + toast('修改失败', 'error') + } else { + toast('修改完成') + const newTitle = result.data.updatePost.title + // setTitle(newTitle) + updateViewingArticle({ id: article.id, title: newTitle }) + resetTouched() + } + }) } return ( diff --git a/src/widgets/IllegalWarning/index.tsx b/src/widgets/IllegalWarning/index.tsx index 3176d115c..ea6ad7004 100755 --- a/src/widgets/IllegalWarning/index.tsx +++ b/src/widgets/IllegalWarning/index.tsx @@ -17,14 +17,14 @@ const IllegalWarning: FC = ({ illegalReason, illegalWords }) => { {illegalReason.map((reason, index) => ( {reason} - {index !== illegalReason.length - 1 && <>,} + {index !== illegalReason.length - 1 && <>|} ))} ] 内容: - {illegalWords.map((word, index) => ( + {illegalWords.map((word) => ( {word} ))} diff --git a/src/widgets/MarkDownRender/index.js b/src/widgets/MarkDownRender/index.js index 4c10e9b6c..f32a4a9bb 100755 --- a/src/widgets/MarkDownRender/index.js +++ b/src/widgets/MarkDownRender/index.js @@ -65,16 +65,7 @@ class MarkDownRender extends React.Component { return ( -
- {/* eslint-disable react/no-danger */} -
- {/* eslint-enable react/no-danger */} -
+
TODO
) diff --git a/src/widgets/OSSUploader/helper.ts b/src/widgets/OSSUploader/helper.ts index 6ee7f68f5..4b3989613 100755 --- a/src/widgets/OSSUploader/helper.ts +++ b/src/widgets/OSSUploader/helper.ts @@ -114,7 +114,7 @@ export const doUploadFile = (ossClient, file, filePrefix, callbacks): void => { const url = `${ASSETS_ENDPOINT}/${result.name}` callbacks.onDone(url) }) - .catch((err) => { + .catch((_err) => { callbacks.onError('上传失败') toast('文件上传失败') // BStore.remove(STS.AK)