Skip to content

Commit 97ebfc4

Browse files
committed
feat: add @nuxt/eslint
1 parent bf55774 commit 97ebfc4

File tree

11 files changed

+7990
-5455
lines changed

11 files changed

+7990
-5455
lines changed

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"eslint.useFlatConfig": true,
3+
4+
// Auto fix
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": "explicit",
7+
"source.organizeImports": "never"
8+
}
9+
}

components/NuxtLogo.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
<path
1010
fill="currentColor"
1111
d="M82.5623 18.5705h7.3017l15.474 24.7415V18.5705h6.741v35.0576h-7.252L89.3025 28.938v24.6901h-6.7402V18.5705ZM142.207 53.628h-6.282v-3.916c-1.429 2.7559-4.339 4.3076-8.015 4.3076-5.822 0-9.603-4.1069-9.603-10.0175V28.3847h6.282v14.3251c0 3.4558 2.146 5.8592 5.362 5.8592 3.524 0 5.974-2.7044 5.974-6.4099V28.3847h6.282V53.628ZM164.064 53.2289l-6.026-8.4144-6.027 8.4144h-6.69l9.296-13.1723-8.58-12.0709h6.843l5.158 7.2641 5.106-7.2641h6.895l-8.632 12.0709 9.295 13.1723h-6.638ZM183.469 20.7726v7.6116h7.149v5.1593h-7.149v12.5311c0 .4208.17.8245.473 1.1223.303.2978.715.4654 1.144.4661h5.532v5.9547h-4.137c-5.617 0-9.293-3.2062-9.293-8.8109V33.5484h-5.056v-5.1642h3.172c1.479 0 2.34-.8639 2.34-2.2932v-5.3184h5.825Z"
12-
></path>
12+
/>
1313
<path
1414
fill-rule="evenodd"
1515
clip-rule="evenodd"
1616
d="M30.1185 11.5456c-1.8853-3.24168-6.5987-3.24169-8.484 0L1.08737 46.8747c-1.885324 3.2417.47133 7.2938 4.24199 7.2938H21.3695c-1.6112-1.4081-2.2079-3.8441-.9886-5.9341l15.5615-26.675-5.8239-10.0138Z"
1717
fill="#80EEC0"
18-
></path>
18+
/>
1919
<path
2020
d="M43.1374 19.2952c1.5603-2.6523 5.461-2.6523 7.0212 0l17.0045 28.9057c1.5603 2.6522-.39 5.9676-3.5106 5.9676h-34.009c-3.1206 0-5.0709-3.3154-3.5106-5.9676l17.0045-28.9057ZM209.174 53.8005H198.483c0-1.8514.067-3.4526 0-6.0213h10.641c1.868 0 3.353.1001 4.354-.934 1-1.0341 1.501-2.3351 1.501-3.9029 0-1.8347-.667-3.2191-2.002-4.1532-1.301-.9674-2.985-1.4511-5.054-1.4511h-2.601v-5.2539h2.652c1.701 0 3.119-.4003 4.253-1.2009 1.134-.8006 1.701-1.9849 1.701-3.5527 0-1.301-.434-2.3351-1.301-3.1023-.834-.8007-2.001-1.201-3.503-1.201-1.634 0-2.918.4837-3.853 1.4511-.9.9674-1.401 2.1517-1.501 3.5527h-6.254c.133-3.2358 1.251-5.7877 3.352-7.6558 2.135-1.868 4.887-2.8021 8.256-2.8021 2.402 0 4.42.4337 6.055 1.301 1.668.834 2.919 1.9515 3.753 3.3525.867 1.4011 1.301 2.9523 1.301 4.6536 0 1.9681-.551 3.636-1.651 5.0037-1.068 1.3344-2.402 2.235-4.004 2.7021 1.969.4003 3.57 1.3677 4.804 2.9022 1.234 1.5011 1.852 3.4025 1.852 5.7043 0 1.9347-.468 3.7028-1.402 5.304-.934 1.6012-2.301 2.8855-4.103 3.8529-1.768.9674-3.953 1.4511-6.555 1.4511Z"
2121
fill="#00DC82"
22-
></path>
22+
/>
2323
</g>
2424
<defs>
25-
<clipPath id="a"><path fill="#fff" d="M0 0h221v65H0z"></path></clipPath>
25+
<clipPath id="a"><path fill="#fff" d="M0 0h221v65H0z"/></clipPath>
2626
</defs>
2727
</svg>
2828
</template>
File renamed without changes.

components/Examples.vue renamed to components/TheExamples.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ const colorMode = computed({
1212
});
1313
</script>
1414

15-
1615
<template>
1716
<ClientOnly>
18-
<el-switch v-model="colorMode" inline-prompt active-text="dark" inactive-text="light" size="large"></el-switch>
17+
<el-switch v-model="colorMode" inline-prompt active-text="dark" inactive-text="light" size="large"/>
1918
</ClientOnly>
2019

21-
<br />
20+
<br >
2221

