perf: 新包使用更严格的eslint

This commit is contained in:
vben
2023-04-06 23:28:37 +08:00
parent 762e5dee14
commit 6890dd7201
20 changed files with 99 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ['@vben'],
extends: ['@vben/eslint-config/strict'],
};

View File

@@ -1,5 +1,4 @@
export * from './onMountedOrActivated';
export * from './useAttrs';
export * from './useRefs';
export { useTimeoutFn } from '@vueuse/core';

View File

@@ -1,5 +1,5 @@
import { type AnyFunction } from '@vben/types';
import { nextTick, onMounted, onActivated } from 'vue';
import { nextTick, onActivated, onMounted } from 'vue';
/**
* 在 OnMounted 或者 OnActivated 时触发

View File

@@ -1,5 +1,5 @@
import { getCurrentInstance, reactive, shallowRef, watchEffect } from 'vue';
import { type Recordable } from '@vben/types';
import { getCurrentInstance, reactive, shallowRef, watchEffect } from 'vue';
interface Options {
excludeListeners?: boolean;

View File

@@ -1,5 +1,5 @@
import type { Ref } from 'vue';
import { ref, onBeforeUpdate } from 'vue';
import { onBeforeUpdate, ref } from 'vue';
export function useRefs(): [Ref<HTMLElement[]>, (index: number) => (el: HTMLElement) => void] {
const refs = ref([]) as Ref<HTMLElement[]>;

View File

@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ['@vben'],
extends: ['@vben/eslint-config/strict'],
};

View File

@@ -31,9 +31,9 @@ type Recordable<T> = Record<string, T>;
/**
* 字符串类型对象(只读)
*/
type ReadonlyRecordable<T = any> = {
interface ReadonlyRecordable<T = any> {
readonly [key: string]: T;
};
}
/**
* setTimeout 返回值类型
@@ -47,12 +47,12 @@ type IntervalHandle = ReturnType<typeof setInterval>;
export {
type AnyFunction,
type AnyPromiseFunction,
type AnyNormalFunction,
type Nullable,
type NonNullable,
type Recordable,
type ReadonlyRecordable,
type TimeoutHandle,
type AnyPromiseFunction,
type IntervalHandle,
type NonNullable,
type Nullable,
type ReadonlyRecordable,
type Recordable,
type TimeoutHandle,
};