From 86d591493b3d9b9d11f45aedca1571c7173480ed Mon Sep 17 00:00:00 2001 From: michaelshin Date: Fri, 24 Mar 2023 15:08:05 -0400 Subject: [PATCH] Fixed warnings in react ui so it can compile --- skyline-vscode/react-ui/src/App.js | 2 +- .../react-ui/src/components/ModelLayers/PerfHintState.js | 1 + skyline-vscode/react-ui/src/components/ScatterGraph.js | 1 + skyline-vscode/react-ui/src/components/StackedBarGraph.js | 1 + skyline-vscode/react-ui/src/utils/utils.js | 8 ++++---- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/skyline-vscode/react-ui/src/App.js b/skyline-vscode/react-ui/src/App.js index 8225c94..b86143a 100644 --- a/skyline-vscode/react-ui/src/App.js +++ b/skyline-vscode/react-ui/src/App.js @@ -59,7 +59,7 @@ function App() { const [analysisState, setAnalysisState] = useState(); const [textChanged, setTextChanged] = useState(false); const [timeBreakDown, setTimeBreakdown] = useState([]); - + // eslint-disable-next-line const [vscodeApi, setVscodeApi] = useState(acquireApi()); const [errorText, setErrorText] = useState(); const [connectionStatus, setConnectionStatus] = useState(false); diff --git a/skyline-vscode/react-ui/src/components/ModelLayers/PerfHintState.js b/skyline-vscode/react-ui/src/components/ModelLayers/PerfHintState.js index 7ce1bda..34e7dc9 100644 --- a/skyline-vscode/react-ui/src/components/ModelLayers/PerfHintState.js +++ b/skyline-vscode/react-ui/src/components/ModelLayers/PerfHintState.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-anonymous-default-export export default { NONE: 'none', INCREASING: 'increasing', diff --git a/skyline-vscode/react-ui/src/components/ScatterGraph.js b/skyline-vscode/react-ui/src/components/ScatterGraph.js index bfbe5f2..2570a35 100644 --- a/skyline-vscode/react-ui/src/components/ScatterGraph.js +++ b/skyline-vscode/react-ui/src/components/ScatterGraph.js @@ -134,6 +134,7 @@ export const HabitatScatterGraph = ({ habitatData, height }) => { }; const renderCustomizedLabel = (props) => { + // eslint-disable-next-line no-unused-vars const { x, y, width, height, value } = props; const y_offset = 5; return ( diff --git a/skyline-vscode/react-ui/src/components/StackedBarGraph.js b/skyline-vscode/react-ui/src/components/StackedBarGraph.js index b41deef..f6b92b2 100644 --- a/skyline-vscode/react-ui/src/components/StackedBarGraph.js +++ b/skyline-vscode/react-ui/src/components/StackedBarGraph.js @@ -14,6 +14,7 @@ import { } from "recharts"; const renderCustomizedLabel = (props) => { + // eslint-disable-next-line no-unused-vars const { x, y, width, height, value } = props; const Y_OFFSET = 10; diff --git a/skyline-vscode/react-ui/src/utils/utils.js b/skyline-vscode/react-ui/src/utils/utils.js index 85de6ea..1fae669 100644 --- a/skyline-vscode/react-ui/src/utils/utils.js +++ b/skyline-vscode/react-ui/src/utils/utils.js @@ -94,7 +94,7 @@ export function toReadableByteSize(sizeBytes) { } size /= 1024; } - if (index == BYTE_UNITS.length) { + if (index === BYTE_UNITS.length) { index--; } @@ -139,11 +139,11 @@ export function getTraceByLevel(tree) { tree[0]["depth"] = 0; tree_size(0); - let coarseDecomposition = tree.filter(node => { return node["depth"] == 1; }); + let coarseDecomposition = tree.filter(node => { return node["depth"] === 1; }); for (let fineLevel = 1; ; fineLevel ++) { - let fineDecomposition = tree.filter(node => { return node["depth"] == fineLevel; }); + let fineDecomposition = tree.filter(node => { return node["depth"] === fineLevel; }); console.log(`fineLevel: ${fineLevel}, length: ${fineDecomposition.length}`); - if (fineDecomposition.length == 0) return { coarse: coarseDecomposition, fine: coarseDecomposition }; + if (fineDecomposition.length === 0) return { coarse: coarseDecomposition, fine: coarseDecomposition }; if (fineDecomposition.length >= 7) return { coarse: coarseDecomposition, fine: fineDecomposition }; } }