简体   繁体   English

在打字稿中启用react-hooks eslint插件。 tslint中没有插件

[英]enabling the react-hooks eslint plugin in typescript. no plugins in tslint

Am I correct in saying that it is not possible to use this eslint plugin with tslint? 我在说,这是不可能使用纠正这个 eslint与tslint插件?

I tried adding this to my tslint.json: 我尝试将其添加到我的tslint.json中:

"plugins": ["react-hooks"],
"rules: {
  "react-hooks/rules-of-hooks": "error",
  "react-hooks/exhaustive-deps": "warn",

But I see the following errors in the console: 但是我在控制台中看到以下错误:

Could not find implementations for the following rules specified in the configuration:
    react-hooks/rules-of-hooks
    react-hooks/exhaustive-deps

You can use the following library for nesting-react-hooks error. 您可以将以下库用于nesting-react-hooks错误。
https://github.com/Gelio/tslint-react-hooks https://github.com/Gelio/tslint-react-hooks
There is a PR pending from the same contributor in the core tslint repo. tslint核心仓库中有来自同一贡献者的PR待定。 For the exhaustive deps rule which was introduced recently i have asked the author to add it into the same repo but still waiting for the response. 对于最近引入的详尽的dep规则,我已要求作者将其添加到同一回购中,但仍在等待响应。 https://github.com/Gelio/tslint-react-hooks/issues/9 https://github.com/Gelio/tslint-react-hooks/issues/9

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 eslint-plugin-react-hooks 出现意外错误(react-hooks/exhaustive-deps) - eslint-plugin-react-hooks is giving unexpected errors (react-hooks/exhaustive-deps) Eslint 反应钩子/详尽的 derps 递归 - Eslint react-hooks/exhaustive derps recursion React Hooks react-hooks/exhaustive-deps eslint 规则似乎过于敏感 - React Hooks react-hooks/exhaustive-deps eslint rule seems overly sensitive 如何在React中使用钩子实现componentDidMount以使其符合EsLint规则“ react-hooks / exhaustive-deps”:“ warn”? - How to implement componentDidMount with hooks in React to be in line with the EsLint rule “react-hooks/exhaustive-deps”: “warn”? react-hooks/exhaustive-deps 的 TypeScript 错误 - TypeScript error for react-hooks/exhaustive-deps 如何将react-hooks,redux和打字稿结合在一起? - How to combine react-hooks, redux and typescript all together? 在响应中添加 useEffect 的正确方法来调用一次以满足 eslint react-hooks/exhaustive-deps? - Proper way to add useEffect in react to call once to satisfy eslint react-hooks/exhaustive-deps? 是否可以通过 useCallback 避免自定义 React Hook 上的“eslint(react-hooks/exhaustive-deps)”错误? - Is it possible to avoid 'eslint(react-hooks/exhaustive-deps)' error on custom React Hook with useCallback? React,ESLint:eslint-plugin-react-hooks 依赖于 object 中的 function - React, ESLint: eslint-plugin-react-hooks dependency on a function in an object 使用 Jest 和 @testing-library/react-hooks 在 TypeScript 中单元测试自定义 React Hook - Unit Testing Custom React Hooks in TypeScript using Jest and @testing-library/react-hooks
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM