Skip to content

Commit

Permalink
chore: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nexmoe committed Apr 26, 2024
1 parent c21f55d commit ec73a25
Show file tree
Hide file tree
Showing 12 changed files with 621 additions and 891 deletions.
15 changes: 8 additions & 7 deletions components/module/Image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const text = computed(() => extractTextFromHTML(props.module.content))
</script>

<template>
<div class="module shu-card p-3 space-y-4 flex flex-col justify-between">
<div class="module shu-card p-3 gap-1 flex flex-col justify-between">
<div class="space-y-4">
<div class="flex flex-row items-center pt-1 gap-2 px-2">
<div class="flex flex-row items-center pt-1 gap-2 px-2.5">
<div class="w-5 h-5 block rounded-full overflow-hidden">
<LinkIcon :url="props.module.url" />
</div>
Expand All @@ -34,13 +34,11 @@ const text = computed(() => extractTextFromHTML(props.module.content))
/>
</div>
</div>
<div class="space-y-4 px-3 pb-3">
<h3 v-if="!flow?.configNoTitle" class="font-bold text-2xl tracking-tight text-black">
<div class="space-y-4 px-3 pb-3 pt-0">
<h3 v-if="!flow?.configNoTitle" class="card-title font-bold text-2xl tracking-tight text-black">
{{ props.module.title }}
</h3>
<div v-if="!flow?.configNoContent && text !== ' '" class="line-clamp-3">
<div v-html="text" />
</div>
<div v-if="!flow?.configNoContent && text !== ' '" class="line-clamp-3" v-html="text" />
<div
v-if="!props.module.image || (props.module.platform?.length || 0) > 1"
class="flex flex-row items-center gap-1"
Expand Down Expand Up @@ -69,4 +67,7 @@ const text = computed(() => extractTextFromHTML(props.module.content))
.card :deep(iframe) {
max-width: 100%;
}
.card-title {
font-family: Noto Serif SC;
}
</style>
8 changes: 0 additions & 8 deletions eslint.config.js

This file was deleted.

19 changes: 19 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt(
// your custom flat configs go here, for example:

Check failure on line 4 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces
// {

Check failure on line 5 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces
// files: ['**/*.ts', '**/*.tsx'],

Check failure on line 6 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces
// rules: {

Check failure on line 7 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces
// 'no-console': 'off' // allow console.log in TypeScript files

Check failure on line 8 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces
// }

Check failure on line 9 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces
// },

Check failure on line 10 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces
// {

Check failure on line 11 in eslint.config.mjs

View workflow job for this annotation

GitHub Actions / testCodebase

Expected indentation of 1 tab but found 4 spaces
// ...
// }
{

ignores: ['dist', '**/dist/**', 'public', '**/public/**', 'auto-imports.d.ts', '**/auto-imports.d.ts/**', 'components.d.ts', '**/components.d.ts/**', '.output', '**/.output/**', 'node_modules', '**/node_modules/**', 'components/ui', '**/components/ui/**'],

}
)
3 changes: 2 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ useHead({
</script>

<template>
<!-- <div class="nexmoe-bg" /> -->
<div>
<PublicHeader />
<slot />
<LazyPublicTool />
<LazyPublicFooter v-once />
</div>
</template>

<style>
Expand Down
13 changes: 11 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,17 @@ export default defineNuxtConfig({
'@nuxtjs/html-validator',
'@nuxtjs/web-vitals',
'nuxt-gtag',
"@nuxt/eslint"
],

eslint: {
config: {
stylistic: {
indent: 'tab',
}
}
},

shadcn: {
/**
* Prefix for all the imported component
Expand Down Expand Up @@ -102,7 +111,7 @@ export default defineNuxtConfig({
// 'sns-webpic-qc.xhscdn.com',
// 'cdn.dribbble.com',
// 'picx.zhimg.com',
// 'img.zcool.cn',
'img.zcool.cn',
],
},

Expand Down Expand Up @@ -132,4 +141,4 @@ export default defineNuxtConfig({
enabled: true,
},
},
})
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@antfu/eslint-config": "^2.13.3",
"@faker-js/faker": "^8.4.1",
"@nuxt/eslint": "^0.3.10",
"@nuxt/test-utils": "^3.12.0",
"@nuxtjs/google-fonts": "^3.2.0",
"@nuxtjs/html-validator": "^1.7.2",
Expand Down
2 changes: 1 addition & 1 deletion pages/space/_[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ provide('flows', flows)
<Flow v-if="flow.module.length > 0" v-bind="{ flow }" />
</template>
</UContainer>
<IndexTool />
<IndexFooter />
</div>
</div>
<IndexTool />
</template>

<style scoped>
Expand Down
1,423 changes: 565 additions & 858 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions server/api/module/[id].get.ts

This file was deleted.

13 changes: 12 additions & 1 deletion server/flowing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,20 @@ async function upsert(ele: NModule, flowId: string) {
},
})

// 如果找到已存在的模块,则打印信息并返回
// 如果找到已存在的模块,则打印信息并更新
if (res) {
consola.info(`Exists: ${ele.title}`)
await prisma.module.update({
where: {
id: res.id,
},
data: {
title: ele.title,
content: ele.content,
image: ele.image,
date: ele.date,
},
})
return
}

Expand Down
2 changes: 1 addition & 1 deletion server/middleware/update-site-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default eventHandler(async (e) => {
const caller = appRouter.createCaller({ prisma: e.context.prisma })

const config = await caller.config.get()
// eslint-disable-next-line no-console
console.log(config.siteName)
// updateSiteConfig({
// name: config.siteName,
Expand Down
2 changes: 1 addition & 1 deletion server/trpc/routers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import defaultData from '~/config/hero.json'
interface PrismaConfigItem {
key: keyof Config
value?: string
json?: any
json?: unknown
}

interface Config {
Expand Down

0 comments on commit ec73a25

Please sign in to comment.