Turn on noUnusedLocals, noImplicitReturns, importsNotUsedAsValues: error, and isolatedModules (#2777)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-05-19 12:11:54 -04:00
1 parent 489cef9595
commit 5ed4537979
287 files changed
+704 -628

No files matched your search

+3 -3
View File
@@ -20,8 +20,8 @@
*/
import { PrometheusLens } from "./lens";
import { CoreV1Api } from "@kubernetes/client-node";
import { PrometheusService } from "./provider-registry";
import type { CoreV1Api } from "@kubernetes/client-node";
import type { PrometheusService } from "./provider-registry";
import logger from "../logger";
export class PrometheusHelm extends PrometheusLens {
@@ -29,7 +29,7 @@ export class PrometheusHelm extends PrometheusLens {
name = "Helm";
rateAccuracy = "5m";
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService> {
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService | void> {
const labelSelector = "app=prometheus,component=server,heritage=Helm";
try {
+4 -4
View File
@@ -19,8 +19,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { PrometheusProvider, PrometheusQueryOpts, PrometheusQuery, PrometheusService } from "./provider-registry";
import { CoreV1Api } from "@kubernetes/client-node";
import type { PrometheusProvider, PrometheusQueryOpts, PrometheusQuery, PrometheusService } from "./provider-registry";
import type { CoreV1Api } from "@kubernetes/client-node";
import logger from "../logger";
export class PrometheusLens implements PrometheusProvider {
@@ -28,7 +28,7 @@ export class PrometheusLens implements PrometheusProvider {
name = "Lens";
rateAccuracy = "1m";
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService> {
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService | void> {
try {
const resp = await client.readNamespacedService("prometheus", "lens-metrics");
const service = resp.body;
@@ -44,7 +44,7 @@ export class PrometheusLens implements PrometheusProvider {
}
}
public getQueries(opts: PrometheusQueryOpts): PrometheusQuery {
public getQueries(opts: PrometheusQueryOpts): PrometheusQuery | void {
switch(opts.category) {
case "cluster":
return {
+4 -4
View File
@@ -19,8 +19,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { PrometheusProvider, PrometheusQueryOpts, PrometheusQuery, PrometheusService } from "./provider-registry";
import { CoreV1Api, V1Service } from "@kubernetes/client-node";
import type { PrometheusProvider, PrometheusQueryOpts, PrometheusQuery, PrometheusService } from "./provider-registry";
import type { CoreV1Api, V1Service } from "@kubernetes/client-node";
import logger from "../logger";
export class PrometheusOperator implements PrometheusProvider {
@@ -28,7 +28,7 @@ export class PrometheusOperator implements PrometheusProvider {
id = "operator";
name = "Prometheus Operator";
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService> {
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService | void> {
try {
let service: V1Service;
@@ -54,7 +54,7 @@ export class PrometheusOperator implements PrometheusProvider {
}
}
public getQueries(opts: PrometheusQueryOpts): PrometheusQuery {
public getQueries(opts: PrometheusQueryOpts): PrometheusQuery | void {
switch(opts.category) {
case "cluster":
return {
+3 -3
View File
@@ -19,7 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { CoreV1Api } from "@kubernetes/client-node";
import type { CoreV1Api } from "@kubernetes/client-node";
export type PrometheusClusterQuery = {
memoryUsage: string;
@@ -83,8 +83,8 @@ export type PrometheusService = {
export interface PrometheusProvider {
id: string;
name: string;
getQueries(opts: PrometheusQueryOpts): PrometheusQuery;
getPrometheusService(client: CoreV1Api): Promise<PrometheusService>;
getQueries(opts: PrometheusQueryOpts): PrometheusQuery | void;
getPrometheusService(client: CoreV1Api): Promise<PrometheusService | void>;
}
export type PrometheusProviderList = {
+4 -4
View File
@@ -19,8 +19,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { PrometheusProvider, PrometheusQueryOpts, PrometheusQuery, PrometheusService } from "./provider-registry";
import { CoreV1Api } from "@kubernetes/client-node";
import type { PrometheusProvider, PrometheusQueryOpts, PrometheusQuery, PrometheusService } from "./provider-registry";
import type { CoreV1Api } from "@kubernetes/client-node";
import logger from "../logger";
export class PrometheusStacklight implements PrometheusProvider {
@@ -28,7 +28,7 @@ export class PrometheusStacklight implements PrometheusProvider {
name = "Stacklight";
rateAccuracy = "1m";
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService> {
public async getPrometheusService(client: CoreV1Api): Promise<PrometheusService | void> {
try {
const resp = await client.readNamespacedService("prometheus-server", "stacklight");
const service = resp.body;
@@ -44,7 +44,7 @@ export class PrometheusStacklight implements PrometheusProvider {
}
}
public getQueries(opts: PrometheusQueryOpts): PrometheusQuery {
public getQueries(opts: PrometheusQueryOpts): PrometheusQuery | void {
switch(opts.category) {
case "cluster":
return {