diff --git a/index.js b/index.js index 77ea06c..3c7a83a 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,7 @@ module.exports = { }, extends: [ "airbnb", + "airbnb/hooks", "plugin:@typescript-eslint/recommended", "prettier", "prettier/react", diff --git a/test/sample.tsx b/test/sample.tsx index 35db0ba..80e47b2 100644 --- a/test/sample.tsx +++ b/test/sample.tsx @@ -13,7 +13,21 @@ const ComponentWithProps: FC = ({ name, age }) => (

); +const ComponentWithHooks = () => { + const [count, setCount] = React.useState(0); + React.useEffect(() => { + const n = count + 1; + setCount(n); + }, [count]); + return ( + + ); +}; + export default { Component, - ComponentWithProps + ComponentWithProps, + ComponentWithHooks };