From b41bea585a65ffae5445a885b74a4105dca8a910 Mon Sep 17 00:00:00 2001 From: yupi <592789970@qq.com> Date: Sat, 14 May 2022 01:20:37 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B7=BB=E5=8A=A0=20eslint=20=E5=92=8C?= =?UTF-8?q?=20prettier=20update=20UI=20=E5=BA=93=E7=94=B1=20tDesign=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20Ant=20Design=20Vue=EF=BC=88=E4=B8=BB?= =?UTF-8?q?=E8=A6=81=E6=98=AF=E5=9B=A0=E4=B8=BA=E5=89=8D=E8=80=85=E5=92=8C?= =?UTF-8?q?=20Vite=20=E7=83=AD=E6=9B=B4=E6=96=B0=E4=B8=8D=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 17 +++++ .gitignore | 1 + package.json | 16 ++++- src/App.vue | 169 ++++++++++++++++++++++++++------------------- src/main.ts | 13 ++-- tsconfig.json | 18 ++++- tsconfig.node.json | 4 +- vite.config.ts | 12 ++-- 8 files changed, 162 insertions(+), 88 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..35ed473 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + env: { + browser: true, + es2021: true, + node: true, + }, + extends: ["plugin:vue/essential", "plugin:prettier/recommended"], + parserOptions: { + ecmaVersion: "latest", + parser: "@typescript-eslint/parser", + sourceType: "module", + }, + plugins: ["vue", "@typescript-eslint", "prettier"], + rules: { + "prettier/prettier": "error", + }, +}; diff --git a/.gitignore b/.gitignore index a547bf3..cf5f7b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Logs logs *.log +package-lock.json npm-debug.log* yarn-debug.log* yarn-error.log* diff --git a/package.json b/package.json index 444c6e3..57dcdd8 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,32 @@ { "name": "sql-generator", "private": true, - "version": "0.0.0", + "version": "0.0.1", "scripts": { "dev": "vite", "build": "vue-tsc --noEmit && vite build", "preview": "vite preview" }, "dependencies": { + "@ant-design/icons-vue": "^6.1.0", + "ant-design-vue": "^3.2.3", "monaco-editor": "^0.33.0", "sql-formatter": "^4.0.2", - "tdesign-vue-next": "^0.14.1", "vue": "^3.2.25" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.23.0", + "@typescript-eslint/parser": "^5.23.0", "@vitejs/plugin-vue": "^2.3.1", + "eslint": "^8.15.0", + "eslint-config-prettier": "^8.5.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-n": "^15.2.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-promise": "^6.0.0", + "eslint-plugin-vue": "^8.7.1", + "prettier": "2.6.2", "typescript": "^4.5.4", "vite": "^2.9.7", "vue-tsc": "^0.34.7" diff --git a/src/App.vue b/src/App.vue index 9c92ba4..57b7bc9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,73 +1,83 @@ + \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 7beac30..103fc5f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,7 @@ -import { createApp } from 'vue'; -import TDesign from 'tdesign-vue-next'; -import App from './app.vue'; - -// 引入组件库全局样式资源 -import 'tdesign-vue-next/es/style/index.css'; +import { createApp } from "vue"; +import App from "./App.vue"; +import Antd from "ant-design-vue"; +import "ant-design-vue/dist/antd.css"; const app = createApp(App); -app.use(TDesign); -app.mount('#app'); \ No newline at end of file +app.use(Antd).mount("#app"); diff --git a/tsconfig.json b/tsconfig.json index bcc4abd..6a55dc8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,9 +10,21 @@ "resolveJsonModule": true, "isolatedModules": true, "esModuleInterop": true, - "lib": ["esnext", "dom"], + "lib": [ + "esnext", + "dom" + ], "skipLibCheck": true }, - "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], - "references": [{ "path": "./tsconfig.node.json" }] + "include": [ + "src/**/*.ts", + "src/**/*.d.ts", + "src/**/*.tsx", + "src/**/*.vue" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] } diff --git a/tsconfig.node.json b/tsconfig.node.json index e993792..fe87409 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -4,5 +4,7 @@ "module": "esnext", "moduleResolution": "node" }, - "include": ["vite.config.ts"] + "include": [ + "vite.config.ts" + ] } diff --git a/vite.config.ts b/vite.config.ts index 315212d..d4a6446 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,11 @@ -import { defineConfig } from 'vite' -import vue from '@vitejs/plugin-vue' +import { defineConfig } from "vite"; +import vue from "@vitejs/plugin-vue"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()] -}) + server: { + open: true, + hmr: true, + }, + plugins: [vue()], +});