fix: lint errors

Signed-off-by: Chris Langhout <clanghout@bol.com>
This commit is contained in:
Chris Langhout
2024-10-04 15:31:37 +02:00
committed by blam
parent 9c9f4ff990
commit 0d468fcd78
2 changed files with 16 additions and 20 deletions
+1
View File
@@ -73,6 +73,7 @@
"d3-shape": "^3.0.0",
"d3-zoom": "^3.0.0",
"dagre": "^0.8.5",
"js-yaml": "^4.1.0",
"linkify-react": "4.1.3",
"linkifyjs": "4.1.3",
"lodash": "^4.17.21",
@@ -18,11 +18,7 @@ import React, { Fragment } from 'react';
import startCase from 'lodash/startCase';
import Typography from '@material-ui/core/Typography';
import {
MetadataTable,
MetadataTableItem,
} from './MetadataTable';
import { JsonArray, JsonObject, JsonValue } from '@backstage/types';
import { MetadataTable, MetadataTableItem } from './MetadataTable';
import { CodeSnippet } from '../CodeSnippet';
import jsyaml from 'js-yaml';
@@ -30,25 +26,24 @@ export type StructuredMetadataTableListClassKey = 'root';
export type StructuredMetadataTableNestedListClassKey = 'root';
function toValue(
value: object | Array<any> | boolean | string,
) {
function toValue(value: object | Array<any> | boolean | string) {
if (React.isValidElement(value)) {
return <Fragment>{value}</Fragment>;
}
if (value !== null && typeof value === 'object') {
return <CodeSnippet
language='yaml'
text={jsyaml.dump(value)}
// showLineNumbers={true}
customStyle={{
background: 'transparent',
lineHeight: '1.4',
padding: '0',
margin: 0,
}}
/>
return (
<CodeSnippet
language="yaml"
text={jsyaml.dump(value)}
customStyle={{
background: 'transparent',
lineHeight: '1.4',
padding: '0',
margin: 0,
}}
/>
);
}
if (typeof value === 'boolean') {
@@ -71,7 +66,7 @@ const TableItem = ({
options,
}: {
title: string;
value: JsonObject | JsonArray | JsonValue;
value: any;
options: Options;
}) => {
return (