Skip to content

Commit

Permalink
fix: add @antfu/eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
fxzer committed Jan 4, 2024
1 parent a7ca8f8 commit 288a59a
Show file tree
Hide file tree
Showing 94 changed files with 7,039 additions and 5,006 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ on:
# 任务
jobs:
build-and-deploy:
runs-on: ubuntu-latest #部署运行环境搭建
runs-on: ubuntu-latest # 部署运行环境搭建
steps:
- name: Checkout 🛎️
uses: actions/checkout@main
with:
persist-credentials: false
fetch-depth: 0 #github代码拉取深度
fetch-depth: 0 # github代码拉取深度
- name: Setup Node 🎬
uses: actions/setup-node@main
with:
node-version: "lts/*"
- name: Build 🔧
node-version: 'lts/*'
- name: Build 🔧
run: |
yarn
yarn run build
Expand Down Expand Up @@ -51,20 +51,20 @@ jobs:
# source-repo: '[email protected]:fxzer/zerdocs.git'
# # 注意替换为你的 Gitee 目标仓库地址
# destination-repo: '[email protected]:fxzer/zerdocs.git'

# - name: ✅ Build Gitee Pages #触发Gitee自动部署
# uses: yanglbme/gitee-pages-action@master
# with:
# # 注意替换为你的 Gitee 用户名
# gitee-username: fxzer
# # 注意在 Settings->Secrets 配置 GITEE_PASSWORD
# gitee-password: ${{ secrets.GITEE_PASSWORD }}
# # 注意替换为你的 Gitee 仓库
# # 注意替换为你的 Gitee 仓库
# # 坑点:https://gitee.com/fxzer/zerdocs -->则填:fxzer/zerdocs,注意仓库名和路径名不一致问题
# gitee-repo: fxzer/zerdocs
# gitee-repo: fxzer/zerdocs
# # 要部署的分支
# branch: gh-pages

# - name: Deploy 🚀 #把打包后的dist文件部署到master分支
# uses: JamesIves/[email protected]
# with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ node_modules
docs/.vitepress/cache
docs/.vitepress/dist
dist
.vscode
components.d.ts
.idea
# local env files
Expand Down
43 changes: 43 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml"
]
}
7 changes: 4 additions & 3 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const express = require('express');
const app = express();
const express = require('express')

const app = express()
app.use(express.static('../dist'))
module.exports = app;
module.exports = app
8 changes: 4 additions & 4 deletions docs/.vitepress/theme/UnoCSSLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { isDark } = useData()
function enableTransitions() {
return 'startViewTransition' in document
&& window.matchMedia('(prefers-reduced-motion: no-preference)').matches
&& window.matchMedia('(prefers-reduced-motion: no-preference)').matches
}
provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
Expand All @@ -18,8 +18,8 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
const clipPath = [
`circle(0px at ${x}px ${y}px)`,
`circle(${Math.hypot(
Math.max(x, innerWidth - x),
Math.max(y, innerHeight - y),
Math.max(x, innerWidth - x),
Math.max(y, innerHeight - y),
)}px at ${x}px ${y}px)`,
]
Expand All @@ -40,5 +40,5 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
</script>

