Closed femiveys closed 2 years ago
When using this module in a React with Typescript problem you get an error with no-use-before-define in every file you use the React import.
no-use-before-define
React
'React' was used before it was defined. (eslint/no-use-before-define)
This can be fixed by re-enabling the @typescript-eslint/no-use-before-define that you disabled. Why did you disable this useful rule?
@typescript-eslint/no-use-before-define
So in .eslintrc.json add:
.eslintrc.json
"rules": { "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": ["error"] }
I disabled it because it's not actually useful in my experience - order in JS is fairly intuitive once you understand it and enforcing specific ordering can be left up to individuals. It also intriduces
When using this module in a React with Typescript problem you get an error with
no-use-before-define
in every file you use theReact
import.'React' was used before it was defined. (eslint/no-use-before-define)
This can be fixed by re-enabling the
@typescript-eslint/no-use-before-define
that you disabled. Why did you disable this useful rule?So in
.eslintrc.json
add: