Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lint): update biome version & fix lint #214

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"suspicious": {
"noExplicitAny": "warn",
"noImplicitAnyLet": "warn",
"noAssignInExpressions": "warn",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/ArticleSettingMenu/Menu/PinItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
26 changes: 13 additions & 13 deletions src/widgets/ArticleSettingMenu/SubMenu/Mirror2Home.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -22,17 +22,17 @@ const Mirrow2Home: FC<TProps> = ({ 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 (
<Wrapper>
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/IllegalWarning/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ const IllegalWarning: FC<TProps> = ({ illegalReason, illegalWords }) => {
{illegalReason.map((reason, index) => (
<Fragment key={reason}>
<Reason>{reason}</Reason>
{index !== illegalReason.length - 1 && <></>}
{index !== illegalReason.length - 1 && <>|</>}
</Fragment>
))}
] 内容:
</Title>

<Content>
{illegalWords.map((word, index) => (
{illegalWords.map((word) => (
<IllegalItem key={word}>{word}</IllegalItem>
))}
</Content>
Expand Down
11 changes: 1 addition & 10 deletions src/widgets/MarkDownRender/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,7 @@ class MarkDownRender extends React.Component {
return (
<PreviewerContainer>
<MarkDownStyle>
<div className="markdown-body">
{/* eslint-disable react/no-danger */}
<div
id={contentDomId}
dangerouslySetInnerHTML={{
__html: html,
}}
/>
{/* eslint-enable react/no-danger */}
</div>
<div className="markdown-body">TODO</div>
</MarkDownStyle>
</PreviewerContainer>
)
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/OSSUploader/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading