Răsfoiți Sursa

feat: 增加eslint配置并修复

zhusiqing 3 ani în urmă
părinte
comite
e215031d0d

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
.eslintcache


+ 4 - 1
.eslintrc.js

@@ -23,5 +23,8 @@ module.exports = defineConfig({
     'plugin:vue/vue3-recommended',
     'plugin:@typescript-eslint/recommended'
   ],
-  rules: {},
+  rules: {
+    'vue/multi-word-component-names': 'off',
+    '@typescript-eslint/no-explicit-any': 'off'
+  },
 })

+ 24 - 0
.vscode/settings.json

@@ -0,0 +1,24 @@
+{
+  "typescript.tsdk": "./node_modules/typescript/lib",
+  "eslint.validate": [
+    "javascript",
+    "typescript",
+    "javascriptreact"
+],
+  "volar.tsPlugin": true,
+  "volar.tsPluginStatus": false,
+  "editor.tabSize": 2,
+  "eslint.format.enable": true,
+  "files.eol": "\n",
+  "path-intellisense.mappings": {
+    "@/": "${workspaceRoot}/src"
+  },
+  "editor.codeActionsOnSave": {
+    "source.fixAll.eslint": true,
+  },
+  "[vue]": {
+    "editor.codeActionsOnSave": {
+      "source.fixAll.eslint": false
+    }
+  },
+}

+ 7 - 0
CHANGELOG.md

@@ -7,3 +7,10 @@
 - 增加@的alias别名
 - 添加并封装vue-router,axios,pinia
 - 添加nprogress实现进度条
+
+## 0.2.0(2021-12-16)
+
+### Features
+
+- 添加eslint及相关插件并配置
+- 添加commitizen,cz-conventional-changelog,husky,lint-staged 优化git提交格式

+ 1 - 1
package.json

@@ -16,7 +16,7 @@
     }
   },
   "lint-staged": {
-    "*.{vue,js,ts}": [
+    "*.{vue,ts,tsx}": [
       "yarn lint",
       "git add"
     ]

+ 22 - 5
src/components/HelloWorld.vue

@@ -11,22 +11,39 @@ const count = ref(0)
 
   <p>
     Recommended IDE setup:
-    <a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
+    <a
+      href="https://code.visualstudio.com/"
+      target="_blank"
+    >VSCode</a>
     +
-    <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
+    <a
+      href="https://github.com/johnsoncodehk/volar"
+      target="_blank"
+    >Volar</a>
   </p>
 
   <p>See <code>README.md</code> for more information.</p>
 
   <p>
-    <a href="https://vitejs.dev/guide/features.html" target="_blank">
+    <a
+      href="https://vitejs.dev/guide/features.html"
+      target="_blank"
+    >
       Vite Docs
     </a>
     |
-    <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
+    <a
+      href="https://v3.vuejs.org/"
+      target="_blank"
+    >Vue 3 Docs</a>
   </p>
 
-  <button type="button" @click="count++">count is: {{ count }}</button>
+  <button
+    type="button"
+    @click="count++"
+  >
+    count is: {{ count }}
+  </button>
   <p>
     Edit
     <code>components/HelloWorld.vue</code> to test hot module replacement.

+ 7 - 2
src/layouts/app/Header.vue

@@ -1,7 +1,12 @@
 <template>
   <ul class="navs">
-    <li v-for="nav in navs" :key="nav.path">
-      <RouterLink :to="nav.path">{{nav.title}}</RouterLink>
+    <li
+      v-for="nav in navs"
+      :key="nav.path"
+    >
+      <RouterLink :to="nav.path">
+        {{ nav.title }}
+      </RouterLink>
     </li>
   </ul>
 </template>

+ 2 - 2
src/layouts/app/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <AppHeader></AppHeader>
-  <RouterView></RouterView>
+  <AppHeader />
+  <RouterView />
 </template>
 <script setup>
 import AppHeader from './Header.vue';

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff