add eslint

This commit is contained in:
Jeffrey Hsu 2025-01-13 21:22:28 +08:00
parent fb109cd9ba
commit 9418fcb155
4 changed files with 2445 additions and 1183 deletions

5
eslint.config.mjs Normal file
View File

@ -0,0 +1,5 @@
import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt({
files: ['**/*.ts', '**/*.tsx']
})

View File

@ -1,9 +1,12 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
// see https://blog.csdn.net/m0_53022813/article/details/137379480
import eslintPlugin from "vite-plugin-eslint";
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: ['@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt', '@nuxt/image'],
modules: ['@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt', '@nuxt/image', '@nuxt/eslint'],
app: {
head: {
title: 'CANTYONION.SITE',
@ -34,6 +37,11 @@ export default defineNuxtConfig({
transpile: ['@fortawesome/vue-fontawesome', 'vue3-typed-js', 'pinia-plugin-persistedstate']
},
vite: {
plugins: [
eslintPlugin({
include: ['**/*.ts', '**/*.vue']
})
],
css: {
preprocessorOptions: {
scss: {
@ -50,5 +58,10 @@ export default defineNuxtConfig({
},
devServer: {
host: '0.0.0.0'
},
eslint: {
config: {
stylistic: true
}
}
})

View File

@ -30,11 +30,20 @@
"vue3-typed-js": "^0.0.1"
},
"devDependencies": {
"@eslint/js": "^9.18.0",
"@nuxt/eslint": "^0.7.5",
"@types/markdown-it": "^14.1.2",
"autoprefixer": "^10.4.20",
"eslint": "^9.18.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-vue": "^9.32.0",
"globals": "^15.14.0",
"postcss": "^8.4.49",
"sass-embedded": "^1.81.0",
"tailwindcss": "^3.4.15"
"tailwindcss": "^3.4.5",
"typescript": "^5.7.3",
"typescript-eslint": "^8.19.1",
"vite-plugin-eslint": "^1.8.1"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

3597
yarn.lock

File diff suppressed because it is too large Load Diff