feat: upgrade prettier to v3

This commit is contained in:
Thea Schöbl
2023-12-05 10:36:04 +00:00
parent 991ed1cb1f
commit 31a6ebfd3f
50 changed files with 455 additions and 362 deletions

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
pnpm-lock.yaml

View File

@@ -84,7 +84,10 @@ export class Elasticsearch implements Database {
* @param config an assembled config file * @param config an assembled config file
* @param mailQueue a mail queue for monitoring * @param mailQueue a mail queue for monitoring
*/ */
constructor(private readonly config: SCConfigFile, mailQueue?: MailQueue) { constructor(
private readonly config: SCConfigFile,
mailQueue?: MailQueue,
) {
if (config.internal.database === undefined || typeof config.internal.database.version !== 'string') { if (config.internal.database === undefined || typeof config.internal.database.version !== 'string') {
throw new TypeError('Database version is undefined. Check your config file'); throw new TypeError('Database version is undefined. Check your config file');
} }

View File

@@ -0,0 +1,15 @@
/** @type {import('prettier').Config} */
const config = {
tabWidth: 2,
printWidth: 110,
useTabs: false,
semi: true,
singleQuote: true,
quoteProps: 'consistent',
trailingComma: 'all',
bracketSpacing: false,
arrowParens: 'avoid',
endOfLine: 'lf'
}
export default config;

View File

@@ -1,13 +0,0 @@
{
"$schema": "http://json.schemastore.org/prettierrc",
"tabWidth": 2,
"printWidth": 110,
"useTabs": false,
"semi": true,
"singleQuote": true,
"quoteProps": "consistent",
"trailingComma": "all",
"bracketSpacing": false,
"arrowParens": "avoid",
"endOfLine": "lf"
}

View File

@@ -9,16 +9,19 @@
"contributors": [ "contributors": [
"Rainer Killinger <mail-openstapps@killinger.co>" "Rainer Killinger <mail-openstapps@killinger.co>"
], ],
"main": "index.json", "main": "index.js",
"files": [ "files": [
"index.json", "index.js",
"CHANGELOG.md", "CHANGELOG.md",
"README.md" "README.md"
], ],
"scripts": { "scripts": {
"test": "npx prettier --config index.json --check \"test/*.js\"" "test": "prettier --config index.js --check \"test/*.js\""
},
"devDependencies": {
"prettier": "3.1.0"
}, },
"peerDependencies": { "peerDependencies": {
"prettier": "2.8.6" "prettier": "3.1.0"
} }
} }

View File

@@ -106,7 +106,6 @@
"ngx-markdown": "16.0.0", "ngx-markdown": "16.0.0",
"ngx-moment": "6.0.2", "ngx-moment": "6.0.2",
"opening_hours": "3.8.0", "opening_hours": "3.8.0",
"prettier": "2.8.6",
"rxjs": "7.8.1", "rxjs": "7.8.1",
"swiper": "8.4.5", "swiper": "8.4.5",
"tslib": "2.4.1", "tslib": "2.4.1",

View File

@@ -12,9 +12,11 @@
* You should have received a copy of the GNU General Public License along with * You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>. * this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import prettierConfig from '@openstapps/prettier-config';
module.exports = { /** @type {import('prettier').Config} */
...require('@openstapps/prettier-config'), const config = {
...prettierConfig,
overrides: [ overrides: [
{ {
files: 'src/**/*.html', files: 'src/**/*.html',
@@ -25,3 +27,5 @@ module.exports = {
], ],
ignorePath: ['.prettierignore', '../../.gitignore'], ignorePath: ['.prettierignore', '../../.gitignore'],
}; };
export default config;

View File

@@ -49,7 +49,10 @@ export class SharedAxisChoreographer<T> {
*/ */
currentValue: T; currentValue: T;
constructor(initialValue: T, readonly pages?: T[]) { constructor(
initialValue: T,
readonly pages?: T[],
) {
this.currentValue = initialValue; this.currentValue = initialValue;
this.expectedValue = initialValue; this.expectedValue = initialValue;
} }

View File

@@ -35,7 +35,10 @@ export class AboutPageComponent implements OnInit {
version: string; version: string;
constructor(private readonly route: ActivatedRoute, private readonly configProvider: ConfigProvider) {} constructor(
private readonly route: ActivatedRoute,
private readonly configProvider: ConfigProvider,
) {}
async ngOnInit() { async ngOnInit() {
const route = this.route.snapshot.url.map(it => it.path).join('/'); const route = this.route.snapshot.url.map(it => it.path).join('/');

View File

@@ -22,7 +22,10 @@ import {AuthHelperService} from './auth-helper.service';
providedIn: 'root', providedIn: 'root',
}) })
export class AuthGuardService implements CanActivate { export class AuthGuardService implements CanActivate {
constructor(private authHelper: AuthHelperService, private router: Router) {} constructor(
private authHelper: AuthHelperService,
private router: Router,
) {}
public async canActivate(route: ActivatedProtectedRouteSnapshot, _state: RouterStateSnapshot) { public async canActivate(route: ActivatedProtectedRouteSnapshot, _state: RouterStateSnapshot) {
if (route.queryParamMap.get('token')) { if (route.queryParamMap.get('token')) {

View File

@@ -134,9 +134,9 @@ export class ScheduleSyncService {
private formatChanges(changes: ChangesOf<SCDateSeries, DateSeriesRelevantData>): string[] { private formatChanges(changes: ChangesOf<SCDateSeries, DateSeriesRelevantData>): string[] {
return changes.changes.map( return changes.changes.map(
change => change =>
`${ `${this.translator.translator.translatedPropertyNames<SCDateSeries>(SCThingType.DateSeries)?.[
this.translator.translator.translatedPropertyNames<SCDateSeries>(SCThingType.DateSeries)?.[change] change
}: ${formatRelevantKeys[change]( ]}: ${formatRelevantKeys[change](
changes.new[change] as never, changes.new[change] as never,
this.dateFormatPipe, this.dateFormatPipe,
this.durationFormatPipe, this.durationFormatPipe,

View File

@@ -38,7 +38,10 @@ export class CalendarService {
calendarName = 'StApps'; calendarName = 'StApps';
// eslint-disable-next-line @typescript-eslint/no-empty-function // eslint-disable-next-line @typescript-eslint/no-empty-function
constructor(readonly calendar: Calendar, private readonly configProvider: ConfigProvider) { constructor(
readonly calendar: Calendar,
private readonly configProvider: ConfigProvider,
) {
this.calendarName = (this.configProvider.getValue('name') as string) ?? 'StApps'; this.calendarName = (this.configProvider.getValue('name') as string) ?? 'StApps';
} }

View File

@@ -33,7 +33,7 @@
<ion-label> <ion-label>
{{ {{
nextEvent nextEvent
? (nextEvent!.dates | nextDateInList | amDateFormat : 'll, HH:mm') ? (nextEvent!.dates | nextDateInList | amDateFormat: 'll, HH:mm')
: ('dashboard.schedule.noEvent' | translate) : ('dashboard.schedule.noEvent' | translate)
}} }}
</ion-label> </ion-label>

View File

@@ -16,7 +16,7 @@
<ng-container *ngIf="items | async as items"> <ng-container *ngIf="items | async as items">
<ng-container *ngIf="items.length !== 0; else nothingSelected"> <ng-container *ngIf="items.length !== 0; else nothingSelected">
<ng-container *ngFor="let item of items"> <ng-container *ngFor="let item of items">
<stapps-section @fade [item]="item" [title]="'name' | thingTranslate : item"> <stapps-section @fade [item]="item" [title]="'name' | thingTranslate: item">
<ion-button slot="button-end" fill="clear" color="medium" (click)="favoritesService.delete(item)"> <ion-button slot="button-end" fill="clear" color="medium" (click)="favoritesService.delete(item)">
<ion-icon slot="icon-only" name="delete" size="24"></ion-icon> <ion-icon slot="icon-only" name="delete" size="24"></ion-icon>
</ion-button> </ion-button>

View File

@@ -42,8 +42,8 @@ export class ActionChipListComponent {
const maybeCoords = isInPlace const maybeCoords = isInPlace
? item?.inPlace?.geo.point.coordinates ? item?.inPlace?.geo.point.coordinates
: hasDirectGeo : hasDirectGeo
? item.geo.point.coordinates ? item.geo.point.coordinates
: undefined; : undefined;
const isNullIsland = maybeCoords ? maybeCoords[0] === 0 && maybeCoords[1] === 0 : false; const isNullIsland = maybeCoords ? maybeCoords[0] === 0 && maybeCoords[1] === 0 : false;
this.applicable = { this.applicable = {
locate: false, // TODO: reimplement this at a later date locate: false, // TODO: reimplement this at a later date

View File

@@ -44,7 +44,10 @@ export class TreeNode<T extends TreeNode<any> | SelectionValue> {
*/ */
parent?: TreeNode<TreeNode<T>>; parent?: TreeNode<TreeNode<T>>;
constructor(readonly children: T[], readonly ref: ChangeDetectorRef) { constructor(
readonly children: T[],
readonly ref: ChangeDetectorRef,
) {
this.updateParents(); this.updateParents();
this.accumulateApplyValues(); this.accumulateApplyValues();
} }
@@ -58,11 +61,11 @@ export class TreeNode<T extends TreeNode<any> | SelectionValue> {
? it.checked ? it.checked
? Selection.ON ? Selection.ON
: it.indeterminate : it.indeterminate
? Selection.PARTIAL ? Selection.PARTIAL
: Selection.OFF : Selection.OFF
: (it as SelectionValue).selected : (it as SelectionValue).selected
? Selection.ON ? Selection.ON
: Selection.OFF, : Selection.OFF,
); );
this.checked = selections.every(it => it === Selection.ON); this.checked = selections.every(it => it === Selection.ON);

View File

@@ -29,10 +29,13 @@ async function delay(ms: number): Promise<void> {
* ['a', 'b', 'c'] => {0: 'a', 1: 'b', 2: 'c'} * ['a', 'b', 'c'] => {0: 'a', 1: 'b', 2: 'c'}
*/ */
export function arrayToIndexMap<T>(array: T[]): Record<number, T> { export function arrayToIndexMap<T>(array: T[]): Record<number, T> {
return array.reduce((previous, current, index) => { return array.reduce(
previous[index] = current; (previous, current, index) => {
return previous; previous[index] = current;
}, {} as Record<number, T>); return previous;
},
{} as Record<number, T>,
);
} }
interface OngoingQuery { interface OngoingQuery {

View File

@@ -51,7 +51,10 @@ export class StappsRatingComponent {
this.dish.next(value); this.dish.next(value);
} }
constructor(readonly elementRef: ElementRef, readonly ratingProvider: RatingProvider) {} constructor(
readonly elementRef: ElementRef,
readonly ratingProvider: RatingProvider,
) {}
@HostListener('document:mousedown', ['$event']) @HostListener('document:mousedown', ['$event'])
clickOutside(event: MouseEvent) { clickOutside(event: MouseEvent) {

View File

@@ -17,11 +17,11 @@
<ion-card-title> <ion-card-title>
<h1> <h1>
<ng-container *ngIf="$any(item).honorificPrefix">{{ <ng-container *ngIf="$any(item).honorificPrefix">{{
'honorificPrefix' | thingTranslate : item 'honorificPrefix' | thingTranslate: item
}}</ng-container> }}</ng-container>
{{ 'name' | thingTranslate : item }} {{ 'name' | thingTranslate: item }}
<ng-container *ngIf="$any(item).honorificSuffix">{{ <ng-container *ngIf="$any(item).honorificSuffix">{{
'honorificSuffix' | thingTranslate : item 'honorificSuffix' | thingTranslate: item
}}</ng-container> }}</ng-container>
</h1> </h1>
</ion-card-title> </ion-card-title>
@@ -33,7 +33,7 @@
<!-- TODO obviously this is bad style. Tbd where to put the differentiation. Job Postings always have a description, but it's going to be shown in `stapps-job-posting-detail-content` anyways, no need to repeat here. For this view, I would use other fields of the schema.org JobPosting like the `ThingWithCategory.category` --> <!-- TODO obviously this is bad style. Tbd where to put the differentiation. Job Postings always have a description, but it's going to be shown in `stapps-job-posting-detail-content` anyways, no need to repeat here. For this view, I would use other fields of the schema.org JobPosting like the `ThingWithCategory.category` -->
<div *ngIf="item.description && item.type !== 'job posting'" class="description"> <div *ngIf="item.description && item.type !== 'job posting'" class="description">
<div class="text-accordion" [style.-webkit-line-clamp]="descriptionLinesToDisplay" #accordionTextArea> <div class="text-accordion" [style.-webkit-line-clamp]="descriptionLinesToDisplay" #accordionTextArea>
{{ 'description' | thingTranslate : item }} {{ 'description' | thingTranslate: item }}
</div> </div>
</div> </div>
<!-- TODO see above --> <!-- TODO see above -->

View File

@@ -53,7 +53,10 @@ export class SimpleDataListComponent implements OnInit {
destroy$ = inject(DestroyRef); destroy$ = inject(DestroyRef);
constructor(protected router: Router, private readonly dataRoutingService: DataRoutingService) {} constructor(
protected router: Router,
private readonly dataRoutingService: DataRoutingService,
) {}
ngOnInit(): void { ngOnInit(): void {
if (!this.autoRouting) return; if (!this.autoRouting) return;

View File

@@ -26,7 +26,10 @@ import {SettingsProvider} from '../../../../../settings/settings.provider';
providedIn: 'root', providedIn: 'root',
}) })
export class PlaceMensaService { export class PlaceMensaService {
constructor(private dataProvider: DataProvider, readonly settingsProvider: SettingsProvider) {} constructor(
private dataProvider: DataProvider,
readonly settingsProvider: SettingsProvider,
) {}
/** /**
* Fetches all dishes for this building * Fetches all dishes for this building
@@ -39,10 +42,13 @@ export class PlaceMensaService {
Array.from({length: days}) Array.from({length: days})
.map((_, i) => i) .map((_, i) => i)
.map(i => moment().add(i, 'days').toISOString()) .map(i => moment().add(i, 'days').toISOString())
.reduce((accumulator, item) => { .reduce(
accumulator[item] = item; (accumulator, item) => {
return accumulator; accumulator[item] = item;
}, {} as Record<SCISO8601Date, SCISO8601Date>), return accumulator;
},
{} as Record<SCISO8601Date, SCISO8601Date>,
),
date => ({ date => ({
filter: { filter: {
arguments: { arguments: {

View File

@@ -47,7 +47,10 @@ export class MapListModalComponent implements OnInit {
*/ */
@Input() queryText?: string; @Input() queryText?: string;
constructor(private mapProvider: MapProvider, readonly modalController: ModalController) {} constructor(
private mapProvider: MapProvider,
readonly modalController: ModalController,
) {}
/** /**
* Populate the list with the results from the search * Populate the list with the results from the search

View File

@@ -359,8 +359,8 @@ export class MapPageComponent implements OnInit {
this.locationStatus?.location === 'denied' this.locationStatus?.location === 'denied'
? location.NOT_ALLOWED ? location.NOT_ALLOWED
: this.locationStatus?.location === 'granted' : this.locationStatus?.location === 'granted'
? unknownError ? unknownError
: location.NOT_ENABLED : location.NOT_ENABLED
}`, }`,
buttons: ['OK'], buttons: ['OK'],
}) })

View File

@@ -22,7 +22,10 @@ import {NGXLogger} from 'ngx-logger';
providedIn: 'root', providedIn: 'root',
}) })
export class NavigationService { export class NavigationService {
constructor(private configProvider: ConfigProvider, private logger: NGXLogger) {} constructor(
private configProvider: ConfigProvider,
private logger: NGXLogger,
) {}
async getMenu() { async getMenu() {
let menu: SCAppConfigurationMenuCategory[] = []; let menu: SCAppConfigurationMenuCategory[] = [];

View File

@@ -37,7 +37,10 @@ import {SettingsProvider} from '../settings/settings.provider';
providedIn: 'root', providedIn: 'root',
}) })
export class NewsProvider { export class NewsProvider {
constructor(private dataProvider: DataProvider, private settingsProvider: SettingsProvider) {} constructor(
private dataProvider: DataProvider,
private settingsProvider: SettingsProvider,
) {}
async getCurrentSettings(): Promise<SCSetting[]> { async getCurrentSettings(): Promise<SCSetting[]> {
const settings: SCSetting[] = []; const settings: SCSetting[] = [];

View File

@@ -46,7 +46,9 @@ describe('ScheduleSingleEvents', () => {
start: time.hour() + time.minute() / 60, start: time.hour() + time.minute() / 60,
startAsString: moment(time).format('LT'), startAsString: moment(time).format('LT'),
duration: series.duration as string, duration: series.duration as string,
endAsString: moment(time).add(series.duration?.[index]).format('LT'), endAsString: moment(time)
.add(series.duration?.[index])
.format('LT'),
}, },
}, },
}; };

View File

@@ -133,10 +133,13 @@ export class ScheduleViewComponent extends CalendarComponent implements OnInit,
for (const series of dateSeries.dates) { for (const series of dateSeries.dates) {
const weekDays = Object.keys( const weekDays = Object.keys(
series.dates.reduce((accumulator, date) => { series.dates.reduce(
accumulator[moment(date).weekday()] = true; (accumulator, date) => {
return accumulator; accumulator[moment(date).weekday()] = true;
}, {} as Record<number, true>), return accumulator;
},
{} as Record<number, true>,
),
); );
for (const day of weekDays) { for (const day of weekDays) {

View File

@@ -197,7 +197,10 @@ export class SettingsProvider {
* @param storage TODO * @param storage TODO
* @param configProvider TODO * @param configProvider TODO
*/ */
constructor(private readonly storage: StorageProvider, private readonly configProvider: ConfigProvider) { constructor(
private readonly storage: StorageProvider,
private readonly configProvider: ConfigProvider,
) {
this.categoriesOrder = []; this.categoriesOrder = [];
this.settingsCache = {}; this.settingsCache = {};
} }
@@ -330,9 +333,8 @@ export class SettingsProvider {
if (await this.storage.has(STORAGE_KEY_SETTING_VALUES)) { if (await this.storage.has(STORAGE_KEY_SETTING_VALUES)) {
// get setting values from StorageProvider into settingsCache // get setting values from StorageProvider into settingsCache
const valuesContainer: SettingValuesContainer = await this.storage.get<SettingValuesContainer>( const valuesContainer: SettingValuesContainer =
STORAGE_KEY_SETTING_VALUES, await this.storage.get<SettingValuesContainer>(STORAGE_KEY_SETTING_VALUES);
);
// iterate through keys of categories // iterate through keys of categories
for (const categoryKey of Object.keys(this.settingsCache)) { for (const categoryKey of Object.keys(this.settingsCache)) {
// iterate through setting keys of category // iterate through setting keys of category
@@ -384,9 +386,8 @@ export class SettingsProvider {
*/ */
public async saveSettingValues(): Promise<void> { public async saveSettingValues(): Promise<void> {
if (await this.storage.has(STORAGE_KEY_SETTING_VALUES)) { if (await this.storage.has(STORAGE_KEY_SETTING_VALUES)) {
const savedSettingsValues: SettingValuesContainer = await this.storage.get<SettingValuesContainer>( const savedSettingsValues: SettingValuesContainer =
STORAGE_KEY_SETTING_VALUES, await this.storage.get<SettingValuesContainer>(STORAGE_KEY_SETTING_VALUES);
);
const cacheSettingsValues = this.getSettingValuesFromCache(); const cacheSettingsValues = this.getSettingValuesFromCache();
const mergedSettingValues = deepMerge(savedSettingsValues, cacheSettingsValues); const mergedSettingValues = deepMerge(savedSettingsValues, cacheSettingsValues);
await this.storage.put<SettingValuesContainer>(STORAGE_KEY_SETTING_VALUES, mergedSettingValues); await this.storage.put<SettingValuesContainer>(STORAGE_KEY_SETTING_VALUES, mergedSettingValues);

View File

@@ -101,7 +101,10 @@ export class InternetConnectionService {
private readonly errors = new Set<unknown>(); private readonly errors = new Set<unknown>();
constructor(private readonly logger: NGXLogger, private readonly router: Router) {} constructor(
private readonly logger: NGXLogger,
private readonly router: Router,
) {}
/** /**
* Retry all failed http requests * Retry all failed http requests

View File

@@ -22,7 +22,10 @@
height: 100%; height: 100%;
font-size: inherit; font-size: inherit;
font-variation-settings: 'wght' var(--weight), 'GRAD' var(--grade), 'FILL' var(--fill); font-variation-settings:
'wght' var(--weight),
'GRAD' var(--grade),
'FILL' var(--fill);
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
} }

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -27,7 +27,9 @@
border-radius: var(--border-radius-default); border-radius: var(--border-radius-default);
box-shadow: var(--shadow-cards); box-shadow: var(--shadow-cards);
transition: transform 250ms ease-in-out, box-shadow 250ms ease-in-out; transition:
transform 250ms ease-in-out,
box-shadow 250ms ease-in-out;
} }
@media (hover: hover) { @media (hover: hover) {

View File

@@ -39,8 +39,8 @@ export type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends Array<infer U> [P in keyof T]?: T[P] extends Array<infer U>
? Array<RecursivePartial<U>> ? Array<RecursivePartial<U>>
: T[P] extends object : T[P] extends object
? RecursivePartial<T[P]> ? RecursivePartial<T[P]>
: T[P]; : T[P];
}; };
chai.should(); chai.should();

View File

@@ -95,7 +95,11 @@ export class Client {
* *
* TODO: remove headers/version * TODO: remove headers/version
*/ */
constructor(protected httpClient: HttpClientInterface, protected url: string, protected version?: string) { constructor(
protected httpClient: HttpClientInterface,
protected url: string,
protected version?: string,
) {
// cut trailing slash if needed // cut trailing slash if needed
this.url = this.url.replace(/\/$/, ''); this.url = this.url.replace(/\/$/, '');

View File

@@ -51,8 +51,8 @@ export type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends Array<infer U> [P in keyof T]?: T[P] extends Array<infer U>
? Array<RecursivePartial<U>> ? Array<RecursivePartial<U>>
: T[P] extends object : T[P] extends object
? RecursivePartial<T[P]> ? RecursivePartial<T[P]>
: T[P]; : T[P];
}; };
async function invokeIndexRoute(): Promise<RecursivePartial<HttpClientResponse<SCIndexResponse>>> { async function invokeIndexRoute(): Promise<RecursivePartial<HttpClientResponse<SCIndexResponse>>> {

View File

@@ -20,8 +20,11 @@
* iteratee is invoked with one argument: (value). * iteratee is invoked with one argument: (value).
*/ */
export function keyBy<T>(collection: T[], key: (item: T) => string | number): Record<string, T> { export function keyBy<T>(collection: T[], key: (item: T) => string | number): Record<string, T> {
return collection.reduce((accumulator, item) => { return collection.reduce(
accumulator[key(item)] = item; (accumulator, item) => {
return accumulator; accumulator[key(item)] = item;
}, {} as Record<string | number, T>); return accumulator;
},
{} as Record<string | number, T>,
);
} }

View File

@@ -17,12 +17,15 @@
* Pick a set of properties from an object * Pick a set of properties from an object
*/ */
export function pick<T extends object, U extends keyof T>(object: T, keys: U[]): Pick<T, U> { export function pick<T extends object, U extends keyof T>(object: T, keys: U[]): Pick<T, U> {
return keys.reduce((accumulator, key) => { return keys.reduce(
if (object.hasOwnProperty(key)) { (accumulator, key) => {
accumulator[key] = object[key]; if (object.hasOwnProperty(key)) {
} accumulator[key] = object[key];
return accumulator; }
}, {} as Pick<T, U>); return accumulator;
},
{} as Pick<T, U>,
);
} }
/** /**
@@ -32,10 +35,13 @@ export function pickBy<T extends object, U extends keyof T>(
object: T, object: T,
predicate: (value: T[U], key: U) => boolean, predicate: (value: T[U], key: U) => boolean,
): Pick<T, U> { ): Pick<T, U> {
return (Object.keys(object) as U[]).reduce((accumulator, key) => { return (Object.keys(object) as U[]).reduce(
if (predicate(object[key], key)) { (accumulator, key) => {
accumulator[key] = object[key]; if (predicate(object[key], key)) {
} accumulator[key] = object[key];
return accumulator; }
}, {} as Pick<T, U>); return accumulator;
},
{} as Pick<T, U>,
);
} }

View File

@@ -18,9 +18,12 @@
*/ */
export function uniqBy<T>(array: T[], transform: (item: T) => string | number): T[] { export function uniqBy<T>(array: T[], transform: (item: T) => string | number): T[] {
return Object.values( return Object.values(
array.reduce((accumulator, current) => { array.reduce(
accumulator[transform(current)] = current; (accumulator, current) => {
return accumulator; accumulator[transform(current)] = current;
}, {} as Record<string | number, T>), return accumulator;
},
{} as Record<string | number, T>,
),
); );
} }

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<title>OpenStApps API</title> <title>OpenStApps API</title>

View File

@@ -691,8 +691,8 @@ type RecursivePartial<T> = {
[P in keyof T]-?: T[P] extends Array<infer U> [P in keyof T]-?: T[P] extends Array<infer U>
? Array<RecursivePartial<U>> ? Array<RecursivePartial<U>>
: T[P] extends object : T[P] extends object
? RecursivePartial<T[P]> ? RecursivePartial<T[P]>
: T[P]; : T[P];
}; };
/** /**

View File

@@ -148,66 +148,66 @@ export type SCThingsField = keyof SCThings | string;
export type SCAssociatedThingWithoutReferences<THING extends SCThings> = THING extends SCAssessment export type SCAssociatedThingWithoutReferences<THING extends SCThings> = THING extends SCAssessment
? SCAssessmentWithoutReferences ? SCAssessmentWithoutReferences
: THING extends SCAcademicEvent : THING extends SCAcademicEvent
? SCAcademicEventWithoutReferences ? SCAcademicEventWithoutReferences
: THING extends SCArticle : THING extends SCArticle
? SCArticleWithoutReferences ? SCArticleWithoutReferences
: THING extends SCBook : THING extends SCBook
? SCBookWithoutReferences ? SCBookWithoutReferences
: THING extends SCBuilding : THING extends SCBuilding
? SCBuildingWithoutReferences ? SCBuildingWithoutReferences
: THING extends SCCatalog : THING extends SCCatalog
? SCCatalogWithoutReferences ? SCCatalogWithoutReferences
: THING extends SCContactPoint : THING extends SCContactPoint
? SCContactPointWithoutReferences ? SCContactPointWithoutReferences
: THING extends SCCourseOfStudy : THING extends SCCourseOfStudy
? SCCourseOfStudyWithoutReferences ? SCCourseOfStudyWithoutReferences
: THING extends SCCertification : THING extends SCCertification
? SCCertificationWithoutReferences ? SCCertificationWithoutReferences
: THING extends SCDateSeries : THING extends SCDateSeries
? SCDateSeriesWithoutReferences ? SCDateSeriesWithoutReferences
: THING extends SCDiff : THING extends SCDiff
? SCDiffWithoutReferences ? SCDiffWithoutReferences
: THING extends SCDish : THING extends SCDish
? SCDishWithoutReferences ? SCDishWithoutReferences
: THING extends SCFavorite : THING extends SCFavorite
? SCFavoriteWithoutReferences ? SCFavoriteWithoutReferences
: THING extends SCFloor : THING extends SCFloor
? SCFloorWithoutReferences ? SCFloorWithoutReferences
: THING extends SCIdCard : THING extends SCIdCard
? SCIdCardWithoutReferences ? SCIdCardWithoutReferences
: THING extends SCJobPosting : THING extends SCJobPosting
? SCJobPostingWithoutReferences ? SCJobPostingWithoutReferences
: THING extends SCMessage : THING extends SCMessage
? SCMessageWithoutReferences ? SCMessageWithoutReferences
: THING extends SCOrganization : THING extends SCOrganization
? SCOrganizationWithoutReferences ? SCOrganizationWithoutReferences
: THING extends SCPeriodical : THING extends SCPeriodical
? SCPeriodicalWithoutReferences ? SCPeriodicalWithoutReferences
: THING extends SCPerson : THING extends SCPerson
? SCPersonWithoutReferences ? SCPersonWithoutReferences
: THING extends SCPointOfInterest : THING extends SCPointOfInterest
? SCPointOfInterestWithoutReferences ? SCPointOfInterestWithoutReferences
: THING extends SCPublicationEvent : THING extends SCPublicationEvent
? SCPublicationEventWithoutReferences ? SCPublicationEventWithoutReferences
: THING extends SCRoom : THING extends SCRoom
? SCRoomWithoutReferences ? SCRoomWithoutReferences
: THING extends SCSemester : THING extends SCSemester
? SCSemesterWithoutReferences ? SCSemesterWithoutReferences
: THING extends SCSetting : THING extends SCSetting
? SCSettingWithoutReferences ? SCSettingWithoutReferences
: THING extends SCSportCourse : THING extends SCSportCourse
? SCSportCourseWithoutReferences ? SCSportCourseWithoutReferences
: THING extends SCStudyModule : THING extends SCStudyModule
? SCStudyModuleWithoutReferences ? SCStudyModuleWithoutReferences
: THING extends SCTicket : THING extends SCTicket
? SCTicketWithoutReferences ? SCTicketWithoutReferences
: THING extends SCToDo : THING extends SCToDo
? SCToDoWithoutReferences ? SCToDoWithoutReferences
: THING extends SCTour : THING extends SCTour
? SCTourWithoutReferences ? SCTourWithoutReferences
: THING extends SCVideo : THING extends SCVideo
? SCVideoWithoutReferences ? SCVideoWithoutReferences
: never; : never;
/** /**
* Thing for a thing without references * Thing for a thing without references
@@ -215,63 +215,63 @@ export type SCAssociatedThingWithoutReferences<THING extends SCThings> = THING e
export type SCAssociatedThing<THING extends SCThings> = THING extends SCAssessmentWithoutReferences export type SCAssociatedThing<THING extends SCThings> = THING extends SCAssessmentWithoutReferences
? SCAssessment ? SCAssessment
: THING extends SCAcademicEventWithoutReferences : THING extends SCAcademicEventWithoutReferences
? SCAcademicEvent ? SCAcademicEvent
: THING extends SCArticleWithoutReferences : THING extends SCArticleWithoutReferences
? SCArticle ? SCArticle
: THING extends SCBookWithoutReferences : THING extends SCBookWithoutReferences
? SCBook ? SCBook
: THING extends SCBuildingWithoutReferences : THING extends SCBuildingWithoutReferences
? SCBuilding ? SCBuilding
: THING extends SCCatalogWithoutReferences : THING extends SCCatalogWithoutReferences
? SCCatalog ? SCCatalog
: THING extends SCContactPointWithoutReferences : THING extends SCContactPointWithoutReferences
? SCContactPoint ? SCContactPoint
: THING extends SCCourseOfStudyWithoutReferences : THING extends SCCourseOfStudyWithoutReferences
? SCCourseOfStudy ? SCCourseOfStudy
: THING extends SCCertificationWithoutReferences : THING extends SCCertificationWithoutReferences
? SCCertification ? SCCertification
: THING extends SCDateSeriesWithoutReferences : THING extends SCDateSeriesWithoutReferences
? SCDateSeries ? SCDateSeries
: THING extends SCDiffWithoutReferences : THING extends SCDiffWithoutReferences
? SCDiff ? SCDiff
: THING extends SCDishWithoutReferences : THING extends SCDishWithoutReferences
? SCDish ? SCDish
: THING extends SCJobPostingWithoutReferences : THING extends SCJobPostingWithoutReferences
? SCJobPosting ? SCJobPosting
: THING extends SCFavoriteWithoutReferences : THING extends SCFavoriteWithoutReferences
? SCFavorite ? SCFavorite
: THING extends SCFloorWithoutReferences : THING extends SCFloorWithoutReferences
? SCFloor ? SCFloor
: THING extends SCIdCardWithoutReferences : THING extends SCIdCardWithoutReferences
? SCIdCard ? SCIdCard
: THING extends SCMessageWithoutReferences : THING extends SCMessageWithoutReferences
? SCMessage ? SCMessage
: THING extends SCOrganizationWithoutReferences : THING extends SCOrganizationWithoutReferences
? SCOrganization ? SCOrganization
: THING extends SCPeriodicalWithoutReferences : THING extends SCPeriodicalWithoutReferences
? SCPeriodical ? SCPeriodical
: THING extends SCPersonWithoutReferences : THING extends SCPersonWithoutReferences
? SCPerson ? SCPerson
: THING extends SCPointOfInterestWithoutReferences : THING extends SCPointOfInterestWithoutReferences
? SCPointOfInterest ? SCPointOfInterest
: THING extends SCPublicationEventWithoutReferences : THING extends SCPublicationEventWithoutReferences
? SCPublicationEvent ? SCPublicationEvent
: THING extends SCRoomWithoutReferences : THING extends SCRoomWithoutReferences
? SCRoom ? SCRoom
: THING extends SCSemesterWithoutReferences : THING extends SCSemesterWithoutReferences
? SCSemester ? SCSemester
: THING extends SCSettingWithoutReferences : THING extends SCSettingWithoutReferences
? SCSetting ? SCSetting
: THING extends SCSportCourseWithoutReferences : THING extends SCSportCourseWithoutReferences
? SCSportCourse ? SCSportCourse
: THING extends SCStudyModuleWithoutReferences : THING extends SCStudyModuleWithoutReferences
? SCStudyModule ? SCStudyModule
: THING extends SCTicketWithoutReferences : THING extends SCTicketWithoutReferences
? SCTicket ? SCTicket
: THING extends SCToDoWithoutReferences : THING extends SCToDoWithoutReferences
? SCToDo ? SCToDo
: THING extends SCTourWithoutReferences : THING extends SCTourWithoutReferences
? SCTour ? SCTour
: THING extends SCVideoWithoutReferences : THING extends SCVideoWithoutReferences
? SCVideo ? SCVideo
: never; : never;

View File

@@ -45,7 +45,12 @@ export abstract class SCError implements SCErrorResponse {
* @param statusCode HTTP status code to return this error with * @param statusCode HTTP status code to return this error with
* @param stack Set to true if a stack trace should be created * @param stack Set to true if a stack trace should be created
*/ */
constructor(public name: string, public message: string, public statusCode: number, stack = false) { constructor(
public name: string,
public message: string,
public statusCode: number,
stack = false,
) {
// generate stacktrace if needed // generate stacktrace if needed
if (stack) { if (stack) {
// eslint-disable-next-line unicorn/error-message // eslint-disable-next-line unicorn/error-message

View File

@@ -193,24 +193,24 @@ export type SCResponses =
export type SCAssociatedResponse<REQUEST> = REQUEST extends SCBookAvailabilityRequest export type SCAssociatedResponse<REQUEST> = REQUEST extends SCBookAvailabilityRequest
? SCBookAvailabilityResponse ? SCBookAvailabilityResponse
: REQUEST extends SCBulkRequest : REQUEST extends SCBulkRequest
? SCBulkResponse ? SCBulkResponse
: REQUEST extends SCBulkAddRequest : REQUEST extends SCBulkAddRequest
? SCBulkAddResponse ? SCBulkAddResponse
: REQUEST extends SCBulkDoneRequest : REQUEST extends SCBulkDoneRequest
? SCBulkDoneResponse ? SCBulkDoneResponse
: REQUEST extends SCFeedbackRequest : REQUEST extends SCFeedbackRequest
? SCFeedbackResponse ? SCFeedbackResponse
: REQUEST extends SCRatingRequest : REQUEST extends SCRatingRequest
? SCRatingResponse ? SCRatingResponse
: REQUEST extends SCIndexRequest : REQUEST extends SCIndexRequest
? SCIndexResponse ? SCIndexResponse
: REQUEST extends SCMultiSearchRequest : REQUEST extends SCMultiSearchRequest
? SCMultiSearchResponse ? SCMultiSearchResponse
: REQUEST extends SCSearchRequest : REQUEST extends SCSearchRequest
? SCSearchResponse ? SCSearchResponse
: REQUEST extends SCThingUpdateRequest : REQUEST extends SCThingUpdateRequest
? SCThingUpdateResponse ? SCThingUpdateResponse
: never; : never;
/** /**
* Associated request for a response * Associated request for a response
@@ -218,24 +218,24 @@ export type SCAssociatedResponse<REQUEST> = REQUEST extends SCBookAvailabilityRe
export type SCAssociatedRequest<RESPONSE> = RESPONSE extends SCBookAvailabilityResponse export type SCAssociatedRequest<RESPONSE> = RESPONSE extends SCBookAvailabilityResponse
? SCBookAvailabilityRequest ? SCBookAvailabilityRequest
: RESPONSE extends SCBulkResponse : RESPONSE extends SCBulkResponse
? SCBulkRequest ? SCBulkRequest
: RESPONSE extends SCBulkAddResponse : RESPONSE extends SCBulkAddResponse
? SCBulkAddRequest ? SCBulkAddRequest
: RESPONSE extends SCBulkDoneResponse : RESPONSE extends SCBulkDoneResponse
? SCBulkDoneRequest ? SCBulkDoneRequest
: RESPONSE extends SCFeedbackResponse : RESPONSE extends SCFeedbackResponse
? SCFeedbackRequest ? SCFeedbackRequest
: RESPONSE extends SCRatingResponse : RESPONSE extends SCRatingResponse
? SCRatingRequest ? SCRatingRequest
: RESPONSE extends SCIndexResponse : RESPONSE extends SCIndexResponse
? SCIndexRequest ? SCIndexRequest
: RESPONSE extends SCMultiSearchResponse : RESPONSE extends SCMultiSearchResponse
? SCMultiSearchRequest ? SCMultiSearchRequest
: RESPONSE extends SCSearchResponse : RESPONSE extends SCSearchResponse
? SCSearchRequest ? SCSearchRequest
: RESPONSE extends SCThingUpdateResponse : RESPONSE extends SCThingUpdateResponse
? SCThingUpdateRequest ? SCThingUpdateRequest
: never; : never;
/** /**
* Associated request for a route * Associated request for a route
@@ -243,24 +243,24 @@ export type SCAssociatedRequest<RESPONSE> = RESPONSE extends SCBookAvailabilityR
export type SCAssignedRequest<ROUTE extends SCAbstractRoute> = ROUTE extends SCBookAvailabilityRoute export type SCAssignedRequest<ROUTE extends SCAbstractRoute> = ROUTE extends SCBookAvailabilityRoute
? SCBookAvailabilityRequest ? SCBookAvailabilityRequest
: ROUTE extends SCBulkRoute : ROUTE extends SCBulkRoute
? SCBulkRequest ? SCBulkRequest
: ROUTE extends SCBulkAddRoute : ROUTE extends SCBulkAddRoute
? SCBulkAddRequest ? SCBulkAddRequest
: ROUTE extends SCBulkDoneRoute : ROUTE extends SCBulkDoneRoute
? SCBulkDoneRequest ? SCBulkDoneRequest
: ROUTE extends SCFeedbackRoute : ROUTE extends SCFeedbackRoute
? SCFeedbackRequest ? SCFeedbackRequest
: ROUTE extends SCRatingRoute : ROUTE extends SCRatingRoute
? SCRatingRequest ? SCRatingRequest
: ROUTE extends SCIndexRoute : ROUTE extends SCIndexRoute
? SCIndexRequest ? SCIndexRequest
: ROUTE extends SCMultiSearchRoute : ROUTE extends SCMultiSearchRoute
? SCMultiSearchRequest ? SCMultiSearchRequest
: ROUTE extends SCSearchRoute : ROUTE extends SCSearchRoute
? SCSearchRequest ? SCSearchRequest
: ROUTE extends SCThingUpdateRoute : ROUTE extends SCThingUpdateRoute
? SCThingUpdateRequest ? SCThingUpdateRequest
: never; : never;
/** /**
* Associated response for a route * Associated response for a route
@@ -268,21 +268,21 @@ export type SCAssignedRequest<ROUTE extends SCAbstractRoute> = ROUTE extends SCB
export type SCAssignedResponse<ROUTE extends SCAbstractRoute> = ROUTE extends SCBookAvailabilityRoute export type SCAssignedResponse<ROUTE extends SCAbstractRoute> = ROUTE extends SCBookAvailabilityRoute
? SCBookAvailabilityResponse ? SCBookAvailabilityResponse
: ROUTE extends SCBulkRoute : ROUTE extends SCBulkRoute
? SCBulkResponse ? SCBulkResponse
: ROUTE extends SCBulkAddRoute : ROUTE extends SCBulkAddRoute
? SCBulkAddResponse ? SCBulkAddResponse
: ROUTE extends SCBulkDoneRoute : ROUTE extends SCBulkDoneRoute
? SCBulkDoneResponse ? SCBulkDoneResponse
: ROUTE extends SCFeedbackRoute : ROUTE extends SCFeedbackRoute
? SCFeedbackResponse ? SCFeedbackResponse
: ROUTE extends SCRatingRoute : ROUTE extends SCRatingRoute
? SCRatingResponse ? SCRatingResponse
: ROUTE extends SCIndexRoute : ROUTE extends SCIndexRoute
? SCIndexResponse ? SCIndexResponse
: ROUTE extends SCMultiSearchRoute : ROUTE extends SCMultiSearchRoute
? SCMultiSearchResponse ? SCMultiSearchResponse
: ROUTE extends SCSearchRoute : ROUTE extends SCSearchRoute
? SCSearchResponse ? SCSearchResponse
: ROUTE extends SCThingUpdateRoute : ROUTE extends SCThingUpdateRoute
? SCThingUpdateResponse ? SCThingUpdateResponse
: never; : never;

View File

@@ -117,8 +117,8 @@ describe('Features', () => {
.map(it => project.definitions[it] as LightweightDefinition) .map(it => project.definitions[it] as LightweightDefinition)
.some(it => it.name === 'SCThing' || hasSCThingReferences(it)) .some(it => it.name === 'SCThing' || hasSCThingReferences(it))
: definition : definition
? typeHasSCThingReferences(definition.type) ? typeHasSCThingReferences(definition.type)
: false; : false;
for (const thing of things) { for (const thing of things) {
expect(hasSCThingReferences(thing)).to.be.false; expect(hasSCThingReferences(thing)).to.be.false;

View File

@@ -86,8 +86,8 @@ export function resolvePropertyName(name?: ts.PropertyName): string | undefined
return name === undefined return name === undefined
? undefined ? undefined
: ts.isComputedPropertyName(name) : ts.isComputedPropertyName(name)
? 'UNSUPPORTED_IDENTIFIER_TYPE' ? 'UNSUPPORTED_IDENTIFIER_TYPE'
: name.getText(); : name.getText();
} }
/** @internal */ /** @internal */

View File

@@ -72,7 +72,10 @@ class LightweightDefinitionBuilder {
readonly typeChecker: ts.TypeChecker; readonly typeChecker: ts.TypeChecker;
constructor(sourcePath: string | string[], readonly includeComments: boolean) { constructor(
sourcePath: string | string[],
readonly includeComments: boolean,
) {
const rootNames = Array.isArray(sourcePath) const rootNames = Array.isArray(sourcePath)
? sourcePath ? sourcePath
: expandPathToFilesSync(path.resolve(sourcePath), it => it.endsWith('.ts')); : expandPathToFilesSync(path.resolve(sourcePath), it => it.endsWith('.ts'));

View File

@@ -23,8 +23,8 @@ export type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends Array<infer U> [P in keyof T]?: T[P] extends Array<infer U>
? Array<RecursivePartial<U>> ? Array<RecursivePartial<U>>
: T[P] extends object : T[P] extends object
? RecursivePartial<T[P]> ? RecursivePartial<T[P]>
: T[P]; : T[P];
}; };
/** /**

122
pnpm-lock.yaml generated
View File

@@ -203,7 +203,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -220,8 +220,8 @@ importers:
specifier: 1.3.5 specifier: 1.3.5
version: 1.3.5 version: 1.3.5
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
sinon: sinon:
specifier: 15.0.4 specifier: 15.0.4
version: 15.0.4 version: 15.0.4
@@ -335,7 +335,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -346,8 +346,8 @@ importers:
specifier: 2.2.0 specifier: 2.2.0
version: 2.2.0(mocha@10.2.0) version: 2.2.0(mocha@10.2.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
sinon: sinon:
specifier: 15.0.4 specifier: 15.0.4
version: 15.0.4 version: 15.0.4
@@ -389,13 +389,13 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
configuration/eslint-config: configuration/eslint-config:
dependencies: dependencies:
@@ -413,7 +413,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -432,10 +432,10 @@ importers:
version: 5.1.6 version: 5.1.6
configuration/prettier-config: configuration/prettier-config:
dependencies: devDependencies:
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
configuration/projectmanagement: configuration/projectmanagement:
dependencies: dependencies:
@@ -520,7 +520,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -531,8 +531,8 @@ importers:
specifier: 2.2.0 specifier: 2.2.0
version: 2.2.0(mocha@10.2.0) version: 2.2.0(mocha@10.2.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -613,7 +613,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -627,8 +627,8 @@ importers:
specifier: 13.3.1 specifier: 13.3.1
version: 13.3.1 version: 13.3.1
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -700,13 +700,13 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
tsup: tsup:
specifier: 6.7.0 specifier: 6.7.0
version: 6.7.0(ts-node@10.9.1)(typescript@5.1.6) version: 6.7.0(ts-node@10.9.1)(typescript@5.1.6)
@@ -878,9 +878,6 @@ importers:
opening_hours: opening_hours:
specifier: 3.8.0 specifier: 3.8.0
version: 3.8.0 version: 3.8.0
prettier:
specifier: 2.8.6
version: 2.8.6
rxjs: rxjs:
specifier: 7.8.1 specifier: 7.8.1
version: 7.8.1 version: 7.8.1
@@ -1022,7 +1019,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -1071,6 +1068,9 @@ importers:
license-checker: license-checker:
specifier: 25.0.1 specifier: 25.0.1
version: 25.0.1 version: 25.0.1
prettier:
specifier: 3.1.0
version: 3.1.0
stylelint: stylelint:
specifier: 15.10.1 specifier: 15.10.1
version: 15.10.1(typescript@5.1.6) version: 15.10.1(typescript@5.1.6)
@@ -1178,7 +1178,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -1189,8 +1189,8 @@ importers:
specifier: 2.2.0 specifier: 2.2.0
version: 2.2.0(mocha@10.2.0) version: 2.2.0(mocha@10.2.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
traverse: traverse:
specifier: 0.6.7 specifier: 0.6.7
version: 0.6.7 version: 0.6.7
@@ -1304,8 +1304,8 @@ importers:
specifier: 13.3.1 specifier: 13.3.1
version: 13.3.1 version: 13.3.1
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -1408,7 +1408,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -1422,8 +1422,8 @@ importers:
specifier: 13.3.1 specifier: 13.3.1
version: 13.3.1 version: 13.3.1
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -1480,7 +1480,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -1491,8 +1491,8 @@ importers:
specifier: 2.2.0 specifier: 2.2.0
version: 2.2.0(mocha@10.2.0) version: 2.2.0(mocha@10.2.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -1589,7 +1589,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -1600,8 +1600,8 @@ importers:
specifier: 2.2.0 specifier: 2.2.0
version: 2.2.0(mocha@10.2.0) version: 2.2.0(mocha@10.2.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
source-map-support: source-map-support:
specifier: 0.5.21 specifier: 0.5.21
version: 0.5.21 version: 0.5.21
@@ -1737,7 +1737,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -1751,8 +1751,8 @@ importers:
specifier: 13.3.1 specifier: 13.3.1
version: 13.3.1 version: 13.3.1
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -1822,7 +1822,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -1833,8 +1833,8 @@ importers:
specifier: 2.2.0 specifier: 2.2.0
version: 2.2.0(mocha@10.2.0) version: 2.2.0(mocha@10.2.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -1910,7 +1910,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -1924,8 +1924,8 @@ importers:
specifier: 13.3.1 specifier: 13.3.1
version: 13.3.1 version: 13.3.1
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
rimraf: rimraf:
specifier: 5.0.0 specifier: 5.0.0
version: 5.0.0 version: 5.0.0
@@ -1974,13 +1974,13 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -2062,7 +2062,7 @@ importers:
version: 46.4.2(eslint@8.43.0) version: 46.4.2(eslint@8.43.0)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: 4.2.1 specifier: 4.2.1
version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6) version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: 47.0.0 specifier: 47.0.0
version: 47.0.0(eslint@8.43.0) version: 47.0.0(eslint@8.43.0)
@@ -2073,8 +2073,8 @@ importers:
specifier: 2.2.0 specifier: 2.2.0
version: 2.2.0(mocha@10.2.0) version: 2.2.0(mocha@10.2.0)
prettier: prettier:
specifier: 2.8.6 specifier: 3.1.0
version: 2.8.6 version: 3.1.0
ts-node: ts-node:
specifier: 10.9.1 specifier: 10.9.1
version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6) version: 10.9.1(@types/node@18.15.3)(typescript@5.1.6)
@@ -6546,7 +6546,7 @@ packages:
resolution: {integrity: sha512-UWRmygBsyj4bVXvDiqSccwT1kmsorcwQwaIy30yVh8T+Gspx4OlC0shX1y+ZuwXZvgnafmpRYKks0bAu9urJew==} resolution: {integrity: sha512-UWRmygBsyj4bVXvDiqSccwT1kmsorcwQwaIy30yVh8T+Gspx4OlC0shX1y+ZuwXZvgnafmpRYKks0bAu9urJew==}
dependencies: dependencies:
'@xml-tools/parser': 1.0.11 '@xml-tools/parser': 1.0.11
prettier: 2.8.6 prettier: 3.1.0
dev: true dev: true
/@schematics/angular@12.2.18: /@schematics/angular@12.2.18:
@@ -11172,7 +11172,7 @@ packages:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
/eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.6): /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.1.0):
resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==}
engines: {node: '>=12.0.0'} engines: {node: '>=12.0.0'}
peerDependencies: peerDependencies:
@@ -11185,7 +11185,7 @@ packages:
dependencies: dependencies:
eslint: 8.43.0 eslint: 8.43.0
eslint-config-prettier: 8.8.0(eslint@8.43.0) eslint-config-prettier: 8.8.0(eslint@8.43.0)
prettier: 2.8.6 prettier: 3.1.0
prettier-linter-helpers: 1.0.0 prettier-linter-helpers: 1.0.0
/eslint-plugin-unicorn@47.0.0(eslint@8.43.0): /eslint-plugin-unicorn@47.0.0(eslint@8.43.0):
@@ -16117,6 +16117,12 @@ packages:
resolution: {integrity: sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ==} resolution: {integrity: sha512-mtuzdiBbHwPEgl7NxWlqOkithPyp4VN93V7VeHVWBF+ad3I5avc0RVDT4oImXQy9H/AqxA2NSQH8pSxHW6FYbQ==}
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}
hasBin: true hasBin: true
dev: true
/prettier@3.1.0:
resolution: {integrity: sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==}
engines: {node: '>=14'}
hasBin: true
/pretty-bytes@5.6.0: /pretty-bytes@5.6.0:
resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==}

View File

@@ -1,3 +0,0 @@
module.exports = {
...require('./configuration/prettier-config/index.json'),
}

1
prettier.config.js Normal file
View File

@@ -0,0 +1 @@
export default from './configuration/prettier-config/index.js';