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/auth/SetupAssistantScreen.js | 2 +- src/containers/auth/SignupScreen.js | 2 +- src/containers/layout/AppLayoutContainer.js | 4 ++-- 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 +++++----- 8 files changed, 14 insertions(+), 17 deletions(-) (limited to 'src/containers') diff --git a/src/containers/auth/SetupAssistantScreen.js b/src/containers/auth/SetupAssistantScreen.js index eaf3fda8a..d14085f63 100644 --- a/src/containers/auth/SetupAssistantScreen.js +++ b/src/containers/auth/SetupAssistantScreen.js @@ -102,7 +102,7 @@ export default @inject('stores', 'actions') @observer class SetupAssistantScreen render() { return ( this.setupServices(config)} + onSubmit={(config) => this.setupServices(config)} services={this.services} embed={false} isSettingUpServices={this.state.isSettingUpServices} diff --git a/src/containers/auth/SignupScreen.js b/src/containers/auth/SignupScreen.js index eeab63a0c..38c5dfb43 100644 --- a/src/containers/auth/SignupScreen.js +++ b/src/containers/auth/SignupScreen.js @@ -24,7 +24,7 @@ export default @inject('stores', 'actions') @observer class SignupScreen extends return ( this.onSignup(values)} + onSubmit={(values) => this.onSignup(values)} isSubmitting={stores.user.signupRequest.isExecuting} loginRoute={stores.user.loginRoute} changeServerRoute={stores.user.changeServerRoute} diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 21be9d9d1..fff628946 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -92,8 +92,8 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e const workspacesDrawer = ( ( - workspace ? workspaceStore.getWorkspaceServices(workspace).map(s => s.name) : services.all.map(s => s.name) + getServicesForWorkspace={(workspace) => ( + workspace ? workspaceStore.getWorkspaceServices(workspace).map((s) => s.name) : services.all.map((s) => s.name) )} /> ); 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