Samantha J Samantha J - 13 days ago 6
TypeScript Question

What is the standard for use of quotes in Typescript?

I notice in my application that TsLint is suggesting:

static $inject = [
'$http',
'$q',
'$scope',
'configService',
'stateService',
'utilityService'
];


for the above that:

Message 2 TsLint: ' should be "


Is this a suggested standard now for Typescript ?

Answer

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.