VUE-CLI3解决Missing file extension "vue" for "xxxx" (import/extensions)

  1. 安装 eslint-import-resolver-webpack
    yarn add eslint-import-resolver-webpack

  2. 在.eslintrc.js中加入

settings: {
    'import/resolver': {
      webpack: {
        config: 'node_modules/@vue/cli-service/webpack.config.js',
      },
    },
  },
rules: {
    'import/extensions': ['error', 'always', {
      'js': 'never',
      'vue': 'never'
    }]
  },

你可能感兴趣的:(VUE-CLI3解决Missing file extension "vue" for "xxxx" (import/extensions))