摘要: 有时候手动安装了一个npm包A,npm包A里面包含了npm包B,这时候如果 import xxx from 'npm包B'; eslint会报错,提示 npm包B 不在 package.json 里面 解决方法:在 eslintrc.js 增加配置 module.exports = { rules: 阅读全文
posted @ 2023-10-25 13:56 青云码上 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 第一步 npm i eslint-import-resolver-alias -D 第二步:在 eslintrc.js 配置 module.exports = { settings: { 'import/resolver': { alias: { map: [ // 这里参照webpack的别名配置 阅读全文
posted @ 2023-10-25 13:49 青云码上 阅读(141) 评论(0) 推荐(0) 编辑