November 2018
Beginner
502 pages
10h 22m
English
The rules that tslint uses when checking our code are configurable in a file called tslint.json. In order to explore some of the rules, we first need a TypeScript file:
export interface Product { name: string; unitPrice: number;}export class OrderDetail { product: Product; quantity: number; getTotal(discount: number): number { const priceWithoutDiscount = this.product.unitPrice * this.quantity; const discountAmount = priceWithoutDiscount * discount; return priceWithoutDiscount - discountAmount; }}
Read now
Unlock full access