1

I have created a react native project with the following command. VS Code gives about 200 ts errors in the Problems section but I am able to compile with tsc.

npx react-native init MyApp --template react-native-template-typescript

Any idea why VS Code is doing like this? Thanks

1
  • do you have eslint installed and enabled? try npm remove -g eslint and also check your extensions Commented May 1, 2020 at 22:58

1 Answer 1

1

do you have eslint installed and enabled?

try npm remove -g eslint and also check your extensions

I am suspecting that you have an incompatible linting extension.


another reason might be vscode identifies *.ts as typescript files and *.tsx as typescript react files. when you open file check bottom right corner of the vscode to see how the file is interpreted.

Sign up to request clarification or add additional context in comments.

2 Comments

eslint is not installed globally or locally. I disabled the extensions TSLint, ESLint and Flow. I check right-bottom and it was 'Typescript' then I updated it to 'Typescript react'. But App.tsx errors have not gone. When I create another tsx file I see that there is no error.
Weird, after I refresh VS code, errors in app.tsx have gone. So now, I will try to investigate what the source of these errors. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.