feat: separate prettier from eslint

This commit is contained in:
Rainer Killinger
2023-01-11 13:25:18 +01:00
committed by Thea Schöbl
parent 939fb6ef0f
commit a88d000ccd
381 changed files with 17952 additions and 38411 deletions

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2022 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Injectable} from '@angular/core';
import {Client} from '@openstapps/api/lib/client';
@@ -111,10 +111,7 @@ export class DataProvider {
* @param field Database field for apply the filter to
* @param value Value to match with
*/
static createValueFilter(
field: SCThingsField,
value: string,
): SCSearchValueFilter {
static createValueFilter(field: SCThingsField, value: string): SCSearchValueFilter {
return {
type: 'value',
arguments: {
@@ -136,9 +133,7 @@ export class DataProvider {
for (const item of items) {
const value =
typeof bucketMap.get(item.type) === 'undefined'
? 1
: (bucketMap.get(item.type) as number) + 1;
typeof bucketMap.get(item.type) === 'undefined' ? 1 : (bucketMap.get(item.type) as number) + 1;
bucketMap.set(item.type, value);
}
@@ -155,15 +150,8 @@ export class DataProvider {
* @param stAppsWebHttpClient TODO
* @param storageProvider TODO
*/
constructor(
stAppsWebHttpClient: StAppsWebHttpClient,
storageProvider: StorageProvider,
) {
this.client = new Client(
stAppsWebHttpClient,
this.backendUrl,
this.appVersion,
);
constructor(stAppsWebHttpClient: StAppsWebHttpClient, storageProvider: StorageProvider) {
this.client = new Client(stAppsWebHttpClient, this.backendUrl, this.appVersion);
this.storageProvider = storageProvider;
}
@@ -173,10 +161,7 @@ export class DataProvider {
* @param item An indexable to create savable thing from
* @param type The type (falls back to the type of the indexable thing)
*/
static createSaveable(
item: SCIndexableThings,
type?: SCThingType,
): SCSaveableThing {
static createSaveable(item: SCIndexableThings, type?: SCThingType): SCSaveableThing {
return {
data: item,
name: item.name,
@@ -214,10 +199,7 @@ export class DataProvider {
/**
* Provides a thing from the backend
*/
async get(
uid: string,
scope: DataScope.Remote,
): Promise<SCThings | SCSaveableThing>;
async get(uid: string, scope: DataScope.Remote): Promise<SCThings | SCSaveableThing>;
/**
* Provides a thing from both local database and backend
*/
@@ -232,9 +214,7 @@ export class DataProvider {
async get(
uid: string,
scope?: DataScope,
): Promise<
SCThings | SCSaveableThing | Map<DataScope, SCThings | SCSaveableThing>
> {
): Promise<SCThings | SCSaveableThing | Map<DataScope, SCThings | SCSaveableThing>> {
if (scope === DataScope.Local) {
return this.storageProvider.get<SCSaveableThing>(this.getDataKey(uid));
}
@@ -288,9 +268,7 @@ export class DataProvider {
*
* @param query - query to send to the backend (auto-splits according to the backend limit)
*/
async multiSearch(
query: SCMultiSearchRequest,
): Promise<SCMultiSearchResponse> {
async multiSearch(query: SCMultiSearchRequest): Promise<SCMultiSearchResponse> {
// partition object into chunks, process those requests in parallel, then merge their responses again
return Object.assign(
{},
@@ -320,11 +298,7 @@ export class DataProvider {
* @param feedback Feedback message to be sent to the backend
*/
async sendFeedback(feedback: SCFeedbackRequest) {
return this.client.invokePlugin<SCFeedbackResponse>(
'feedback',
undefined,
feedback,
);
return this.client.invokePlugin<SCFeedbackResponse>('feedback', undefined, feedback);
}
/**