Webstorm not recognising JavaScript file

So I see three possible reasons for the problem:

  1. The file was marked as ‘Plain text’

  2. There is a pattern for ‘Text files’ file type that matches this file (or back: file type ‘JavaScript’ exclude this file name). See image below

enter image description here

  1. There is a custom plugin that overrides default behavior for files with this name (unlikely)

Updated: after several years I’ve found one more reason for the behavior and most likely it the main source of the issues. When you create a file without any extensions the “Register New File Type Association” is appeared. And you can accidentally specify a new file type, for some file name. It is can be fixed with (2) but it is the reason why the pattern was added there.

Register New File Type Association

Note: the solution works for all IDEA-based IDEs: IntelliJ IDEA, WebStorm, RubyMine, PyCharm, PhpStorm.

Leave a Comment