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 { SNAPSHOT_CUSTOM_AGGREGATIONS } from './constants';
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface DeepPartialArray<T> extends Array<DeepPartial<T>> {}
type DeepPartialArray<T> = Array<DeepPartial<T>>;
type DeepPartialObject<T> = { [P in keyof T]+?: DeepPartial<T[P]> };
export type DeepPartial<T> = T extends any[]

View file

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

View file

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

View file

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

View file

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

View file

@ -50,14 +50,14 @@ export type MetricThresholdRuleTypeState = RuleTypeState & {
groupBy?: string | string[];
};
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;
groupings?: object;
reason?: string;
timestamp: string; // ISO string
value?: Array<number | null> | null;
};
}
export const FIRED_ACTIONS_ID = 'threshold.fired';
export const NO_DATA_ACTIONS_ID = 'threshold.nodata';