2322
<el-dropdown class="m-4" type="primary">
2423
<el-button type="primary">
@@ -38,17 +37,17 @@ const colorMode = computed({
3837
</template>
3938
</el-dropdown>
4039

41-
<br />
40+
<br >
4241

4342
<el-button :icon="ElIconView" class="m-4" @click="hello">Hello</el-button>
4443
<el-button class="m-4" type="primary" @click="hello">Hello</el-button>
4544
<el-button class="m-4" type="success" @click="helloSuccess">Hello</el-button>
4645

47-
<br />
46+
<br >
4847

49-
<Counter class="m-4" />
48+
<TheCounter class="m-4" />
5049

51-
<br />
50+
<br >
5251

5352
<el-icon class="cursor-pointer">
5453
<el-icon-grape />
@@ -60,7 +59,7 @@ const colorMode = computed({
6059
<ElIconIceDrink />
6160
</el-icon>
6261

63-
<br />
62+
<br >
6463

6564
<el-config-provider :locale="zhCn">
6665
<el-date-picker

components/Logos.vue renamed to components/TheLogos.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<img
77
class="logo"
88
src="https://element-plus.org/images/element-plus-logo.svg"
9-
/>
9+
>
1010
<el-icon><ElIconPlus /></el-icon>
1111
<NuxtLogo class="logo" />
1212
</div>

eslint.config.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import withNuxt from './.nuxt/eslint.config.mjs'
2+
3+
// https://eslint.nuxt.com/packages/module
4+
export default withNuxt(
5+
// your custom flat configs go here, for example:
6+
// {
7+
// files: ['**/*.ts', '**/*.tsx'],
8+
// rules: {
9+
// 'no-console': 'off' // allow console.log in TypeScript files
10+
// }
11+
// },
12+
// {
13+
// ...
14+
// }
15+
)

nuxt.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default defineNuxtConfig({
2626

2727
// build modules
2828
modules: [
29+
'@nuxt/eslint',
2930
'@vueuse/nuxt',
3031
'@unocss/nuxt',
3132
'@pinia/nuxt',
@@ -50,18 +51,23 @@ export default defineNuxtConfig({
5051
scale: 1.2,
5152
},
5253
},
54+
5355
vite: {
5456
css: {
5557
preprocessorOptions: {
5658
scss: {
59+
api: 'modern-compiler',
5760
additionalData: `@use "@/assets/scss/element/index.scss" as element;`,
5861
},
5962
},
6063
},
6164
},
65+
6266
elementPlus: {
6367
icon: 'ElIcon',
6468
importStyle: 'scss',
6569
themes: ['dark'],
6670
},
71+
72+
compatibilityDate: '2024-11-23',
6773
})

package.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "element-plus-nuxt-starter",
3-
"packageManager": "pnpm@8.12.1",
3+
"packageManager": "pnpm@9.14.2",
44
"version": "0.1.0",
55
"description": "Element Plus with Nuxt 3 Minimal Starter",
66
"repository": {
@@ -14,25 +14,29 @@
1414
"preinstall": "npx only-allow pnpm",
1515
"dev": "nuxi dev",
1616
"build": "nuxi build",
17+
"lint": "eslint .",
18+
"lint:fix": "eslint . --fix",
1719
"preview": "nuxi preview",
1820
"start": "node .output/server/index.mjs",
1921
"generate": "nuxi generate",
20-
"postinstall": "nuxi prepare"
22+
"prepare": "nuxi prepare"
2123
},
2224
"dependencies": {
2325
"@element-plus/icons-vue": "^2.3.1",
24-
"element-plus": "^2.4.4"
26+
"element-plus": "^2.8.8"
2527
},
2628
"devDependencies": {
27-
"@element-plus/nuxt": "^1.0.7",
28-
"@nuxtjs/color-mode": "^3.3.2",
29-
"@pinia/nuxt": "^0.5.1",
30-
"@unocss/nuxt": "^0.58.0",
31-
"@vueuse/nuxt": "^10.7.0",
29+
"@element-plus/nuxt": "^1.1.0",
30+
"@nuxt/eslint": "^0.7.1",
31+
"@nuxtjs/color-mode": "^3.5.2",
32+
"@pinia/nuxt": "^0.7.0",
33+
"@unocss/nuxt": "^0.64.1",
34+
"@vueuse/nuxt": "^11.3.0",
3235
"consola": "^3.2.3",
33-
"nuxt": "^3.8.2",
34-
"sass": "^1.69.5",
35-
"typescript": "^5.3.3"
36+
"eslint": "^9.15.0",
37+
"nuxt": "^3.14.1592",
38+
"sass": "^1.81.0",
39+
"typescript": "^5.6.3"
3640
},
3741
"peerDependencies": {
3842
"pinia": "^2.1.6"

pages/hi/[id].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ watchEffect(() => {
2424
</ul>
2525
</template>
2626

27-
<Counter />
27+
<TheCounter />
2828

2929
<div>
3030
<NuxtLink to="/">Back</NuxtLink>

pages/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="page-index">
3-
<Logos />
4-
<Examples />
3+
<TheLogos />
4+
<TheExamples />
55
</div>
66
</template>
77

0 commit comments

Comments
 (0)