From f4b4416ea52d564bc2dbe543a82084ed98843ccc Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Fri, 30 Jul 2021 10:54:54 +0200 Subject: chore: migrate from tslint to @typescript-eslint (#1706) - update .eslintrc to work for .js and .ts - update devDependencies - lint properly both root /src and nested /packages - update webhint recommended setting for tsconfig.json to shrink output - Manage all eslint rules from the repo root - escape single quotes in scripts to please windows build Co-authored-by: Vijay A --- src/containers/settings/AccountScreen.js | 5 +---- src/containers/settings/EditServiceScreen.js | 4 ++-- src/containers/settings/EditSettingsScreen.js | 2 +- src/containers/settings/EditUserScreen.js | 2 +- src/containers/settings/RecipesScreen.js | 10 +++++----- 5 files changed, 10 insertions(+), 13 deletions(-) (limited to 'src/containers/settings') diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index 4ee932895..8d92b01be 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js @@ -46,10 +46,7 @@ class AccountScreen extends Component { } render() { - const { - user, - settings, - } = this.props.stores; + const { user, settings } = this.props.stores; const { user: userActions } = this.props.actions; const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index 0fe84792f..c880e97ae 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js @@ -394,9 +394,9 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex status={services.actionStatus} isSaving={services.updateServiceRequest.isExecuting || services.createServiceRequest.isExecuting} isDeleting={services.deleteServiceRequest.isExecuting} - onSubmit={d => this.onSubmit(d)} + onSubmit={(d) => this.onSubmit(d)} onDelete={() => this.deleteService()} - openRecipeFile={file => this.openRecipeFile(file)} + openRecipeFile={(file) => this.openRecipeFile(file)} isProxyFeatureEnabled={proxyFeature.isEnabled} /> diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 764078cb8..e0a648095 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js @@ -652,7 +652,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e isUpdateAvailable={updateStatus === updateStatusTypes.AVAILABLE} noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE} updateIsReadyToInstall={updateStatus === updateStatusTypes.DOWNLOADED} - onSubmit={d => this.onSubmit(d)} + onSubmit={(d) => this.onSubmit(d)} getCacheSize={() => app.cacheSize} isClearingAllCache={isClearingAllCache} onClearAllCache={clearAllCache} diff --git a/src/containers/settings/EditUserScreen.js b/src/containers/settings/EditUserScreen.js index 8e93164de..820b5e4d3 100644 --- a/src/containers/settings/EditUserScreen.js +++ b/src/containers/settings/EditUserScreen.js @@ -141,7 +141,7 @@ export default @inject('stores', 'actions') @observer class EditUserScreen exten status={user.actionStatus} form={form} isSaving={user.updateUserInfoRequest.isExecuting} - onSubmit={d => this.onSubmit(d)} + onSubmit={(d) => this.onSubmit(d)} /> ); diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js index 9a16fd064..0d6506705 100644 --- a/src/containers/settings/RecipesScreen.js +++ b/src/containers/settings/RecipesScreen.js @@ -82,7 +82,7 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend return recipes // Filter out duplicate recipes .filter((recipe, index, self) => { - const ids = self.map(rec => rec.id); + const ids = self.map((rec) => rec.id); return ids.indexOf(recipe.id) === index; // Sort alphabetically @@ -95,7 +95,7 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend // Create an array of RecipePreviews from an array of recipe objects createPreviews(recipes) { - return recipes.map(recipe => new RecipePreview(recipe)); + return recipes.map((recipe) => new RecipePreview(recipe)); } resetSearch() { @@ -134,11 +134,11 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend // All search recipes from local recipes ...this.createPreviews( this.customRecipes - .filter(service => service.name.toLowerCase().includes(this.state.needle.toLowerCase())), + .filter((service) => service.name.toLowerCase().includes(this.state.needle.toLowerCase())), ), ]) : recipeFilter; - const customWebsiteRecipe = recipePreviews.all.find(service => service.id === CUSTOM_WEBSITE_RECIPE_ID); + const customWebsiteRecipe = recipePreviews.all.find((service) => service.id === CUSTOM_WEBSITE_RECIPE_ID); const isLoading = recipePreviews.featuredRecipePreviewsRequest.isExecuting || recipePreviews.allRecipePreviewsRequest.isExecuting @@ -156,7 +156,7 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend addedServiceCount={services.all.length} hasLoadedRecipes={recipePreviews.featuredRecipePreviewsRequest.wasExecuted} showAddServiceInterface={serviceActions.showAddServiceInterface} - searchRecipes={e => this.searchRecipes(e)} + searchRecipes={(e) => this.searchRecipes(e)} resetSearch={() => this.resetSearch()} searchNeedle={this.state.needle} serviceStatus={services.actionStatus} -- cgit v1.2.3-54-g00ecf