From fd3d5a65e32d493b7b836a4a3e0818db37381109 Mon Sep 17 00:00:00 2001 From: zzhhaa Date: Thu, 28 Nov 2024 10:23:17 +0100 Subject: [PATCH] chore: adopt tsdoc line break convention --- app/models/Fairhold.ts | 15 +++++++++------ app/models/ForecastParameters.ts | 3 ++- app/models/Lifetime.ts | 6 ++++-- app/models/Mortgage.ts | 3 ++- app/models/tenure/FairholdLandPurchase.ts | 3 ++- app/models/tenure/FairholdLandRent.ts | 3 ++- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app/models/Fairhold.ts b/app/models/Fairhold.ts index 66401b20..209d079c 100644 --- a/app/models/Fairhold.ts +++ b/app/models/Fairhold.ts @@ -15,15 +15,16 @@ type ConstructorParams = Pick; export class Fairhold { /** Affordability is calculated as monthly housing cost / GDHI */ public affordability: number; - /** Depending on whether calculating `FairholdLandPurchase` or `FairholdLandRent`, + /** + * Depending on whether calculating `FairholdLandPurchase` or `FairholdLandRent`, * pass the relevant figure (open market residual land value or estimated portion of monthly market rent * that goes towards location) */ public landPriceOrRent: number; - /** The Fairhold discount is a multiplier, so Fairhold prices are `discountLand * open market value` - */ + /** The Fairhold discount is a multiplier, so Fairhold prices are `discountLand * open market value`*/ public discountLand: number; - /** When the class is instantiated for `FairholdLandPurchase`, this is the discounted up-front land purchase price; + /** + * When the class is instantiated for `FairholdLandPurchase`, this is the discounted up-front land purchase price; * when instantiated for `FairholdLandPurchase`, this is the discounted monthly community ground rent */ public discountedLandPriceOrRent: number; @@ -35,7 +36,8 @@ export class Fairhold { this.discountedLandPriceOrRent = this.calculateDiscountedPriceOrRent(); } - /** Our formula is linear; the more expensive an area is, the lower the generated price multiplier is; + /** + * Our formula is linear; the more expensive an area is, the lower the generated price multiplier is; * it plateaus at .15 of market rate */ private calculateFairholdDiscount() { @@ -43,7 +45,8 @@ export class Fairhold { return discountLand; } - /** Multiplies market land price or rent by the discountLand multiplier; + /** + * Multiplies market land price or rent by the discountLand multiplier; * in the event that land values are effectively negative, land price will be £1 */ private calculateDiscountedPriceOrRent() { diff --git a/app/models/ForecastParameters.ts b/app/models/ForecastParameters.ts index ea4a2061..ec80f6d3 100644 --- a/app/models/ForecastParameters.ts +++ b/app/models/ForecastParameters.ts @@ -8,7 +8,8 @@ export interface ForecastParameters { affordabilityThresholdIncomePercentage: number; } -/** Parameters for forecasting changing costs over time, +/** + * Parameters for forecasting changing costs over time, * all values except years are percentages represented in decimal form */ export const DEFAULT_FORECAST_PARAMETERS: ForecastParameters = { diff --git a/app/models/Lifetime.ts b/app/models/Lifetime.ts index 23fada05..29f4b641 100644 --- a/app/models/Lifetime.ts +++ b/app/models/Lifetime.ts @@ -37,7 +37,8 @@ export interface LifetimeData { // gasBillYearly: number; [key: number]: number; } -/** The `Lifetime` class calculates yearly spend on housing over a lifetime (set by `yearsForecast`). +/** + * The `Lifetime` class calculates yearly spend on housing over a lifetime (set by `yearsForecast`). * Instead of storing lifetime data within each tenure class itself, * `Lifetime` is stored in its own class (to prevent excess duplication of properties like `incomeYearly`). */ @@ -48,7 +49,8 @@ export class Lifetime { this.lifetimeData = this.calculateLifetime(params); } - /** The function loops through and calculates all values for period set by yearsForecast, + /** + * The function loops through and calculates all values for period set by yearsForecast, * pushing the results to the lifetime array (one object per-year) */ private calculateLifetime(params: LifetimeParams): LifetimeData[] { diff --git a/app/models/Mortgage.ts b/app/models/Mortgage.ts index 3effa7d6..419ccd43 100644 --- a/app/models/Mortgage.ts +++ b/app/models/Mortgage.ts @@ -17,7 +17,8 @@ type MortgageBreakdown = { remainingBalance: number; }[]; -/** The `Mortgage` class is instantiated each time a mortgage needs to be calculated, +/** + * The `Mortgage` class is instantiated each time a mortgage needs to be calculated, * meaning per-type of property, eg land or house, per-tenure */ export class Mortgage { diff --git a/app/models/tenure/FairholdLandPurchase.ts b/app/models/tenure/FairholdLandPurchase.ts index 93c905b5..135a112e 100644 --- a/app/models/tenure/FairholdLandPurchase.ts +++ b/app/models/tenure/FairholdLandPurchase.ts @@ -12,7 +12,8 @@ interface FairholdLandPurchaseParams { marketPurchase: MarketPurchase; } -/** `FairholdLandPurchase` needs different params to FairholdLandRent, +/** + * `FairholdLandPurchase` needs different params to FairholdLandRent, * which is why they are separate classes that both instantiate an instance of Fairhold. * Where `FairholdLandRent` uses other classes (eg `MarketPurchase`, `ForecastParameters`), they are passed in*/ export class FairholdLandPurchase { diff --git a/app/models/tenure/FairholdLandRent.ts b/app/models/tenure/FairholdLandRent.ts index 3b18bd04..9f409504 100644 --- a/app/models/tenure/FairholdLandRent.ts +++ b/app/models/tenure/FairholdLandRent.ts @@ -16,7 +16,8 @@ interface FairholdLandRentParams { marketPurchase: MarketPurchase; } -/** `FairholdLandRent` needs different params to `FairholdLandPurchase`, +/** + * `FairholdLandRent` needs different params to `FairholdLandPurchase`, * which is why they are separate classes that both instantiate an instance of `Fairhold`. * Where `FairholdLandRent` uses other classes (eg `MarketPurchase`, `ForecastParameters`), they are passed in*/ export class FairholdLandRent {