javascript - 未找到规则“react-hooks/exhaustive-deps”的定义
问题描述
// eslint-disable-next-line react-hooks/exhaustive-deps
添加我的代码后,我收到以下 eslint 错误。
8:14 找不到规则“react-hooks/exhaustive-deps”的错误定义
我参考了这篇文章来解决这个问题,但提到的解决方案在我的情况下不起作用。任何线索如何抑制这个eslint错误?
PS我正在结合使用standardjs。
解决方案
这通常是因为插件配置react-hooks
中缺少.eslintrc
插件。确保您已react-hooks
按以下示例添加:
"plugins": ["react", "react-hooks",],
推荐阅读
- c# - Log4Net 正在创建文件但未写入文件
- php - Laravel 中带属性的最小值和最大值
- node.js - 我的 express.js hello world 和 Docker 设置有什么问题?
- java - 在 IntelliJ Idea 中用静态导入替换常量的导入
- python - 使用 try 作为条件会导致问题吗?
- typescript - 打字稿编译器出错:sprite_loading 类型中不存在 forEach 属性
- python - Django将记录添加到manytomany字段
- php - 在 PHP 中获取 X-robots-tag
- python - 使用 \U 符号调试打印 Unicode 字符串
- xpath - 如何根据前一个 div 中的文本抓取 div 的内容