mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Turn on noUnusedLocals, noImplicitReturns, importsNotUsedAsValues: error, and isolatedModules (#2777)
This commit is contained in:
1 parent
489cef9595
commit
5ed4537979
287 files changed
+704
-628
No files matched your search
@@ -20,13 +20,13 @@
|
||||
*/
|
||||
|
||||
import React, { useContext } from "react";
|
||||
import { IClusterMetrics, Node } from "../../api/endpoints";
|
||||
import type { IClusterMetrics, Node } from "../../api/endpoints";
|
||||
import { BarChart, cpuOptions, memoryOptions } from "../chart";
|
||||
import { isMetricsEmpty, normalizeMetrics } from "../../api/endpoints/metrics.api";
|
||||
import { NoMetrics } from "../resource-metrics/no-metrics";
|
||||
import { IResourceMetricsValue, ResourceMetricsContext } from "../resource-metrics";
|
||||
import { observer } from "mobx-react";
|
||||
import { ChartOptions, ChartPoint } from "chart.js";
|
||||
import type { ChartOptions, ChartPoint } from "chart.js";
|
||||
import { ThemeStore } from "../../theme.store";
|
||||
import { mapValues } from "lodash";
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ import { Badge } from "../badge";
|
||||
import { nodesStore } from "./nodes.store";
|
||||
import { ResourceMetrics } from "../resource-metrics";
|
||||
import { podsStore } from "../+workloads-pods/pods.store";
|
||||
import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { Node } from "../../api/endpoints";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object";
|
||||
import type { Node } from "../../api/endpoints";
|
||||
import { NodeCharts } from "./node-charts";
|
||||
import { reaction } from "mobx";
|
||||
import { PodDetailsList } from "../+workloads-pods/pod-details-list";
|
||||
@@ -62,7 +62,7 @@ export class NodeDetails extends React.Component<Props> {
|
||||
render() {
|
||||
const { object: node } = this.props;
|
||||
|
||||
if (!node) return;
|
||||
if (!node) return null;
|
||||
const { status } = node;
|
||||
const { nodeInfo, addresses, capacity, allocatable } = status;
|
||||
const conditions = node.getActiveConditions();
|
||||
|
||||
@@ -62,7 +62,7 @@ export class NodesStore extends KubeObjectStore<Node> {
|
||||
|
||||
getLastMetricValues(node: Node, metricNames: string[]): number[] {
|
||||
if (!this.metricsLoaded) {
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
const nodeName = node.getName();
|
||||
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
import "./nodes.scss";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { RouteComponentProps } from "react-router";
|
||||
import type { RouteComponentProps } from "react-router";
|
||||
import { cssNames, interval } from "../../utils";
|
||||
import { TabLayout } from "../layout/tab-layout";
|
||||
import { nodesStore } from "./nodes.store";
|
||||
import { podsStore } from "../+workloads-pods/pods.store";
|
||||
import { KubeObjectListLayout } from "../kube-object";
|
||||
import { INodesRouteParams } from "./nodes.route";
|
||||
import { Node } from "../../api/endpoints/nodes.api";
|
||||
import type { INodesRouteParams } from "./nodes.route";
|
||||
import type { Node } from "../../api/endpoints/nodes.api";
|
||||
import { LineProgress } from "../line-progress";
|
||||
import { bytesToUnits } from "../../utils/convertMemory";
|
||||
import { Tooltip, TooltipPosition } from "../tooltip";
|
||||
@@ -73,8 +73,8 @@ export class Nodes extends React.Component<Props> {
|
||||
const usage = metrics[0];
|
||||
const cores = metrics[1];
|
||||
const cpuUsagePercent = Math.ceil(usage * 100) / cores;
|
||||
const cpuUsagePercentLabel: String = cpuUsagePercent % 1 === 0
|
||||
? cpuUsagePercent.toString()
|
||||
const cpuUsagePercentLabel: String = cpuUsagePercent % 1 === 0
|
||||
? cpuUsagePercent.toString()
|
||||
: cpuUsagePercent.toFixed(2);
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user