Samantha J Samantha J - 1 year ago 83
TypeScript Question

What is the standard for use of quotes in Typescript?

I notice in my application that TsLint is suggesting:

static $inject = [

for the above that:

Message 2 TsLint: ' should be "

Is this a suggested standard now for Typescript ?

Answer Source

There is no particular standard to use single quotes for characters and double quotes for string but it is suggested to use double quotes for strings and vice versa.

From the docs:

Just like JavaScript, TypeScript also uses the double quote (") or single quote (') to surround string data.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download