mark
mark

Reputation: 62784

How to make IntelliJ IDEA auto inject 'use strict'; to each new JavaScript file I create?

I have Prefer strict mode enabled, so IDEA injects 'use strict'; into functions. But why not inject it as the first line in my file?

Is there any problem with it? If no - how to tell IDEA to do it?

Upvotes: 1

Views: 356

Answers (1)

Jama A.
Jama A.

Reputation: 16089

You can create your own File and Code Templates like I did here. It will appear inside the File.

Here's how it looks like: New File

It initially didn't show up, but after restart I could see the new file type.

Upvotes: 1

Related Questions