You can add additional extensions to the JavaScript in Settings (Preferences on Mac) | File Types.
See also Settings | Template Data Languages where you can configure certain files in the project as templates producing specified language to get proper code completion.