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'
}]
},
网友评论