1

I'm getting a typescript error in a javascript file

enter image description here

  • It's a folder with only one javascript file, no nodejs or package.json.
  • I disabled the typescript extensions (tslint was not installed)
  • I checked my visual code settings JSON:
    "typescript.updateImportsOnFileMove.enabled": "always",   
    "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }
    
  • I disabled or installed prettier, but didn't change it
  • I have typescript Version 4.4.2 installed globally
1

1 Answer 1

1

In VS Code, press ctrl + shift + P (windows) or + shift + P (os x) to open command panel. Type Preferences: Open Settings(UI) to go to settings. (You can do the same with Preferences: Open Settings(JSON) if you want)

Search JavaScript: Validate and disable it. Like shown in the image

enable/disable JS validation

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

4 Comments

Genius, this works
@ObaApi If you think this answer helped you, please consider upvoting and accepting the answer. I see your profile, and you do not seem to accept or upvote answers, this will discourage users to answer your questions in the future.
I've upvoted! Thanks
@ObaApi As the asker, you have special privilege to mark an answer "correct" if it solves your problem. How to accept an answer. You should consider accepting other answers from the past because none of them seem to have an accepted answer.

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.