chore(ao): remove eslint disable when possible (#164478)

This commit is contained in:
Kevin Delemme 2023-08-24 08:08:03 -04:00 committed by GitHub
parent b270602601
commit 631d9c2bd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 15 deletions

View file

@ -14,8 +14,7 @@ import { metricsExplorerMetricRT } from './metrics_explorer';
import { TimeUnitChar } from '../utils/formatters/duration'; import { TimeUnitChar } from '../utils/formatters/duration';
import { SNAPSHOT_CUSTOM_AGGREGATIONS } from './constants'; import { SNAPSHOT_CUSTOM_AGGREGATIONS } from './constants';
// eslint-disable-next-line @typescript-eslint/no-empty-interface type DeepPartialArray<T> = Array<DeepPartial<T>>;
interface DeepPartialArray<T> extends Array<DeepPartial<T>> {}
type DeepPartialObject<T> = { [P in keyof T]+?: DeepPartial<T[P]> }; type DeepPartialObject<T> = { [P in keyof T]+?: DeepPartial<T[P]> };
export type DeepPartial<T> = T extends any[] export type DeepPartial<T> = T extends any[]

View file

@ -21,8 +21,10 @@ interface Params {
sloIds?: SloId[]; sloIds?: SloId[];
} }
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions export interface SloRule extends Record<string, unknown> {
export type SloRule = { sloId: string; name: string }; sloId: string;
name: string;
}
interface RuleApiResponse { interface RuleApiResponse {
page: number; page: number;

View file

@ -12,16 +12,15 @@ import type { RuleStatus } from '@kbn/triggers-actions-ui-plugin/public';
import { rulesLocatorID } from '../../common'; import { rulesLocatorID } from '../../common';
import { RULES_PATH } from '../../common/locators/paths'; import { RULES_PATH } from '../../common/locators/paths';
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions export interface RulesParams extends SerializableRecord {
export type RulesParams = {
lastResponse?: string[]; lastResponse?: string[];
params?: Record<string, string | number>; params?: Record<string, string | number>;
search?: string; search?: string;
status?: RuleStatus[]; status?: RuleStatus[];
type?: string[]; type?: string[];
}; }
export interface RulesLocatorParams extends RulesParams, SerializableRecord {} export type RulesLocatorParams = RulesParams;
export class RulesLocatorDefinition implements LocatorDefinition<RulesLocatorParams> { export class RulesLocatorDefinition implements LocatorDefinition<RulesLocatorParams> {
public readonly id = rulesLocatorID; public readonly id = rulesLocatorID;

View file

@ -10,10 +10,9 @@ import type { LocatorDefinition } from '@kbn/share-plugin/public';
import { sloDetailsLocatorID } from '../../common'; import { sloDetailsLocatorID } from '../../common';
import { SLOS_PATH } from '../../common/locators/paths'; import { SLOS_PATH } from '../../common/locators/paths';
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions export interface SloDetailsParams {
export type SloDetailsParams = {
sloId?: string; sloId?: string;
}; }
export interface SloDetailsLocatorParams extends SloDetailsParams, SerializableRecord {} export interface SloDetailsLocatorParams extends SloDetailsParams, SerializableRecord {}

View file

@ -37,7 +37,7 @@ interface AlertTestInstance {
state: any; state: any;
} }
let persistAlertInstances = false; // eslint-disable-line prefer-const const persistAlertInstances = false;
type TestRuleState = Record<string, unknown> & { type TestRuleState = Record<string, unknown> & {
aRuleStateKey: string; aRuleStateKey: string;

View file

@ -50,14 +50,14 @@ export type MetricThresholdRuleTypeState = RuleTypeState & {
groupBy?: string | string[]; groupBy?: string | string[];
}; };
export type MetricThresholdAlertState = AlertState; // no specific instance state used export type MetricThresholdAlertState = AlertState; // no specific instance state used
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export type MetricThresholdAlertContext = { export interface MetricThresholdAlertContext extends Record<string, unknown> {
alertDetailsUrl: string; alertDetailsUrl: string;
groupings?: object; groupings?: object;
reason?: string; reason?: string;
timestamp: string; // ISO string timestamp: string; // ISO string
value?: Array<number | null> | null; value?: Array<number | null> | null;
}; }
export const FIRED_ACTIONS_ID = 'threshold.fired'; export const FIRED_ACTIONS_ID = 'threshold.fired';
export const NO_DATA_ACTIONS_ID = 'threshold.nodata'; export const NO_DATA_ACTIONS_ID = 'threshold.nodata';