From 14d2364fc69e0222133115c55a36286986006098 Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Fri, 15 Oct 2021 09:48:06 +0200 Subject: chore: update eslint setup (#2074) --- src/models/Recipe.ts | 67 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 17 deletions(-) (limited to 'src/models/Recipe.ts') diff --git a/src/models/Recipe.ts b/src/models/Recipe.ts index 859c75df0..e45977f24 100644 --- a/src/models/Recipe.ts +++ b/src/models/Recipe.ts @@ -1,10 +1,7 @@ import semver from 'semver'; import { pathExistsSync } from 'fs-extra'; import { join } from 'path'; -import { - ifUndefinedString, - ifUndefinedBoolean, -} from '../jsUtils'; +import { ifUndefinedString, ifUndefinedBoolean } from '../jsUtils'; interface IRecipe { id: string; @@ -75,7 +72,8 @@ export default class Recipe { message: string = ''; - allowFavoritesDelineationInUnreadCount: boolean = DEFAULT_RECIPE_SETTINGS.allowFavoritesDelineationInUnreadCount; + allowFavoritesDelineationInUnreadCount: boolean = + DEFAULT_RECIPE_SETTINGS.allowFavoritesDelineationInUnreadCount; disablewebsecurity: boolean = DEFAULT_RECIPE_SETTINGS.disablewebsecurity; @@ -98,7 +96,9 @@ export default class Recipe { } if (!semver.valid(data.version)) { - throw new Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`); + throw new Error( + `Version ${data.version} of recipe '${data.name}' is not a valid semver version`, + ); } // from the recipe @@ -106,19 +106,52 @@ export default class Recipe { this.name = ifUndefinedString(data.name, this.name); this.version = ifUndefinedString(data.version, this.version); this.aliases = data.aliases || this.aliases; - this.serviceURL = ifUndefinedString(data.config.serviceURL, this.serviceURL); - this.hasDirectMessages = ifUndefinedBoolean(data.config.hasDirectMessages, this.hasDirectMessages); - this.hasIndirectMessages = ifUndefinedBoolean(data.config.hasIndirectMessages, this.hasIndirectMessages); - this.hasNotificationSound = ifUndefinedBoolean(data.config.hasNotificationSound, this.hasNotificationSound); + this.serviceURL = ifUndefinedString( + data.config.serviceURL, + this.serviceURL, + ); + this.hasDirectMessages = ifUndefinedBoolean( + data.config.hasDirectMessages, + this.hasDirectMessages, + ); + this.hasIndirectMessages = ifUndefinedBoolean( + data.config.hasIndirectMessages, + this.hasIndirectMessages, + ); + this.hasNotificationSound = ifUndefinedBoolean( + data.config.hasNotificationSound, + this.hasNotificationSound, + ); this.hasTeamId = ifUndefinedBoolean(data.config.hasTeamId, this.hasTeamId); - this.hasCustomUrl = ifUndefinedBoolean(data.config.hasCustomUrl, this.hasCustomUrl); - this.hasHostedOption = ifUndefinedBoolean(data.config.hasHostedOption, this.hasHostedOption); - this.urlInputPrefix = ifUndefinedString(data.config.urlInputPrefix, this.urlInputPrefix); - this.urlInputSuffix = ifUndefinedString(data.config.urlInputSuffix, this.urlInputSuffix); - this.disablewebsecurity = ifUndefinedBoolean(data.config.disablewebsecurity, this.disablewebsecurity); - this.autoHibernate = ifUndefinedBoolean(data.config.autoHibernate, this.autoHibernate); + this.hasCustomUrl = ifUndefinedBoolean( + data.config.hasCustomUrl, + this.hasCustomUrl, + ); + this.hasHostedOption = ifUndefinedBoolean( + data.config.hasHostedOption, + this.hasHostedOption, + ); + this.urlInputPrefix = ifUndefinedString( + data.config.urlInputPrefix, + this.urlInputPrefix, + ); + this.urlInputSuffix = ifUndefinedString( + data.config.urlInputSuffix, + this.urlInputSuffix, + ); + this.disablewebsecurity = ifUndefinedBoolean( + data.config.disablewebsecurity, + this.disablewebsecurity, + ); + this.autoHibernate = ifUndefinedBoolean( + data.config.autoHibernate, + this.autoHibernate, + ); this.message = ifUndefinedString(data.config.message, this.message); - this.allowFavoritesDelineationInUnreadCount = ifUndefinedBoolean(data.config.allowFavoritesDelineationInUnreadCount, this.allowFavoritesDelineationInUnreadCount); + this.allowFavoritesDelineationInUnreadCount = ifUndefinedBoolean( + data.config.allowFavoritesDelineationInUnreadCount, + this.allowFavoritesDelineationInUnreadCount, + ); // computed this.path = data.path; -- cgit v1.2.3-70-g09d2