[#10432] Pass prettier

Signed-off-by: LvffY <louberger@hotmail.fr>
This commit is contained in:
LvffY
2022-03-30 17:11:35 +02:00
parent 0f290356b9
commit 2dcac58fa0
7 changed files with 25 additions and 17 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ _If you're using Backstage in your organization, please try to add your company
| [Netflix](https://www.netflix.com/) | [bleathem](https://github.com/bleathem) | Our Backstage implementation will be the front door to a unified experience connecting our internal platform products across important workflows with integrated knowledge and support. |
| [b.well](https://www.icanbwell.com/) | [Jacob Rosales](https://github.com/jrosales) | Foundation for our engineering portal and cloud insights. |
| [PagerDuty](https://www.pagerduty.com/) | [Mark Shaw](https://github.com/markshawtoronto) | Developer portal, initially focused on software templates and tech-docs. |
| [MoonShiner](https://moonshiner.at) | [Fabian Hippmann](https://github.com/FabianHippmann) | Developer portal - helps us keep track of our customer projects, onboard new developers & improve our development process 🌕🚀🧑‍🚀 |
| [MoonShiner](https://moonshiner.at) | [Fabian Hippmann](https://github.com/FabianHippmann) | Developer portal - helps us keep track of our customer projects, onboard new developers & improve our development process 🌕🚀🧑‍🚀 |
| [FundApps](https://www.fundapps.co/) | [Elliot Greenwood](https://github.com/egnwd) | Developer Portal - A place for us to keep track of our projects and documentation for all services and processes |
| [DAZN](https://dazn.com/) | [Lou Bichard](https://twitter.com/loujaybee), [Marco Crivellaro](https://github.com/crivetechie), [Alex Hollerith](mailto:alex.hollerith@dazn.com) | Ingesting all of DAZN's repos for the catalog, migrating our internal platform apps (pull request boards, release information, inner source marketplace etc) to Backstage plugins (where applicable). |
| [HelloFresh](https://www.hellofresh.de/) | [@iammuho](https://github.com/iammuho), [@ElenaForester](https://github.com/ElenaForester), [@diegomarangoni](https://github.com/diegomarangoni) | Our developer portal at HelloFresh - Spread across an organisation of 500+ engineers globally. |
@@ -22,8 +22,9 @@ import { AppContextProvider } from './AppContext';
describe('v1 consumer', () => {
function useMockAppV1(): AppContextV1 {
const impl =
useVersionedContext<{ 1: AppContextV1 }>('app-context')?.atVersion(1);
const impl = useVersionedContext<{ 1: AppContextV1 }>(
'app-context',
)?.atVersion(1);
if (!impl) {
throw new Error('no impl');
}
@@ -27,8 +27,9 @@ import {
import { RouteResolver } from './RouteResolver';
import { BackstageRouteObject } from './types';
const RoutingContext =
createVersionedContext<{ 1: RouteResolver }>('routing-context');
const RoutingContext = createVersionedContext<{ 1: RouteResolver }>(
'routing-context',
);
type ProviderProps = {
routePaths: Map<RouteRef, string>;
@@ -21,8 +21,9 @@ import {
import React, { ReactNode, useContext } from 'react';
import { AnalyticsContextValue } from './types';
const AnalyticsReactContext =
createVersionedContext<{ 1: AnalyticsContextValue }>('analytics-context');
const AnalyticsReactContext = createVersionedContext<{
1: AnalyticsContextValue;
}>('analytics-context');
/**
* A "private" (to this package) hook that enables context inheritance and a
+3 -2
View File
@@ -23,8 +23,9 @@ import { AppContext as AppContextV1 } from './types';
* @public
*/
export const useApp = (): AppContextV1 => {
const versionedContext =
useVersionedContext<{ 1: AppContextV1 }>('app-context');
const versionedContext = useVersionedContext<{ 1: AppContextV1 }>(
'app-context',
);
if (!versionedContext) {
throw new Error('App context is not available');
}
@@ -86,8 +86,9 @@ export function useRouteRef<Params extends AnyParams>(
| ExternalRouteRef<Params, any>,
): RouteFunc<Params> | undefined {
const sourceLocation = useLocation();
const versionedContext =
useVersionedContext<{ 1: RouteResolver }>('routing-context');
const versionedContext = useVersionedContext<{ 1: RouteResolver }>(
'routing-context',
);
if (!versionedContext) {
throw new Error('Routing context is not available');
}
@@ -32,8 +32,9 @@ export type EntityLoadingStatus<TEntity extends Entity = Entity> = {
// This context has support for multiple concurrent versions of this package.
// It is currently used in parallel with the old context in order to provide
// a smooth transition, but will eventually be the only context we use.
const NewEntityContext =
createVersionedContext<{ 1: EntityLoadingStatus }>('entity-context');
const NewEntityContext = createVersionedContext<{ 1: EntityLoadingStatus }>(
'entity-context',
);
/**
* Properties for the AsyncEntityProvider component.
@@ -104,8 +105,9 @@ export const EntityProvider = ({ entity, children }: EntityProviderProps) => (
export function useEntity<TEntity extends Entity = Entity>(): {
entity: TEntity;
} {
const versionedHolder =
useVersionedContext<{ 1: EntityLoadingStatus }>('entity-context');
const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(
'entity-context',
);
if (!versionedHolder) {
throw new Error('Entity context is not available');
@@ -133,8 +135,9 @@ export function useEntity<TEntity extends Entity = Entity>(): {
export function useAsyncEntity<
TEntity extends Entity = Entity,
>(): EntityLoadingStatus<TEntity> {
const versionedHolder =
useVersionedContext<{ 1: EntityLoadingStatus }>('entity-context');
const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(
'entity-context',
);
if (!versionedHolder) {
throw new Error('Entity context is not available');