Browse Source

Signed-off-by: caner <5658514@qq.com>

caner 3 years ago
parent
commit
9d5fb76705
8 changed files with 46 additions and 14 deletions
  1. 8 5
      .eslintrc.js
  2. 6 0
      .vs/VSWorkspaceState.json
  3. BIN
      .vs/slnx.sqlite
  4. 2 2
      package.json
  5. 4 2
      src/pages/index/App.vue
  6. 16 3
      tsconfig.json
  7. 9 0
      tsconfig.node.json
  8. 1 2
      vite.config.ts

+ 8 - 5
.eslintrc.js

@@ -1,12 +1,15 @@
 module.exports = {
   root: true,
   env: {
+    node: true,
     browser: true,
     es2021: true
   },
   parserOptions: {
     ecmaVersion: 12,
-    parser: '@typescript-eslint/parser'
+    parser: '@typescript-eslint/parser',
+    sourceType: "module",
+    requireConfigFile: false
   },
   extends: [
     'plugin:vue/vue3-recommended',
@@ -14,13 +17,13 @@ module.exports = {
   ],
   rules: {
     'no-console': 0, // 禁用打印
-    'comma-dangle': [ 2, 'never' ], // 禁止使用拖尾逗号
+    'comma-dangle': [2, 'never'], // 禁止使用拖尾逗号
     'no-extra-semi': 2, // 禁止不必要的分号
-    'array-bracket-spacing': [ 2, 'always' ], // 指定数组的元素之间要以空格隔开
+    'array-bracket-spacing': [2, 'always'], // 指定数组的元素之间要以空格隔开
     'jsx-quotes': 0, // 强制使用单引号
     'max-len': 0, // 强制一行的最大长度
-    semi: [ 2, 'never' ], // 禁止使用分号
-    'linebreak-style': [ 0, 'error', 'windows' ],
+    semi: [2, 'never'], // 禁止使用分号
+    'linebreak-style': [0, 'error', 'windows'],
     'import/no-unresolved': 0,
     'import/extensions': 0,
     'import/no-absolute-path': 0,

+ 6 - 0
.vs/VSWorkspaceState.json

@@ -0,0 +1,6 @@
+{
+  "ExpandedNodes": [
+    ""
+  ],
+  "PreviewInSolutionExplorer": false
+}

BIN
.vs/slnx.sqlite


+ 2 - 2
package.json

@@ -2,6 +2,7 @@
   "name": "vite-project",
   "private": true,
   "version": "0.0.0",
+  "type": "module",
   "scripts": {
     "dev": "vite",
     "build": "vue-tsc --noEmit && vite build",
@@ -10,13 +11,13 @@
   "dependencies": {
     "axios": "^0.27.2",
     "js-md5": "^0.7.3",
+    "naive-ui": "^2.32.1",
     "pinia": "^2.0.18",
     "vue": "^3.2.37",
     "vue-router": "^4.1.3",
     "xlsx": "^0.18.5"
   },
   "devDependencies": {
-    "@types/node": "^18.7.1",
     "@typescript-eslint/parser": "^5.33.0",
     "@vitejs/plugin-vue": "^3.0.2",
     "eslint": "^8.21.0",
@@ -26,7 +27,6 @@
     "less": "^4.1.3",
     "typescript": "^4.6.4",
     "vite": "^3.0.6",
-    "vite-plugin-eslint": "^1.8.0",
     "vue-tsc": "^0.39.5"
   }
 }

+ 4 - 2
src/pages/index/App.vue

@@ -5,12 +5,14 @@
 <script setup lang='ts'>
 import loading from '@/components/loading.vue'
 import useStore from './store/index'
-import { computed } from 'vue'
+import { computed, ref } from 'vue'
 const store = useStore()
 const show = computed(() => store.loading)
+const a = ref(0)
 </script>
 <style>
-html,body{
+html,
+body {
   margin: 0;
   padding: 0;
 }

+ 16 - 3
tsconfig.json

@@ -10,8 +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", "src/utils/*.js"]
-}
+  "include": [
+    "src/**/*.ts",
+    "src/**/*.d.ts",
+    "src/**/*.tsx",
+    "src/**/*.vue"
+  ],
+  "references": [
+    {
+      "path": "./tsconfig.node.json"
+    }
+  ]
+}

+ 9 - 0
tsconfig.node.json

@@ -0,0 +1,9 @@
+{
+  "compilerOptions": {
+    "composite": true,
+    "module": "ESNext",
+    "moduleResolution": "Node",
+    "allowSyntheticDefaultImports": true
+  },
+  "include": ["vite.config.ts"]
+}

+ 1 - 2
vite.config.ts

@@ -1,6 +1,5 @@
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
-import eslint from 'vite-plugin-eslint'
 import path from 'path'
 
 // https://vitejs.dev/config/
@@ -15,7 +14,7 @@ export default defineConfig({
       '@': path.resolve(__dirname, './src')
     }
   },
-  plugins: [vue(), eslint({ fix: true })],
+  plugins: [vue()],
   server: {
     host: 'localhost',
     port: 6547,