Skip to content

Commit

Permalink
Merge branch 'ro_linting_rules_1' of github.com:cnasikas/kibana into …
Browse files Browse the repository at this point in the history
…ro_linting_rules_1
  • Loading branch information
cnasikas committed Nov 4, 2024
2 parents 21ea0ae + 6ec3136 commit a6b72f3
Show file tree
Hide file tree
Showing 779 changed files with 2,536 additions and 2,513 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { ClusterPutComponentTemplateRequest } from '@elastic/elasticsearch/lib/api/types';
import type { ClusterPutComponentTemplateRequest } from '@elastic/elasticsearch/lib/api/types';
import { type FieldMap } from '@kbn/alerts-as-data-utils';
import { mappingFromFieldMap } from './mapping_from_field_map';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/common/bulk_edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { Rule } from './rule';
import type { Rule } from './rule';

export type BulkEditSkipReason = 'RULE_NOT_MODIFIED';

Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/alerting/common/maintenance_window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/
import type { IUiSettingsClient, Logger, SavedObjectsClientContract } from '@kbn/core/server';
import { FilterStateStore } from '@kbn/es-query';
import { RRuleParams } from './rrule_type';
import type { FilterStateStore } from '@kbn/es-query';
import type { RRuleParams } from './rrule_type';

