首页 > 其他分享 >解决vue3自动引入element-plus后eslint警告

解决vue3自动引入element-plus后eslint警告

时间:2023-05-26 10:25:39浏览次数:49  
标签:... auto eslintrc element json eslint vue3 import

配置vue.config.js

...
...
module.exports = defineConfig({
  ...
  ...
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
        eslintrc: {
          enabled: true,
          filepath: "./.eslintrc-auto-import.json",
          globalsPropValue: true
        }
      }),
      Components({
        resolvers: [ElementPlusResolver()]
      })
    ]
  }
});

添加.eslintrc-auto-import.json

{
  "globals": {}
}

配置.eslintrc

{
  ...
  "extends": [
    ...
    "./.eslintrc-auto-import.json"
  ]
}

标签:...,auto,eslintrc,element,json,eslint,vue3,import
From: https://www.cnblogs.com/tdyp/p/17433960.html

相关文章