M
M
miliko mikoyan2019-03-03 17:26:51
typescript
miliko mikoyan, 2019-03-03 17:26:51

Does tslint-react-hooks work with react-app my-app --typescript?

i install react-app my-app --typescript and tslint-react-hooks but tslint-react-hooks don't work, i wrote code that shouldn't work but i don't get any error. I should have gotten 4 lines of error that cannot be declared by response.hooks if

import  React,{ useState} from 'react';

const  App = () => {
  if(true){var [X, setX] = useState(0);}

  console.log(X);
    return (
      <div>
       {X}
      </div>
    );
  }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Filippov, 2019-03-03
@miliko0022

Install, installed, and connected in the linter settings ?

{
  "extends": [
    // your other plugins...
    "tslint-react-hooks"
  ],
  "rules": {
    // your other rules...
    "react-hooks-nesting": "error"
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question