Address minor code style comments
move code out of `converter/index.ts`. change Converter to be an interface. remove unused function remove commented out import Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { FC, useEffect } from 'react';
|
||||
import React, { FC } from 'react';
|
||||
import { useApi } from '@backstage/core-api';
|
||||
import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
import { useAsync } from 'react-use';
|
||||
@@ -31,14 +31,6 @@ type Props = {
|
||||
coverage: FileCoverage;
|
||||
};
|
||||
|
||||
const getContent = async (value: any) => {
|
||||
let blob = value;
|
||||
if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) {
|
||||
blob = new Blob([value], { type: 'application/octet-stream' });
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
paper: {
|
||||
margin: 'auto',
|
||||
@@ -97,10 +89,6 @@ export const FileContent = ({ filename, coverage }: Props) => {
|
||||
),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (value) getContent(value);
|
||||
}, [value]);
|
||||
|
||||
const classes = useStyles();
|
||||
|
||||
if (loading) {
|
||||
|
||||
@@ -20,11 +20,10 @@ import highlight from 'highlight.js';
|
||||
* Given a file extension, repo name, and array of code lines, return a Promise resolving
|
||||
* to an array of formatted lines with html/css formatting.
|
||||
*
|
||||
* @param {String} fileExtension The extension of the source file
|
||||
* @param {String} repo The name of the code repository
|
||||
* @param {Array<String>} lines The source code lines
|
||||
* @param fileExtension The extension of the source file
|
||||
* @param lines The source code lines
|
||||
*
|
||||
* @returns {Promise<Array<String>>} Promise of formatted lines
|
||||
* @returns Promise of formatted lines
|
||||
*
|
||||
* @see http://highlightjs.readthedocs.io/en/latest/api.html#highlight-name-value-ignore-illegals-continuation
|
||||
*/
|
||||
|
||||
@@ -19,5 +19,3 @@ export {
|
||||
isCodeCoverageAvailable,
|
||||
isCodeCoverageAvailable as isPluginApplicableToEntity,
|
||||
} from './components/Router';
|
||||
|
||||
// export { createBackendRouter } from './backend/router';
|
||||
|
||||
Reference in New Issue
Block a user