fix: lint
parent
a850d426ef
commit
de0181e0d9
|
|
@ -39,7 +39,7 @@
|
|||
// lint && format
|
||||
"oxc.enable": true,
|
||||
"oxc.typeAware": true,
|
||||
"oxc.fmt.configPath": ".oxfmtrc.json",
|
||||
"oxc.fmt.configPath": "oxlint.config.ts",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.oxc": "explicit",
|
||||
"source.fixAll.stylelint": "explicit",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { readdirSync } from 'node:fs';
|
|||
import { join } from 'node:path';
|
||||
|
||||
export const rawPathRegexp =
|
||||
// eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/strict
|
||||
/^(.+?(?:\.([\da-z]+))?)(#[\w-]+)?(?: ?{(\d+(?:[,-]\d+)*)? ?(\S+)?})? ?(?:\[(.+)])?$/;
|
||||
|
||||
function rawPathToToken(rawPath: string) {
|
||||
|
|
|
|||
|
|
@ -182,7 +182,10 @@ function mergeRoutesByName(
|
|||
isString(route.name) &&
|
||||
routeMap.has(route.name as string)
|
||||
) {
|
||||
const existing = routeMap.get(route.name as string)!;
|
||||
const existing = routeMap.get(route.name as string);
|
||||
if (!existing) {
|
||||
continue;
|
||||
}
|
||||
const existingChildren = existing.children ?? [];
|
||||
const routeChildren = route.children ?? [];
|
||||
|
||||
|
|
|
|||
|
|
@ -84,12 +84,12 @@ function handleDragBarMove(data: SliderRotateVerifyPassingData) {
|
|||
state.dragging = true;
|
||||
const { imageSize, maxDegree } = props;
|
||||
const { moveX } = data;
|
||||
const denominator = imageSize!;
|
||||
const denominator = imageSize;
|
||||
if (denominator === 0) {
|
||||
return;
|
||||
}
|
||||
const currentRotate = Math.ceil(
|
||||
(moveX / denominator) * 1.5 * maxDegree! * unref(getFactorRef),
|
||||
(moveX / denominator) * 1.5 * maxDegree * unref(getFactorRef),
|
||||
);
|
||||
state.currentRotate = currentRotate;
|
||||
setImgRotate(state.randomRotate - currentRotate);
|
||||
|
|
@ -98,7 +98,7 @@ function handleDragBarMove(data: SliderRotateVerifyPassingData) {
|
|||
function handleImgOnLoad() {
|
||||
const { maxDegree, minDegree } = props;
|
||||
const ranRotate = Math.floor(
|
||||
minDegree! + Math.random() * (maxDegree! - minDegree!),
|
||||
minDegree + Math.random() * (maxDegree - minDegree),
|
||||
); // 生成随机角度
|
||||
state.randomRotate = ranRotate;
|
||||
setImgRotate(ranRotate);
|
||||
|
|
|
|||
|
|
@ -50,8 +50,15 @@ import { extendsDefaultFormatter } from './extends';
|
|||
// 是否加载过
|
||||
let isInit = false;
|
||||
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
export let useTableForm: typeof useVbenForm;
|
||||
let tableFormFactory: typeof useVbenForm | undefined;
|
||||
|
||||
export const useTableForm: typeof useVbenForm = ((...args) => {
|
||||
if (!tableFormFactory) {
|
||||
throw new Error('useTableForm is not initialized');
|
||||
}
|
||||
|
||||
return tableFormFactory(...args);
|
||||
}) as typeof useVbenForm;
|
||||
|
||||
// 部分组件,如果没注册,vxe-table 会报错,这里实际没用组件,只是为了不报错,同时可以减少打包体积
|
||||
const createVirtualComponent = (name = '') => {
|
||||
|
|
@ -104,7 +111,7 @@ export function setupVbenVxeTable(setupOptions: SetupVxeTable) {
|
|||
const { configVxeTable, useVbenForm } = setupOptions;
|
||||
|
||||
initVxeTable();
|
||||
useTableForm = useVbenForm;
|
||||
tableFormFactory = useVbenForm;
|
||||
|
||||
const { isDark, locale } = usePreferences();
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ export async function initStores(app: App, options: InitStoreOptions) {
|
|||
encodingType: 'aes',
|
||||
encryptionSecret: import.meta.env.VITE_APP_STORE_SECURE_KEY,
|
||||
isCompression: true,
|
||||
// @ts-ignore secure-ls does not have a type definition for this
|
||||
metaKey: `${namespace}-secure-meta`,
|
||||
});
|
||||
pinia.use(
|
||||
|
|
|
|||
Loading…
Reference in New Issue