JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

eslint提示 xxx should be listed in the project's dependencies

发布时间 2023-10-25 14:03:36作者: 青云码上
有时候手动安装了一个npm包A,npm包A里面包含了npm包B,这时候如果
import xxx from 'npm包B';

eslint会报错,提示 npm包B 不在 package.json 里面

 解决方法:在 eslintrc.js 增加配置

module.exports = {
  rules: {
    'import/no-extraneous-dependencies': [
      0,
      {
        devDependencies: true,
        peerDependencies: true
        // optionalDependencies: true,
        // bundledDependencies: true
      }
    ]
  }
};

 

 

    本栏目推荐文章
  • IDEA项目名称后面出现中括号,模块Modules的名子和文件夹名称不同,可以右键修改名称也可以在File->Project Structure 修改Modules的Name(快捷键ctrl+Shift+Alt+s)
  • python经典有序序列的list列表推导式
  • Arrays.asList生成不可变list
  • ts 文件 eslint - disable no-var
  • C#中的List<T>和Dictionary<TKey, TValue>的底层原理
  • mybatis向xml文件传递list参数
  • python基础之list、tuple、dict、set
  • vue报错:You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file.
  • 获取直播间的最新评论 - python 取两个list的差集
  • C# 将string转list,将list转string
    dependencies project eslint should listeddependencies project eslint should should eslint should field empty not gopath exists should but model physics should desogn 规则eslint 前端eslint dependency dependent
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们