feat: 添加 eslint-plugin-unicorn 依赖,更新 ESLint 配置以支持新规则
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
const structuredClone = window.structuredClone || ((obj) => JSON.parse(JSON.stringify(obj)));
|
||||
// eslint-disable-next-line unicorn/prefer-structured-clone
|
||||
const structuredClone = globalThis.structuredClone || ((object) => JSON.parse(JSON.stringify(object)));
|
||||
|
||||
const K_INITIAL_STATE = deepFreeze({
|
||||
complete: false,
|
||||
@ -51,7 +52,7 @@ async function loadMore() {
|
||||
}
|
||||
});
|
||||
const data = await response.json();
|
||||
state.list = state.list.concat(data);
|
||||
state.list = [...state.list, ...data];
|
||||
if ($__DEV__) await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
state.complete = state.list.length >= 5;
|
||||
} catch (error) {
|
||||
|
Reference in New Issue
Block a user