zhuangyunsheng 2 недель назад
Родитель
Сommit
580c39da0a
5 измененных файлов с 33 добавлено и 32 удалено
  1. 1 1
      .editorconfig
  2. 0 1
      .eslintignore
  3. 27 0
      .eslintrc.cjs
  4. 2 4
      babel.config.js
  5. 3 26
      package.json

+ 1 - 1
.editorconfig

@@ -9,4 +9,4 @@ insert_final_newline = true
 trim_trailing_whitespace = true
 
 [*.md]
-trim_trailing_whitespace = false
+trim_trailing_whitespace = false

+ 0 - 1
.eslintignore

@@ -1 +0,0 @@
-src/assets/js

+ 27 - 0
.eslintrc.cjs

@@ -0,0 +1,27 @@
+module.exports = {
+    root: true,
+    env: {
+        node: true,
+        browser: true,
+        es2021: true
+    },
+    parser: "vue-eslint-parser", // 兼容 Vue 模板
+    parserOptions: {
+        parser: "@babel/eslint-parser", // 兼容现代 JS 语法
+        ecmaVersion: "latest", // 解析 ES2021 + 新语法
+        sourceType: "module", // 解析前端的 import/export 语法
+        babelOptions: {
+            configFile: "./babel.config.js" 
+        }
+    },
+    extends: [
+        "plugin:vue/vue3-essential"
+    ],
+    rules: {
+        indent: 0,
+        "no-tabs": 0,
+        "no-mixed-spaces-and-tabs": 0,
+        "vue/no-unused-components": 0,
+        "vue/multi-word-component-names": 0
+    }
+}

+ 2 - 4
babel.config.js

@@ -1,5 +1,3 @@
 module.exports = {
-  presets: [
-    '@vue/cli-plugin-babel/preset'
-  ]
-}
+    presets: ["@vue/cli-plugin-babel/preset"]
+}

+ 3 - 26
package.json

@@ -20,38 +20,15 @@
         "vuex": "4.1.0"
     },
     "devDependencies": {
-        "@babel/core": "^7.24.4",
+        "@babel/core": "7.21.0",
         "@babel/eslint-parser": "7.19.1",
         "@vue/cli-plugin-babel": "5.0.8",
         "@vue/cli-plugin-eslint": "5.0.8",
         "@vue/cli-service": "5.0.8",
         "eslint": "8.35.0",
         "eslint-plugin-vue": "9.9.0",
-        "sass": "1.58.3",
-        "sass-loader": "10.1.1"
-    },
-    "eslintConfig": {
-        "root": true,
-        "env": {
-            "node": true
-        },
-        "globals": {
-            "APP_CONFIG": true
-        },
-        "extends": [
-            "plugin:vue/vue3-essential",
-            "eslint:recommended"
-        ],
-        "parserOptions": {
-            "parser": "@babel/eslint-parser"
-        },
-        "rules": {
-            "indent": 0,
-            "no-tabs": 0,
-            "no-mixed-spaces-and-tabs": 0,
-            "vue/no-unused-components": 0,
-            "vue/multi-word-component-names": 0
-        }
+        "sass": "^1.69.5",
+        "sass-loader": "^12.6.0"
     },
     "browserslist": [
         "> 1%",