Add eslint:recommended lint rule (#4577)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-01-07 08:38:21 -05:00
1 parent 4f75acf2b4
commit fa3708c879
27 files changed
+88 -57

No files matched your search

+3 -1
View File
@@ -162,7 +162,8 @@ export class CustomResourceDefinition extends KubeObject {
}
}
break;
case "apiextensions.k8s.io/v1beta1":
case "apiextensions.k8s.io/v1beta1": {
const { additionalPrinterColumns: apc } = this.spec;
const additionalPrinterColumns = apc?.map(({ JSONPath, ...apc }) => ({ ...apc, jsonPath: JSONPath }));
@@ -173,6 +174,7 @@ export class CustomResourceDefinition extends KubeObject {
schema: this.spec.validation,
additionalPrinterColumns,
};
}
}
throw new Error(`Unknown apiVersion=${apiVersion}: Failed to find a version for CustomResourceDefinition ${this.metadata.name}`);
+1 -1
View File
@@ -187,7 +187,7 @@ export class Ingress extends KubeObject {
const servicePort = defaultBackend?.service.port.number ?? backend?.servicePort;
if (rules && rules.length > 0) {
if (rules.some(rule => rule.hasOwnProperty("http"))) {
if (rules.some(rule => Object.prototype.hasOwnProperty.call(rule, "http"))) {
ports.push(httpPort);
}
} else if (servicePort !== undefined) {
+2 -1
View File
@@ -184,7 +184,8 @@ export function getMetricLastPoints(metrics: Record<string, IMetrics>) {
if (metric.data.result.length) {
result[metricName] = +metric.data.result[0].values.slice(-1)[0][1];
}
} catch (e) {
} catch {
// ignore error
}
return result;