Our goal is to set up TypeScript Compiler (TSC) with a command line option that can identify errors when developers declare class fields using implicit type expressions instead of explicit ones as illustrated below.
class Appliance {
//Desired coding style:
private _group:Group = new Group();
//Undesired coding style that should trigger an error:
private _group = new Group();
//Desired coding style because it does not solely rely on the constructor parameters list for declaration
public assetTag:EquipmentTag;
public constructor(assetTag:AssetTag,
//Undesired coding style that should result in an error if there's no explicit declaration above the constructor
supplier:Company) {
this.assetTag = assetTag; //Desired coding style
}
}
We currently have strict mode enabled for TSC, however, it allows for some leniency in coding practices as shown.
Are there any specific TSC options available to further enhance beyond strict mode and enforce strict compliance with our coding style guidelines?