DEV Community

Discussion on: How to setup a React.JS Project with TypeScript, ESLint and Prettier

Collapse
 
martincernyawin profile image
Martin Cerny • Edited

I had to add this to .eslintrc.js

    "import/extensions": [
       "error",
       "ignorePackages",
       {
         "js": "never",
         "jsx": "never",
         "ts": "never",
         "tsx": "never"
       }
    ],
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".ts", "tsx"] }],
Enter fullscreen mode Exit fullscreen mode

Any idea why you didn't need this?

Collapse
 
renatobentorocha profile image
Renato Rocha

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

Collapse
 
martincernyawin profile image
Martin Cerny

Thanks for updating the article! You should also add the other line jsx-filename-extension and then it also needs import resolver

Thread Thread
 
renatobentorocha profile image
Renato Rocha

Hi Martin,

Add the complete .eslint.rc.json like in: github.com/renatobentorocha/react_...

Thanks by observations :)