Skip to content

Commit 38d8f20

Browse files
committed
style: 🚨 修复升级依赖后的报错
1 parent 9455cf9 commit 38d8f20

26 files changed

Lines changed: 49 additions & 31 deletions

.oxlintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"style": "warn"
1818
},
1919
"env": {
20-
"builtin": true
20+
"browser": true,
21+
"worker": true,
22+
"es2024": true
2123
},
2224
// 有 bug,只能使用 .eslintignore 来禁用,暂时注释
2325
// "ignorePatterns": [

src/components/DownloadButton.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ export const DownloadButton = () => {
6868
level: 0,
6969
comment: location.href,
7070
});
71-
saveAs(new Blob([zipped]), `${store.title || state.rawTitle}.zip`);
71+
saveAs(
72+
new Blob([zipped as BlobPart]),
73+
`${store.title || state.rawTitle}.zip`,
74+
);
7275
setState('completedNum', -1);
7376
toast(
7477
state.errorNum > 0

src/components/IconButton/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type IconButtonProps = {
3131
/** 图标按钮 */
3232
export const IconButton: Component<IconButtonProps> = (_props) => {
3333
const props = mergeProps({ placement: 'right' }, _props);
34-
let buttonRef!: HTMLButtonElement;
34+
let buttonRef!: HTMLButtonElement; // oxlint-disable-line no-unassigned-vars
3535
const handleClick: EventHandler['on:click'] = (e) => {
3636
if (props.disable) return;
3737
(props.onClick as JSX.EventHandler<HTMLElement, MouseEvent>)?.(e);

src/components/Manga/actions/renderPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const imgShowState = createRootMemo<Map<number, 0 | 1 | ''>>(() => {
160160
: store.renderRange;
161161

162162
const stateList = new Map<number, 0 | 1 | ''>();
163-
for (let i = showRange[0]; i <= showRange[1]; i++) {
163+
for (let [i] = showRange; i <= showRange[1]; i++) {
164164
const page = store.pageList[i];
165165
if (!page) continue;
166166
const [a, b] = page;

src/components/Manga/actions/switch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { refs, setState, type State, store } from '../store';
2-
import { getImgEle, setOption } from './helper';
2+
import { setOption } from './helper';
33
import { updatePageData } from './image';
44
import { updateImgLoadType } from './imageLoad';
55
import { handleImgRecognition } from './imageRecognition';

src/components/Manga/actions/translation/selfhosted.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const selfhostedTranslation = async (url: string): Promise<string> => {
5151
responseType: 'json',
5252
data: createFormData(imgBlob, 'selfhosted-old'),
5353
});
54-
task_id = res.response.task_id;
54+
({ task_id } = res.response);
5555
} catch (error) {
5656
log.error(error);
5757
throw new Error(t('translation.tip.upload_error'));
@@ -155,7 +155,7 @@ export const selfhostedTranslation = async (url: string): Promise<string> => {
155155
};
156156

157157
export const [selfhostedOptions, setSelfOptions] = createEqualsSignal<
158-
Array<[string, string]>
158+
[string, string][]
159159
>([]);
160160

161161
/** 更新部署服务的可用翻译 */

src/components/Manga/components/ComicImg.module.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
grid-auto-columns: 100%;
101101
grid-auto-flow: column;
102102
grid-auto-rows: 100%;
103-
grid-row-gap: 0;
103+
row-gap: 0;
104104
place-items: center;
105105

106106
width: 100%;
@@ -155,8 +155,8 @@
155155
grid-auto-columns: 1fr;
156156
grid-auto-flow: row;
157157
grid-auto-rows: max-content;
158-
grid-row-gap: 1.5em;
159158
grid-template-rows: unset;
159+
row-gap: 1.5em;
160160
align-items: end;
161161

162162
box-sizing: border-box;
@@ -202,7 +202,7 @@
202202

203203
.mangaFlow {
204204
touch-action: pan-y;
205-
grid-row-gap: calc(var(--scroll-mode-spacing) * 7px);
205+
row-gap: calc(var(--scroll-mode-spacing) * 7px);
206206
height: fit-content;
207207
}
208208

@@ -211,7 +211,7 @@
211211
overflow: hidden;
212212

213213
.mangaFlow {
214-
grid-column-gap: calc(var(--scroll-mode-spacing) * 7px);
214+
column-gap: calc(var(--scroll-mode-spacing) * 7px);
215215
align-items: start;
216216
height: 100%;
217217

src/components/Manga/components/EmptyTip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Component } from 'solid-js';
33
import { onAutoMount } from 'helper';
44

55
export const EmptyTip: Component = () => {
6-
let ref!: HTMLHeadingElement;
6+
let ref!: HTMLHeadingElement; // oxlint-disable-line no-unassigned-vars
77

88
onAutoMount(() => {
99
let timeoutId = 0;

src/components/Manga/components/EndPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const EndPage: Component = () => {
2828
focus();
2929
};
3030

31-
let ref!: HTMLDivElement;
31+
let ref!: HTMLDivElement; // oxlint-disable-line no-unassigned-vars
3232

3333
const [isDrag, setIsDrag] = createSignal(false);
3434
const [dragY, setDragY] = createSignal(0);

src/components/Manga/components/Scrollbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const Scrollbar: Component = () => {
6868
}
6969

7070
const tipList: string[] = [];
71-
for (let i = store.showRange[0]; i <= store.showRange[1]; i++)
71+
for (let [i] = store.showRange; i <= store.showRange[1]; i++)
7272
tipList.push(getPageTip(i));
7373

7474
if (isOnePageMode() || isDoubleMode()) return tipList.join('\n');

0 commit comments

Comments
 (0)