refactor: 使用eslint.config.js替换.eslintrc.js并遵循esm语法 (#786)

This commit is contained in:
xiaoming
2023-11-10 23:18:01 +08:00
committed by GitHub
parent 18158f8e0d
commit 5b7dd8c3e2
102 changed files with 431 additions and 424 deletions

View File

@@ -50,6 +50,12 @@ const getSectionStyle = computed(() => {
});
const transitionMain = defineComponent({
props: {
route: {
type: undefined,
required: true
}
},
render() {
const transitionName =
transitions.value(this.route)?.name || "fade-transform";
@@ -72,12 +78,6 @@ const transitionMain = defineComponent({
default: () => [this.$slots.default()]
}
);
},
props: {
route: {
type: undefined,
required: true
}
}
});
</script>
@@ -118,8 +118,8 @@ const transitionMain = defineComponent({
/>
</keep-alive>
<component
v-else
:is="Component"
v-else
:key="route.fullPath"
class="main-content"
/>
@@ -140,8 +140,8 @@ const transitionMain = defineComponent({
/>
</keep-alive>
<component
v-else
:is="Component"
v-else
:key="route.fullPath"
class="main-content"
/>

View File

@@ -62,8 +62,8 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
@click="translationCh"
>
<IconifyIconOffline
class="check-zh"
v-show="locale === 'zh'"
class="check-zh"
:icon="Check"
/>
简体中文
@@ -73,7 +73,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
:class="['dark:!text-white', getDropdownItemClass(locale, 'en')]"
@click="translationEn"
>
<span class="check-en" v-show="locale === 'en'">
<span v-show="locale === 'en'" class="check-en">
<IconifyIconOffline :icon="Check" />
</span>
English

View File

@@ -23,8 +23,8 @@ notices.value.map(v => (noticesNum.value += v.list.length));
<template #dropdown>
<el-dropdown-menu>
<el-tabs
:stretch="true"
v-model="activeKey"
:stretch="true"
class="dropdown-tabs"
:style="{ width: notices.length === 0 ? '200px' : '330px' }"
>

View File

@@ -15,8 +15,8 @@ const props = defineProps({
<div v-if="props.list.length">
<NoticeItem
v-for="(item, index) in props.list"
:noticeItem="item"
:key="index"
:noticeItem="item"
/>
</div>
<el-empty v-else description="暂无数据" />

View File

@@ -146,9 +146,9 @@ onKeyStroke("ArrowDown", handleDown);
<template>
<el-dialog
v-model="show"
top="5vh"
class="pure-search-dialog"
v-model="show"
:show-close="false"
:width="device === 'mobile' ? '80vw' : '40vw'"
:before-close="handleClose"
@@ -161,8 +161,8 @@ onKeyStroke("ArrowDown", handleDown);
>
<el-input
ref="inputRef"
size="large"
v-model="keyword"
size="large"
clearable
placeholder="搜索菜单(中文模式下支持拼音搜索)"
@input="handleSearch"

View File

@@ -254,8 +254,8 @@ onBeforeMount(() => {
popper-class="pure-tooltip"
>
<li
:class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
ref="verticalRef"
:class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
@click="setLayoutModel('vertical')"
>
<div />
@@ -272,8 +272,8 @@ onBeforeMount(() => {
popper-class="pure-tooltip"
>
<li
:class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
ref="horizontalRef"
:class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
@click="setLayoutModel('horizontal')"
>
<div />
@@ -290,8 +290,8 @@ onBeforeMount(() => {
popper-class="pure-tooltip"
>
<li
:class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
ref="mixRef"
:class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
@click="setLayoutModel('mix')"
>
<div />
@@ -304,8 +304,8 @@ onBeforeMount(() => {
<ul class="theme-color">
<li
v-for="(item, index) in themeColors"
:key="index"
v-show="showThemeColors(item.themeColor)"
:key="index"
:style="getThemeColorStyle(item.color)"
@click="setLayoutThemeColor(item.themeColor)"
>

View File

@@ -108,9 +108,9 @@ watch(
<el-breadcrumb class="!leading-[50px] select-none" separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item
class="!inline !items-stretch"
v-for="item in levelList"
:key="item.path"
class="!inline !items-stretch"
>
<a @click.prevent="handleLink(item)">
{{ transformI18n(item.meta.title) }}

View File

@@ -48,8 +48,8 @@ nextTick(() => {
<span>{{ title }}</span>
</div>
<el-menu
router
ref="menuRef"
router
mode="horizontal"
class="horizontal-header-menu"
:default-active="defaultActive"
@@ -78,7 +78,7 @@ nextTick(() => {
:class="['dark:!text-white', getDropdownItemClass(locale, 'zh')]"
@click="translationCh"
>
<span class="check-zh" v-show="locale === 'zh'">
<span v-show="locale === 'zh'" class="check-zh">
<IconifyIconOffline :icon="Check" />
</span>
简体中文
@@ -88,7 +88,7 @@ nextTick(() => {
:class="['dark:!text-white', getDropdownItemClass(locale, 'en')]"
@click="translationEn"
>
<span class="check-en" v-show="locale === 'en'">
<span v-show="locale === 'en'" class="check-en">
<IconifyIconOffline :icon="Check" />
</span>
English

View File

@@ -61,12 +61,12 @@ watch(
<template>
<div
v-if="device !== 'mobile'"
class="horizontal-header"
v-loading="usePermissionStoreHook().wholeMenus.length === 0"
class="horizontal-header"
>
<el-menu
router
ref="menuRef"
router
mode="horizontal"
class="horizontal-header-menu"
:default-active="defaultActive"
@@ -111,7 +111,7 @@ watch(
:class="['dark:!text-white', getDropdownItemClass(locale, 'zh')]"
@click="translationCh"
>
<span class="check-zh" v-show="locale === 'zh'">
<span v-show="locale === 'zh'" class="check-zh">
<IconifyIconOffline :icon="Check" />
</span>
简体中文
@@ -121,7 +121,7 @@ watch(
:class="['dark:!text-white', getDropdownItemClass(locale, 'en')]"
@click="translationEn"
>
<span class="check-en" v-show="locale === 'en'">
<span v-show="locale === 'en'" class="check-en">
<IconifyIconOffline :icon="Check" />
</span>
English

View File

@@ -275,7 +275,6 @@ function resolvePath(routePath) {
{{ transformI18n(props.item.meta.title) }}
</span>
<div
:style="getSubMenuDivStyle(props.item)"
v-if="
!(
isCollapse &&
@@ -283,6 +282,7 @@ function resolvePath(routePath) {
props.item.parentId === null
)
"
:style="getSubMenuDivStyle(props.item)"
>
<el-tooltip
v-if="layout !== 'horizontal'"

View File

@@ -518,15 +518,15 @@ onBeforeUnmount(() => {
</script>
<template>
<div ref="containerDom" class="tags-view" v-if="!showTags">
<div v-if="!showTags" ref="containerDom" class="tags-view">
<span v-show="isShowArrow" class="arrow-left">
<IconifyIconOffline :icon="ArrowLeftSLine" @click="handleScroll(200)" />
</span>
<div ref="scrollbarDom" class="scroll-container">
<div class="tab select-none" ref="tabDom" :style="getTabStyle">
<div ref="tabDom" class="tab select-none" :style="getTabStyle">
<div
:ref="'dynamic' + index"
v-for="(item, index) in multiTags"
:ref="'dynamic' + index"
:key="index"
:class="['scroll-item is-closable', linkIsActive(item)]"
@contextmenu.prevent="openMenu(item, $event)"
@@ -550,8 +550,8 @@ onBeforeUnmount(() => {
<IconifyIconOffline :icon="CloseBold" />
</span>
<div
:ref="'schedule' + index"
v-if="showModel !== 'card'"
:ref="'schedule' + index"
:class="[scheduleIsActive(item)]"
/>
</div>

View File

@@ -46,11 +46,11 @@ onMounted(() => {
<template>
<div
class="frame"
v-loading="loading"
class="frame"
:element-loading-text="t('status.hsLoad')"
>
<iframe :src="frameSrc" class="frame-iframe" ref="frameRef" />
<iframe ref="frameRef" :src="frameSrc" class="frame-iframe" />
</div>
</template>

View File

@@ -1,8 +1,8 @@
import { ref } from "vue";
import { getConfig } from "@/config";
import { useLayout } from "./useLayout";
import { themeColorsType } from "../types";
import { useGlobal } from "@pureadmin/utils";
import type { themeColorsType } from "../types";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import {
darken,

View File

@@ -2,10 +2,10 @@ import { storeToRefs } from "pinia";
import { getConfig } from "@/config";
import { useRouter } from "vue-router";
import { emitter } from "@/utils/mitt";
import { routeMetaType } from "../types";
import userAvatar from "@/assets/user.jpg";
import { getTopMenu } from "@/router/utils";
import { useGlobal } from "@pureadmin/utils";
import type { routeMetaType } from "../types";
import { transformI18n } from "@/plugins/i18n";
import { router, remainingPaths } from "@/router";
import { computed, type CSSProperties } from "vue";

View File

@@ -4,10 +4,10 @@ import {
computed,
reactive,
onMounted,
CSSProperties,
type CSSProperties,
getCurrentInstance
} from "vue";
import { tagsViewsType } from "../types";
import type { tagsViewsType } from "../types";
import { useRoute, useRouter } from "vue-router";
import { transformI18n, $t } from "@/plugins/i18n";
import { responsiveStorageNameSpace } from "@/config";

View File

@@ -2,7 +2,7 @@
* @description ⚠️:此文件仅供主题插件使用,请不要在此文件中导出别的工具函数(仅在页面加载前运行)
*/
import { type multipleScopeVarsOptions } from "@pureadmin/theme";
import type { multipleScopeVarsOptions } from "@pureadmin/theme";
/** 预设主题色 */
const themeColors = {