During the software development proccess is important keeping the code well organized and readable, following a development quality standard that w...
For further actions, you may consider blocking this person and/or reporting abuse
I had to add this to
.eslintrc.js
Any idea why you didn't need this?
I Martin Cerny, thanks by observation.
I had added this line also. This can be saw in shared source code at the end of post, but i forgot to add in example.
I will add this line.
Best regards
Thanks for updating the article! You should also add the other line jsx-filename-extension and then it also needs import resolver
Hi Martin,
Add the complete .eslint.rc.json like in: github.com/renatobentorocha/react_...
Thanks by observations :)
Why are these rules set?
Hi Sean!
"@typescript-eslint/explicit-function-return-type": "off", -> disable the requirement of a return type in functions.
"@typescript-eslint/no-unused-vars": "off" -> disable alert about unused vars.
Best regards
But... isn't
--typescript
flag available for create-react-app?Please correct eslint initialization. It says
yarn eslint --int
but has to beyarn eslint --init
Hi Carlos, thanks a lot by the comment.
When we use the create-react-app with the flag "--template typescript",
what happens is that, some packages for typescript will be installed and also
will be created a tsconfig.js file. But, all other configurations will not be created.
Another thing that happens, is that, all the packages that we need only in development
environment, will be setting as production on package.json file. That is,
create-react-app template do not separe production and development packages.
I will correct "yarn eslint --int".
Thanks for all observations.
Thanks, this is an extensive guide! I have few doubts.. any specific reason to choose "@typescript-eslint/parser" over "babel-eslint"? and why should we include "airbnb" in eslint "extends"?
Hi JerryGoyal! Thanks by comments!
We need a parser to convert TypeScript into an ESTree-compatible form for ESLint; eslint.org/docs/user-guide/configu...
Airbnb has some ESLint rules, but we can use other like, github.com/google/eslint-config-go..., or none.
Best regards
Great post, thank you so much. Saved me a lot of pain
Hi bandrewfisher, thanks by comment.
I'm very happy to be able to help you.
Best regards