<template>
<DefaultTheme.Layout/>
<DefaultTheme.Layout />
</template>
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/DemoWrap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const URL = `${GITHUB_BLOB_URL}${demoPath.value}`
<style scoped lang="scss">
.demo {
font-size: 14px;
background: rgba(125, 125, 125, .04);
background: rgba(125, 125, 125, 0.04);
padding: 1em;
position: relative;
margin-bottom: 10px;
Expand Down
19 changes: 10 additions & 9 deletions docs/.vitepress/theme/components/Loading.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<template>
<script setup lang='ts'>
</script>

<template>
<div class="loader">
<div></div>
<div></div>
<div></div>
<div></div>
<div />
<div />
<div />
<div />
</div>
</template>
<script setup lang='ts'>

</script>
<style scoped lang='scss'>
.loader {
/* 相对定位 */
position: relative;
color: #A886F2;
color: #a886f2;
width: 60px;
height: 60px;
}
Expand Down Expand Up @@ -111,4 +112,4 @@
opacity: 0;
}
}
</style>
</style>
64 changes: 29 additions & 35 deletions docs/.vitepress/theme/components/RegisterSW.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import { onBeforeMount, ref } from 'vue'
const offlineReady = ref(false)
const onOfflineReady = () => {
function onOfflineReady() {
offlineReady.value = true
}
const close = async () => {
async function close() {
offlineReady.value = false
}
Expand All @@ -26,47 +26,41 @@ onBeforeMount(async () => {

<template>
<template v-if="offlineReady">
<div
class="pwa-toast"
role="alertdialog"
aria-labelledby="pwa-message"
>
<div class="pwa-toast" role="alertdialog" aria-labelledby="pwa-message">
<div id="pwa-message" class="mb-3">
App ready to work offline
</div>
<button
type="button"
class="pwa-cancel"
@click="close"
>
<button type="button" class="pwa-cancel" @click="close">
Close
</button>
</div>
</template>
</template>

<style>
.pwa-toast {
position: fixed;
right: 0;
bottom: 0;
margin: 16px;
padding: 12px;
border: 1px solid #8885;
border-radius: 4px;
z-index: 100;
text-align: left;
box-shadow: 3px 4px 5px 0 #8885;
background-color: white;
}
.pwa-toast #pwa-message {
margin-bottom: 8px;
}
.pwa-toast button {
border: 1px solid #8885;
outline: none;
margin-right: 5px;
border-radius: 2px;
padding: 3px 10px;
}
.pwa-toast {
position: fixed;
right: 0;
bottom: 0;
margin: 16px;
padding: 12px;
border: 1px solid #8885;
border-radius: 4px;
z-index: 100;
text-align: left;
box-shadow: 3px 4px 5px 0 #8885;
background-color: white;
}
.pwa-toast #pwa-message {
margin-bottom: 8px;
}
.pwa-toast button {
border: 1px solid #8885;
outline: none;
margin-right: 5px;
border-radius: 2px;
padding: 3px 10px;
}
</style>
44 changes: 22 additions & 22 deletions docs/.vitepress/theme/components/ReloadPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,26 @@ onBeforeMount(async () => {
<style>
.pwa-toast {
position: fixed;
right: 0;
bottom: 0;
margin: 16px;
padding: 12px;
border: 1px solid #8885;
border-radius: 4px;
z-index: 100;
text-align: left;
box-shadow: 3px 4px 5px 0 #8885;
background-color: white;
}
.pwa-toast #pwa-message {
margin-bottom: 8px;
}
.pwa-toast button {
border: 1px solid #8885;
outline: none;
margin-right: 5px;
border-radius: 2px;
padding: 3px 10px;
}
position: fixed;
right: 0;
bottom: 0;
margin: 16px;
padding: 12px;
border: 1px solid #8885;
border-radius: 4px;
z-index: 100;
text-align: left;
box-shadow: 3px 4px 5px 0 #8885;
background-color: white;
}
.pwa-toast #pwa-message {
margin-bottom: 8px;
}
.pwa-toast button {
border: 1px solid #8885;
outline: none;
margin-right: 5px;
border-radius: 2px;
padding: 3px 10px;
}
</style>
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/components/ToolItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $gradient-color: linear-gradient(120deg, #bd34fe, var(--vp-c-brand-light));
margin: 0 15px 5px 15px;
border: 1px solid #eee;
border-radius: 8px;
transition: all .2s ease-in-out;
transition: all 0.2s ease-in-out;
&:hover {
border: 1px solid var(--vp-c-green);
Expand All @@ -70,7 +70,7 @@ $gradient-color: linear-gradient(120deg, #bd34fe, var(--vp-c-brand-light));
text-overflow: ellipsis;
white-space: nowrap;
margin: 0;
transition: all .2s ease-in-out;
transition: all 0.2s ease-in-out;
color: transparent;
background: $gradient-color;
background-clip: text;
Expand Down
14 changes: 8 additions & 6 deletions docs/.vitepress/theme/components/ToolWrap.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<template>
<script setup lang='ts'>
import toolGroup from './toolGroup'
</script>

<template>
<div class="tool-wrap">
<template v-for="(group, key) in toolGroup" :key="key">
<div class="tool-group-title">{{ key }}</div>
<div class="tool-group-title">
{{ key }}
</div>
<div class="tool-group">
<ToolItem v-for="(tool, index) in group" :key="index" :tool="tool" />
</div>
</template>
</div>
</template>
<script setup lang='ts'>
import toolGroup from './toolGroup'

</script>
<style scoped lang='scss'>
.tool-wrap {
.tool-group-title {
font-size: 20px;
font-weight: 600;
padding: 20px 15px 10px;
color:var(--vp-c-brand-light);
color: var(--vp-c-brand-light);
}
.tool-group {
Expand Down
Loading

0 comments on commit 288a59a

Please sign in to comment.