export enum MaintenanceWindowStatus {
Running = 'running',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting/common/parse_duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function validateDurationSchema(duration: string) {
if (duration.match(DAYS_REGEX)) {
return;
}
return 'string is not a valid duration: ' + duration;
return `string is not a valid duration: ${duration}`;
}

function isSeconds(duration: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { deleteParamsSchemaV1 } from '..';
import type { deleteParamsSchemaV1 } from '..';

export type DeleteBackfillRequestParams = TypeOf<typeof deleteParamsSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { findQuerySchemaV1, findResponseSchemaV1 } from '..';
import type { findQuerySchemaV1, findResponseSchemaV1 } from '..';

export type FindBackfillRequestQuery = TypeOf<typeof findQuerySchemaV1>;
export type FindBackfillResponseBody = TypeOf<typeof findResponseSchemaV1>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { getParamsSchemaV1, getResponseSchemaV1 } from '..';
import type { getParamsSchemaV1, getResponseSchemaV1 } from '..';

export type GetBackfillRequestParams = TypeOf<typeof getParamsSchemaV1>;
export type GetBackfillResponseBody = TypeOf<typeof getResponseSchemaV1>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { scheduleBodySchemaV1, scheduleResponseSchemaV1 } from '..';
import type { scheduleBodySchemaV1, scheduleResponseSchemaV1 } from '..';

export type ScheduleBackfillRequestBody = TypeOf<typeof scheduleBodySchemaV1>;
export type ScheduleBackfillResponseBody = TypeOf<typeof scheduleResponseSchemaV1>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { backfillResponseSchemaV1, errorResponseSchemaV1 } from '..';
import type { backfillResponseSchemaV1, errorResponseSchemaV1 } from '..';

export type BackfillResponse = TypeOf<typeof backfillResponseSchemaV1>;
export type ErrorResponse = TypeOf<typeof errorResponseSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import type { TypeOf } from '@kbn/config-schema';

import { healthFrameworkResponseBodySchemaV1, healthFrameworkResponseSchemaV1 } from '..';
import type { healthFrameworkResponseBodySchemaV1, healthFrameworkResponseSchemaV1 } from '..';

export type HealthFrameworkResponseBody = TypeOf<typeof healthFrameworkResponseBodySchemaV1>;
export type HealthFrameworkResponse = TypeOf<typeof healthFrameworkResponseSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { MaintenanceWindowResponseV1 } from '../../../response';
import { archiveBodySchemaV1, archiveParamsSchemaV1 } from '..';
import type { MaintenanceWindowResponseV1 } from '../../../response';
import type { archiveBodySchemaV1, archiveParamsSchemaV1 } from '..';

export type ArchiveMaintenanceWindowRequestBody = TypeOf<typeof archiveBodySchemaV1>;
export type ArchiveMaintenanceWindowRequestParams = TypeOf<typeof archiveParamsSchemaV1>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { MaintenanceWindowResponseV1 } from '../../../response';
import { bulkGetBodySchemaV1 } from '..';
import type { MaintenanceWindowResponseV1 } from '../../../response';
import type { bulkGetBodySchemaV1 } from '..';

export type BulkGetMaintenanceWindowsRequestBody = TypeOf<typeof bulkGetBodySchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { MaintenanceWindowResponseV1 } from '../../../response';
import { createBodySchemaV1 } from '..';
import type { MaintenanceWindowResponseV1 } from '../../../response';
import type { createBodySchemaV1 } from '..';

export type CreateMaintenanceWindowRequestBody = TypeOf<typeof createBodySchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { deleteParamsSchemaV1 } from '..';
import type { deleteParamsSchemaV1 } from '..';

export type DeleteMaintenanceWindowRequestParams = TypeOf<typeof deleteParamsSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { TypeOf } from '@kbn/config-schema';
import {
import type { TypeOf } from '@kbn/config-schema';
import type {
findMaintenanceWindowsResponseBodySchema,
findMaintenanceWindowsRequestQuerySchema,
} from '..';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { MaintenanceWindowResponseV1 } from '../../../response';
import { finishParamsSchemaV1 } from '..';
import type { MaintenanceWindowResponseV1 } from '../../../response';
import type { finishParamsSchemaV1 } from '..';

export type FinishMaintenanceWindowRequestParams = TypeOf<typeof finishParamsSchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { MaintenanceWindowResponseV1 } from '../../../response';
import { getParamsSchemaV1 } from '..';
import type { MaintenanceWindowResponseV1 } from '../../../response';
import type { getParamsSchemaV1 } from '..';

export type GetMaintenanceWindowRequestParams = TypeOf<typeof getParamsSchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { MaintenanceWindowResponseV1 } from '../../../response';
import type { MaintenanceWindowResponseV1 } from '../../../response';

export interface GetActiveMaintenanceWindowsResponse {
body: MaintenanceWindowResponseV1[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { MaintenanceWindowResponseV1 } from '../../../response';
import { updateParamsSchemaV1, updateBodySchemaV1 } from '..';
import type { MaintenanceWindowResponseV1 } from '../../../response';
import type { updateParamsSchemaV1, updateBodySchemaV1 } from '..';

export type UpdateMaintenanceWindowRequestParams = TypeOf<typeof updateParamsSchemaV1>;
export type UpdateMaintenanceWindowRequestBody = TypeOf<typeof updateBodySchemaV1>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { maintenanceWindowResponseSchemaV1 } from '..';
import type { maintenanceWindowResponseSchemaV1 } from '..';

export type MaintenanceWindowResponse = TypeOf<typeof maintenanceWindowResponseSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { maintenanceWindowCategoryIdsSchemaV1 } from '..';
import type { maintenanceWindowCategoryIdsSchemaV1 } from '..';

export type MaintenanceWindowCategoryIds = TypeOf<typeof maintenanceWindowCategoryIdsSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { rRuleRequestSchemaV1 } from '../..';
import type { rRuleRequestSchemaV1 } from '../..';

export type RRuleRequest = TypeOf<typeof rRuleRequestSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { rRuleResponseSchemaV1 } from '../..';
import type { rRuleResponseSchemaV1 } from '../..';

export type RRuleResponse = TypeOf<typeof rRuleResponseSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ export const validateEndDate = (date: string) => {
const parsedValue = Date.parse(date);
if (isNaN(parsedValue)) return `Invalid date: ${date}`;
if (parsedValue <= Date.now()) return `Invalid snooze date as it is in the past: ${date}`;
return;
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
export const validateStartDate = (date: string) => {
const parsedValue = Date.parse(date);
if (isNaN(parsedValue)) return `Invalid date: ${date}`;
return;
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { aggregateRulesRequestBodySchemaV1, aggregateRulesResponseBodySchemaV1 } from '..';
import type { aggregateRulesRequestBodySchemaV1, aggregateRulesResponseBodySchemaV1 } from '..';

export type AggregateRulesRequestBody = TypeOf<typeof aggregateRulesRequestBodySchemaV1>;
export type AggregateRulesResponseBody = TypeOf<typeof aggregateRulesResponseBodySchemaV1>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { bulkDeleteRulesRequestBodySchemaV1 } from '..';
import { RuleParamsV1, RuleResponseV1 } from '../../../response';
import type { bulkDeleteRulesRequestBodySchemaV1 } from '..';
import type { RuleParamsV1, RuleResponseV1 } from '../../../response';

export interface BulkOperationError {
message: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import Boom from '@hapi/boom';
import { BulkDeleteRulesRequestBody } from '..';
import type { BulkDeleteRulesRequestBody } from '..';

export const validateBulkDeleteRulesBody = (options: BulkDeleteRulesRequestBody) => {
const filter = options.filter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { bulkDisableRulesRequestBodySchemaV1 } from '..';
import { RuleParamsV1, RuleResponseV1 } from '../../../response';
import type { bulkDisableRulesRequestBodySchemaV1 } from '..';
import type { RuleParamsV1, RuleResponseV1 } from '../../../response';

export interface BulkOperationError {
message: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import Boom from '@hapi/boom';
import { BulkDisableRulesRequestBody } from '..';
import type { BulkDisableRulesRequestBody } from '..';

export const validateBulkDisableRulesBody = (options: BulkDisableRulesRequestBody) => {
const filter = options.filter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { RuleParamsV1, RuleResponseV1 } from '../../../response';
import { bulkEditRulesRequestBodySchemaV1 } from '..';
import type { RuleParamsV1, RuleResponseV1 } from '../../../response';
import type { bulkEditRulesRequestBodySchemaV1 } from '..';

export type BulkEditRulesRequestBody = TypeOf<typeof bulkEditRulesRequestBodySchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { RuleParamsV1, RuleResponseV1 } from '../../../response';
import { bulkEnableBodySchemaV1 } from '..';
import type { RuleParamsV1, RuleResponseV1 } from '../../../response';
import type { bulkEnableBodySchemaV1 } from '..';

export type BulkEnableRulesRequestBody = TypeOf<typeof bulkEnableBodySchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { bulkUntrackBodySchemaV1 } from '..';
import type { bulkUntrackBodySchemaV1 } from '..';

export type BulkUntrackRequestBody = TypeOf<typeof bulkUntrackBodySchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { bulkUntrackByQueryBodySchemaV1 } from '..';
import type { bulkUntrackByQueryBodySchemaV1 } from '..';

export type BulkUntrackByQueryRequestBody = TypeOf<typeof bulkUntrackByQueryBodySchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { RuleParamsV1, RuleResponseV1 } from '../../../response';
import { cloneRuleRequestParamsSchemaV1 } from '..';
import type { RuleParamsV1, RuleResponseV1 } from '../../../response';
import type { cloneRuleRequestParamsSchemaV1 } from '..';

export type CloneRuleRequestParams = TypeOf<typeof cloneRuleRequestParamsSchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { RuleParamsV1, RuleResponseV1 } from '../../../response';
import {
import type { RuleParamsV1, RuleResponseV1 } from '../../../response';
import type {
actionSchemaV1,
actionFrequencySchemaV1,
createParamsSchemaV1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { deleteRuleRequestParamsSchemaV1 } from '..';
import type { deleteRuleRequestParamsSchemaV1 } from '..';

export type DeleteRuleRequestParams = TypeOf<typeof deleteRuleRequestParamsSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/
import type { TypeOf } from '@kbn/config-schema';
import { disableRuleRequestBodySchemaV1, disableRuleRequestParamsSchemaV1 } from '..';
import type { disableRuleRequestBodySchemaV1, disableRuleRequestParamsSchemaV1 } from '..';

export type DisableRuleRequestBody = TypeOf<typeof disableRuleRequestBodySchemaV1>;
export type DisableRuleRequestParams = TypeOf<typeof disableRuleRequestParamsSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { enableRuleRequestParamsSchemaV1 } from '..';
import type { enableRuleRequestParamsSchemaV1 } from '..';

export type EnableRuleRequestParams = TypeOf<typeof enableRuleRequestParamsSchemaV1>;
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { RuleParamsV1, RuleResponseV1 } from '../../../response';
import { findRulesRequestQuerySchemaV1 } from '..';
import type { RuleParamsV1, RuleResponseV1 } from '../../../response';
import type { findRulesRequestQuerySchemaV1 } from '..';

export type FindRulesRequestQuery = TypeOf<typeof findRulesRequestQuerySchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { RuleParamsV1, RuleResponseV1 } from '../../../response';
import { getRuleRequestParamsSchemaV1 } from '..';
import type { RuleParamsV1, RuleResponseV1 } from '../../../response';
import type { getRuleRequestParamsSchemaV1 } from '..';

export type GetRuleRequestParams = TypeOf<typeof getRuleRequestParamsSchemaV1>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
*/

import type { TypeOf } from '@kbn/config-schema';
import { getScheduleFrequencyResponseSchemaV1, getScheduleFrequencyResponseBodySchemaV1 } from '..';
import type {
getScheduleFrequencyResponseSchemaV1,
getScheduleFrequencyResponseBodySchemaV1,
} from '..';

export type GetScheduleFrequencyResponseBody = TypeOf<
typeof getScheduleFrequencyResponseBodySchemaV1
Expand Down
Loading

0 comments on commit a6b72f3

Please sign in to comment.