Merge pull request #3657 from adamdmharvey/lgtm-review
Address three LGTM/Semmle code scanning findings
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/config': patch
|
||||
---
|
||||
|
||||
Fix unneeded defensive code
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
Fix string template literal
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/config': patch
|
||||
---
|
||||
|
||||
Fix useless conditional
|
||||
@@ -272,23 +272,17 @@ export class ConfigReader implements Config {
|
||||
if (value === undefined) {
|
||||
return this.fallback?.readConfigValue(key, validate);
|
||||
}
|
||||
if (value !== undefined) {
|
||||
const result = validate(value);
|
||||
if (result !== true) {
|
||||
const {
|
||||
key: keyName = key,
|
||||
value: theValue = value,
|
||||
const result = validate(value);
|
||||
if (result !== true) {
|
||||
const { key: keyName = key, value: theValue = value, expected } = result;
|
||||
throw new TypeError(
|
||||
errors.type(
|
||||
this.fullKey(keyName),
|
||||
this.context,
|
||||
typeOf(theValue),
|
||||
expected,
|
||||
} = result;
|
||||
throw new TypeError(
|
||||
errors.type(
|
||||
this.fullKey(keyName),
|
||||
this.context,
|
||||
typeOf(theValue),
|
||||
expected,
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return value as T;
|
||||
|
||||
@@ -184,7 +184,7 @@ export class MicrosoftGraphClient {
|
||||
const response = await this.requestApi(`organization/${tenantId}`);
|
||||
|
||||
if (response.status !== 200) {
|
||||
await this.handleError('organization/${tenantId}', response);
|
||||
await this.handleError(`organization/${tenantId}`, response);
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
|
||||
@@ -39,8 +39,8 @@ const getSelectedIndexOrDefault = (
|
||||
|
||||
/**
|
||||
* Compound component, which allows you to define layout
|
||||
* for EntityPage using Tabs as a subnavigation mechanism
|
||||
* Constists of 2 parts: Tabbed.Layout and Tabbed.Content.
|
||||
* for EntityPage using Tabs as a sub-navigation mechanism
|
||||
* Consists of 2 parts: Tabbed.Layout and Tabbed.Content.
|
||||
* Takes care of: tabs, routes, document titles, spacing around content
|
||||
*
|
||||
* @example
|
||||
|
||||
@@ -50,7 +50,7 @@ const EntityPageSwitch = ({ EntityPage }: { EntityPage: ComponentType }) => {
|
||||
const { entity, loading, error } = useEntity();
|
||||
// Loading and error states
|
||||
if (loading) return <EntityPageLayout />;
|
||||
if (error || (!loading && !entity)) return <EntityNotFound />;
|
||||
if (error || !entity) return <EntityNotFound />;
|
||||
|
||||
// Otherwise EntityPage provided from the App
|
||||
// Note that EntityPage will include EntityPageLayout already
|
||||
|
||||
Reference in New Issue
Block a user