Skip to content

Commit

Permalink
chore(projects): add unocss eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Mar 11, 2024
1 parent 835cb4f commit 6f004ce
Show file tree
Hide file tree
Showing 28 changed files with 163 additions and 55 deletions.
9 changes: 8 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import { defineConfig } from '@soybeanjs/eslint-config';

export default defineConfig(
{ vue: true },
{ vue: true, unocss: true },
{
rules: {
'vue/multi-word-component-names': [
'warn',
{
ignores: ['index', 'App', '[id]']
}
],
'vue/component-name-in-template-casing': [
'warn',
'PascalCase',
{
ignores: ['/^icon-/']
}
]
}
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"@types/lodash-es": "4.17.12",
"@types/node": "20.11.25",
"@types/nprogress": "0.2.3",
"@unocss/eslint-config": "0.58.5",
"@unocss/preset-icons": "0.58.5",
"@unocss/preset-uno": "0.58.5",
"@unocss/transformer-directives": "0.58.5",
Expand Down
8 changes: 4 additions & 4 deletions packages/materials/src/libs/admin-layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function handleClickMask() {
<div class="relative h-full" :class="[commonClass]" :style="cssVars">
<div
:id="isWrapperScroll ? scrollElId : undefined"
class="flex flex-col h-full"
class="h-full flex flex-col"
:class="[commonClass, scrollWrapperClass, { 'overflow-y-auto': isWrapperScroll }]"
>
<!-- Header -->
Expand Down Expand Up @@ -182,7 +182,7 @@ function handleClickMask() {
<!-- Mobile Sider -->
<template v-if="showMobileSider">
<aside
class="absolute left-0 top-0 w-0 h-full bg-white"
class="absolute left-0 top-0 h-full w-0 bg-white"
:class="[
commonClass,
mobileSiderClass,
Expand All @@ -194,7 +194,7 @@ function handleClickMask() {
</aside>
<div
v-show="!siderCollapse"
class="absolute left-0 top-0 w-full h-full bg-[rgba(0,0,0,0.2)]"
class="absolute left-0 top-0 h-full w-full bg-[rgba(0,0,0,0.2)]"
:class="[style['layout-mobile-sider-mask']]"
@click="handleClickMask"
></div>
Expand All @@ -203,7 +203,7 @@ function handleClickMask() {
<!-- Main Content -->
<main
:id="isContentScroll ? scrollElId : undefined"
class="flex flex-col flex-grow"
class="flex flex-grow flex-col"
:class="[commonClass, contentClass, leftGapClass, { 'overflow-y-auto': isContentScroll }]"
>
<slot></slot>
Expand Down
2 changes: 1 addition & 1 deletion packages/materials/src/libs/page-tab/button-tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defineSlots<Slots>();

<template>
<div
class=":soy: relative inline-flex justify-center items-center gap-12px px-12px py-4px border-1px border-solid rounded-4px cursor-pointer whitespace-nowrap"
class=":soy: relative inline-flex cursor-pointer items-center justify-center gap-12px whitespace-nowrap border-1px rounded-4px border-solid px-12px py-4px"
:class="[
style['button-tab'],
{ [style['button-tab_dark']]: darkMode },
Expand Down
6 changes: 3 additions & 3 deletions packages/materials/src/libs/page-tab/chrome-tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ defineSlots<Slots>();

<template>
<div
class=":soy: relative inline-flex justify-center items-center gap-16px -mr-18px px-24px py-6px cursor-pointer whitespace-nowrap"
class=":soy: relative inline-flex cursor-pointer items-center justify-center gap-16px whitespace-nowrap px-24px py-6px -mr-18px"
:class="[
style['chrome-tab'],
{ [style['chrome-tab_dark']]: darkMode },
{ [style['chrome-tab_active']]: active },
{ [style['chrome-tab_active_dark']]: active && darkMode }
]"
>
<div class=":soy: absolute left-0 top-0 -z-1 w-full h-full pointer-events-none" :class="[style['chrome-tab__bg']]">
<div class=":soy: pointer-events-none absolute left-0 top-0 h-full w-full -z-1" :class="[style['chrome-tab__bg']]">
<ChromeTabBg />
</div>
<slot name="prefix"></slot>
<slot></slot>
<slot name="suffix"></slot>
<div class=":soy: absolute right-7px w-1px h-16px bg-#1f2225" :class="[style['chrome-tab-divider']]"></div>
<div class=":soy: absolute right-7px h-16px w-1px bg-#1f2225" :class="[style['chrome-tab-divider']]"></div>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion packages/materials/src/libs/page-tab/svg-close.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function handleClick() {

<template>
<div
class=":soy: relative inline-flex justify-center items-center w-16px h-16px text-14px rd-50%"
class=":soy: relative h-16px w-16px inline-flex items-center justify-center rd-50% text-14px"
@click.stop="handleClick"
>
<svg width="1em" height="1em" viewBox="0 0 1024 1024">
Expand Down
2 changes: 1 addition & 1 deletion packages/materials/src/libs/simple-scrollbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defineOptions({
</script>

<template>
<div class="flex-1-hidden h-full">
<div class="h-full flex-1-hidden">
<Simplebar class="h-full">
<slot />
</Simplebar>
Expand Down
110 changes: 105 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/common/exception-base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const icon = computed(() => iconMap[props.type]);
</script>

<template>
<div class="flex-vertical-center gap-24px min-h-520px size-full overflow-hidden">
<div class="size-full min-h-520px flex-vertical-center gap-24px overflow-hidden">
<div class="flex text-400px text-primary">
<SvgIcon :local-icon="icon" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/custom/look-forward.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ defineOptions({
</script>

<template>
<div class="flex-vertical-center gap-24px min-h-520px size-full overflow-hidden">
<div class="size-full min-h-520px flex-vertical-center gap-24px overflow-hidden">
<div class="flex text-400px text-primary">
<SvgIcon local-icon="expectation" />
</div>
<slot>
<h3 class="text-28px font-500 text-primary">{{ $t('common.lookForward') }}</h3>
<h3 class="text-28px text-primary font-500">{{ $t('common.lookForward') }}</h3>
</slot>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/custom/soybean-avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defineOptions({
</script>

<template>
<div class="size-72px rd-1/2 overflow-hidden">
<div class="size-72px overflow-hidden rd-1/2">
<img src="@/assets/imgs/soybean.jpg" class="size-full" />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/custom/wave-bg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const darkColor = computed(() => getColorPalette(props.themeColor, 6));
</g>
</svg>
</div>
<div class="absolute -left-200px -bottom-400px <sm:(-left-100px -bottom-760px)">
<div class="absolute -bottom-400px -left-200px <sm:(-bottom-760px -left-100px)">
<svg height="896" width="967.8852157128662">
<defs>
<path
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/modules/global-footer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defineOptions({
</script>

<template>
<DarkModeContainer class="flex-center h-full">
<DarkModeContainer class="h-full flex-center">
<a href="https://github.com/honghuangdc/soybean-admin/blob/main/LICENSE" target="_blank" rel="noopener noreferrer">
Copyright MIT © 2021 Soybean
</a>
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/modules/global-header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ const headerMenus = computed(() => {
</script>

<template>
<DarkModeContainer class="flex-y-center h-full shadow-header">
<DarkModeContainer class="h-full flex-y-center shadow-header">
<GlobalLogo v-if="showLogo" class="h-full" :style="{ width: themeStore.sider.width + 'px' }" />
<HorizontalMenu v-if="showMenu" mode="horizontal" :menus="headerMenus" class="px-12px" />
<div v-else class="flex-1-hidden flex-y-center h-full">
<div v-else class="h-full flex-y-center flex-1-hidden">
<MenuToggler v-if="showMenuToggler" :collapsed="appStore.siderCollapse" @click="appStore.toggleSiderCollapse" />
<GlobalBreadcrumb v-if="!appStore.isMobile" class="ml-12px" />
</div>
<div class="flex-y-center justify-end h-full">
<div class="h-full flex-y-center justify-end">
<FullScreen v-if="!appStore.isMobile" :full="isFullscreen" @click="toggle" />
<LangSwitch :lang="appStore.locale" :lang-options="appStore.localeOptions" @change-lang="appStore.changeLocale" />
<ThemeSchemaSwitch
Expand Down
Loading

0 comments on commit 6f004ce

Please sign in to comment.