فهرست منبع

feat: 新增commitlint

奔跑的面条 3 سال پیش
والد
کامیت
6edbb7c8a7
6فایلهای تغییر یافته به همراه647 افزوده شده و 4 حذف شده
  1. 3 0
      .commitlintrc.js
  2. 0 1
      .gitignore
  3. 4 0
      .husky/commit-msg
  4. 6 1
      package.json
  5. 632 0
      pnpm-lock.yaml
  6. 2 2
      prettier.config.js

+ 3 - 0
.commitlintrc.js

@@ -0,0 +1,3 @@
+module.exports = {
+  extends: ["@commitlint/config-conventional"]
+};

+ 0 - 1
.gitignore

@@ -2,4 +2,3 @@ node_modules
 .DS_Store
 dist
 dist-ssr
-*.local

+ 4 - 0
.husky/commit-msg

@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+npx --no-install commitlint -e 

+ 6 - 1
package.json

@@ -4,7 +4,8 @@
   "scripts": {
     "dev": "vite --host",
     "build": "vue-tsc --noEmit && vite build",
-    "new": "plop --plopfile ./plop/plopfile.js"
+    "new": "plop --plopfile ./plop/plopfile.js",
+    "postinstall": "husky install"
   },
   "dependencies": {
     "@types/color": "^3.0.3",
@@ -30,6 +31,8 @@
     "vuedraggable": "^4.1.0"
   },
   "devDependencies": {
+    "@commitlint/cli": "^17.0.2",
+    "@commitlint/config-conventional": "^17.0.2",
     "@types/node": "^16.11.26",
     "@typescript-eslint/eslint-plugin": "^5.18.0",
     "@typescript-eslint/parser": "^5.18.0",
@@ -39,6 +42,7 @@
     "@vitejs/plugin-vue-jsx": "^1.3.9",
     "@vue/compiler-sfc": "^3.2.31",
     "@vueuse/core": "^7.7.1",
+    "commitlint": "^17.0.2",
     "default-passive-events": "^2.0.0",
     "echarts": "^5.3.2",
     "eslint": "^8.12.0",
@@ -46,6 +50,7 @@
     "eslint-plugin-import": "^2.26.0",
     "eslint-plugin-prettier": "^4.0.0",
     "eslint-plugin-vue": "^8.5.0",
+    "husky": "^8.0.1",
     "lodash": "~4.17.21",
     "mockjs": "^1.1.0",
     "plop": "^3.0.5",

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 632 - 0
pnpm-lock.yaml


+ 2 - 2
prettier.config.js

@@ -1,10 +1,10 @@
 module.exports = {
-  printWidth: 80,
+  printWidth: 120,
   tabWidth: 2,
   useTabs: false,
   singleQuote: true,
   semi: false,
-  trailingComma: "es5",
+  trailingComma: "none",
   bracketSpacing: true,
   jsxSingleQuote: true,
   jsxBracketSameLine: false,

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است