79756508

Date: 2025-09-05 07:42:05
Score: 1
Natty:
Report link

This is VSCode's Language Detection. Apparently more people are using TypeScript than JavaScript on average so it defaults to the former in a situation like this. Here's what you do to change the language manually (other than just giving the file a .js name as others have suggested):

In the bottom right corner of VSCode (same line as things like "Ln X, Col Y"), you will see it says "Typescript" (if your file is currently open). Click this and you can manually change it to Javascript

VSCode's language detection uses your history to help determine the most likely file type (if you look in settings this is History Based Language Detection). So once you do this manually once or twice I assume VSCode will start to guess Javascript over Typescript when you create new files.

If you prefer, it seems like your other option is to disable the setting altogether, which again is titled Language Detection in settings.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: TY Mathers