ソースを参照

fix: eslint-plugin-vue v8.0+ 模式下统一处理 lint 报 defineProps 未定义问题

tnt group 3 年 前
コミット
8b1c775178
1 ファイル変更9 行追加8 行削除
  1. 9 8
      .eslintrc.js

+ 9 - 8
.eslintrc.js

@@ -9,16 +9,17 @@ module.exports = {
     sourceType: 'module',
     ecmaFeatures: {
       jsx: true,
-      tsx: true,
-    },
+      tsx: true
+    }
   },
   env: {
     node: true,
+    // The Follow config only works with eslint-plugin-vue v8.0.0+
+    'vue/setup-compiler-macros': true
   },
-  extends: ["plugin:vue/vue3-essential", "eslint:recommended"],
+  extends: ['plugin:vue/vue3-essential', 'eslint:recommended'],
   rules: {
-    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
-    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
-  },
-};
-
+    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
+    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
+  }
+}