Skip to content

Commit

Permalink
run eslint --fix after adding a new rule
Browse files Browse the repository at this point in the history
  • Loading branch information
miloszmarcinkowski committed Jan 2, 2025
1 parent e0e6cec commit c00ffd1
Show file tree
Hide file tree
Showing 2,079 changed files with 5,241 additions and 5,154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import t from 'io-ts';
import { agentConfigurationIntakeRt } from './runtime_types/agent_configuration_intake_rt';
import type t from 'io-ts';
import type { agentConfigurationIntakeRt } from './runtime_types/agent_configuration_intake_rt';

export type AgentConfigurationIntake = t.TypeOf<typeof agentConfigurationIntakeRt>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import * as t from 'io-ts';
import { settingDefinitions } from '../setting_definitions';
import { SettingValidation } from '../setting_definitions/types';
import type { SettingValidation } from '../setting_definitions/types';

// retrieve validation from config definitions settings and validate on the server
const knownSettings = settingDefinitions.reduce<Record<string, SettingValidation>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

import * as t from 'io-ts';
import { either } from 'fp-ts/lib/Either';
import moment, { unitOfTime } from 'moment';
import { amountAndUnitToObject, AmountAndUnit } from '../amount_and_unit';
import type { unitOfTime } from 'moment';
import moment from 'moment';
import type { AmountAndUnit } from '../amount_and_unit';
import { amountAndUnitToObject } from '../amount_and_unit';
import { getRangeTypeMessage } from './get_range_type_message';

function toMilliseconds({ amount, unit }: AmountAndUnit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { captureBodyRt } from '../runtime_types/capture_body_rt';
import { logLevelRt } from '../runtime_types/log_level_rt';
import { logEcsReformattingRt } from '../runtime_types/log_ecs_reformatting_rt';
import { traceContinuationStrategyRt } from '../runtime_types/trace_continuation_strategy_rt';
import { RawSettingDefinition } from './types';
import type { RawSettingDefinition } from './types';

export const generalSettings: RawSettingDefinition[] = [
// API Request Size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import { omit } from 'lodash';
import { filterByAgent, settingDefinitions } from '.';
import { AgentName } from '../../../typings/es_schemas/ui/fields/agent';
import { SettingDefinition } from './types';
import type { AgentName } from '../../../typings/es_schemas/ui/fields/agent';
import type { SettingDefinition } from './types';

describe('filterByAgent', () => {
describe('when `excludeAgents` is dotnet and nodejs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import * as t from 'io-ts';
import { sortBy } from 'lodash';
import { isRight } from 'fp-ts/lib/Either';
import { PathReporter } from 'io-ts/lib/PathReporter';
import { AgentName } from '../../../typings/es_schemas/ui/fields/agent';
import type { AgentName } from '../../../typings/es_schemas/ui/fields/agent';
import { booleanRt } from '../runtime_types/boolean_rt';
import { getIntegerRt } from '../runtime_types/integer_rt';
import { isRumOrMobileAgentName } from '../../agent_name';
import { floatThreeDecimalPlacesRt } from '../runtime_types/float_three_decimal_places_rt';
import { floatFourDecimalPlacesRt } from '../runtime_types/float_four_decimal_places_rt';
import { RawSettingDefinition, SettingDefinition } from './types';
import type { RawSettingDefinition, SettingDefinition } from './types';
import { generalSettings } from './general_settings';
import { javaSettings } from './java_settings';
import { mobileSettings } from './mobile_settings';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { i18n } from '@kbn/i18n';
import { RawSettingDefinition } from './types';
import type { RawSettingDefinition } from './types';

export const javaSettings: RawSettingDefinition[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { i18n } from '@kbn/i18n';
import { RawSettingDefinition } from './types';
import type { RawSettingDefinition } from './types';

export const mobileSettings: RawSettingDefinition[] = [
// Session sample rate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import * as t from 'io-ts';
import { AgentName } from '../../../typings/es_schemas/ui/fields/agent';
import type * as t from 'io-ts';
import type { AgentName } from '../../../typings/es_schemas/ui/fields/agent';

// TODO: is it possible to get rid of `any`?
export type SettingValidation = t.Type<any, string, unknown>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { DATAFEED_STATE, JOB_STATE } from '@kbn/ml-plugin/common';
import { Environment } from '../environment_rt';
import type { DATAFEED_STATE, JOB_STATE } from '@kbn/ml-plugin/common';
import type { Environment } from '../environment_rt';

export interface ApmMlJob {
environment: Environment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*/
import { v4 as uuidv4 } from 'uuid';
import { ENVIRONMENT_ALL } from '../environment_filter_values';
import { Environment } from '../environment_rt';
import type { Environment } from '../environment_rt';
import { AnomalyDetectorType } from './apm_ml_detectors';
import { getPreferredServiceAnomalyTimeseries } from './get_preferred_service_anomaly_timeseries';
import { ServiceAnomalyTimeseries } from './service_anomaly_timeseries';
import type { ServiceAnomalyTimeseries } from './service_anomaly_timeseries';

const PROD = 'production' as Environment;
const DEV = 'development' as Environment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* 2.0.
*/

import { Environment } from '../environment_rt';
import { AnomalyDetectorType } from './apm_ml_detectors';
import { ServiceAnomalyTimeseries } from './service_anomaly_timeseries';
import type { Environment } from '../environment_rt';
import type { AnomalyDetectorType } from './apm_ml_detectors';
import type { ServiceAnomalyTimeseries } from './service_anomaly_timeseries';

export function getPreferredServiceAnomalyTimeseries({
preferredEnvironment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n';
import { getSeverityType } from '@kbn/ml-anomaly-utils/get_severity_type';
import { getSeverityColor as mlGetSeverityColor } from '@kbn/ml-anomaly-utils/get_severity_color';
import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity';
import { ServiceHealthStatus } from '../service_health_status';
import type { ServiceHealthStatus } from '../service_health_status';

export interface ServiceAnomalyStats {
transactionType?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { Coordinate } from '../../typings/timeseries';
import { AnomalyDetectorType } from './apm_ml_detectors';
import type { Coordinate } from '../../typings/timeseries';
import type { AnomalyDetectorType } from './apm_ml_detectors';

export interface ServiceAnomalyTimeseries {
jobId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { AgentName } from '../typings/es_schemas/ui/fields/agent';
import { Coordinate } from '../typings/timeseries';
import type { AgentName } from '../typings/es_schemas/ui/fields/agent';
import type { Coordinate } from '../typings/timeseries';

export enum NodeType {
service = 'service',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* 2.0.
*/

import { FieldValuePair, HistogramItem } from '../types';
import type { FieldValuePair, HistogramItem } from '../types';

import { CORRELATIONS_IMPACT_THRESHOLD } from './constants';
import type { CORRELATIONS_IMPACT_THRESHOLD } from './constants';

export interface FailedTransactionsCorrelation extends FieldValuePair {
doc_count: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FieldValuePair, HistogramItem } from '../types';
import type { FieldValuePair, HistogramItem } from '../types';

export interface LatencyCorrelation extends FieldValuePair {
correlation: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { Environment } from '../environment_rt';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { Environment } from '../environment_rt';

export interface FieldValuePair {
fieldName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { apm, ApmFields, dedot } from '@kbn/apm-synthtrace-client';
import type { ApmFields } from '@kbn/apm-synthtrace-client';
import { apm, dedot } from '@kbn/apm-synthtrace-client';
import { getWaterfall } from '../../public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers';
import { Span } from '../../typings/es_schemas/ui/span';
import { Transaction } from '../../typings/es_schemas/ui/transaction';
import type { Span } from '../../typings/es_schemas/ui/span';
import type { Transaction } from '../../typings/es_schemas/ui/transaction';
import { getCriticalPath } from './get_critical_path';

describe('getCriticalPath', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
IWaterfall,
IWaterfallSpanOrTransaction,
} from '../../public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers';
import { CriticalPath, CriticalPathSegment } from './types';
import type { CriticalPath, CriticalPathSegment } from './types';

export function getCriticalPath(waterfall: IWaterfall): CriticalPath {
const segments: CriticalPathSegment[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/
import { extractTemplateVariableNames, getEncodedCustomLinkUrl } from '.';
import { Transaction } from '../../typings/es_schemas/ui/transaction';
import type { Transaction } from '../../typings/es_schemas/ui/transaction';

describe('Custom link', () => {
describe('extractTemplateVariableNames', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* 2.0.
*/

import {
import type {
SERVICE_NAME,
SERVICE_ENVIRONMENT,
TRANSACTION_NAME,
TRANSACTION_TYPE,
} from '../es_fields/apm';
import { FILTER_OPTIONS } from './custom_link_filter_options';
import type { FILTER_OPTIONS } from './custom_link_filter_options';

export interface CustomLinkES {
id?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n';
import { get } from 'lodash';
import { set } from '@kbn/safer-lodash-set';
import Mustache from 'mustache';
import { Transaction } from '../../typings/es_schemas/ui/transaction';
import type { Transaction } from '../../typings/es_schemas/ui/transaction';

export const INVALID_LICENSE = i18n.translate('xpack.apm.settings.customLink.license.text', {
defaultMessage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { i18n } from '@kbn/i18n';
import { escapeKuery } from '@kbn/es-query';
import { SERVICE_ENVIRONMENT } from './es_fields/apm';
import { Environment } from './environment_rt';
import type { Environment } from './environment_rt';

export const ENVIRONMENT_ALL_VALUE = 'ENVIRONMENT_ALL' as const;
const ENVIRONMENT_NOT_DEFINED_VALUE = 'ENVIRONMENT_NOT_DEFINED' as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*/

import { get } from 'lodash';
import { AllowUnknownProperties } from '../../typings/common';
import { APMError } from '../../typings/es_schemas/ui/apm_error';
import { Span } from '../../typings/es_schemas/ui/span';
import { Transaction } from '../../typings/es_schemas/ui/transaction';
import type { AllowUnknownProperties } from '../../typings/common';
import type { APMError } from '../../typings/es_schemas/ui/apm_error';
import type { Span } from '../../typings/es_schemas/ui/span';
import type { Transaction } from '../../typings/es_schemas/ui/transaction';
import * as allApmFieldNames from './apm';
import * as infraMetricsFieldNames from './infra_metrics';

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

import { ILicense, LicenseType } from '@kbn/licensing-plugin/common/types';
import type { ILicense, LicenseType } from '@kbn/licensing-plugin/common/types';

function isActiveLicense(licenseType: LicenseType, license?: ILicense) {
return license && license.isActive && license.hasAtLeast(licenseType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* 2.0.
*/

import { schema, TypeOf } from '@kbn/config-schema';
import type { TypeOf } from '@kbn/config-schema';
import { schema } from '@kbn/config-schema';
import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity';
import { ApmRuleType } from '@kbn/rule-data-utils';
import type { ApmRuleType } from '@kbn/rule-data-utils';
import { AnomalyDetectorType } from '../anomaly_detection/apm_ml_detectors';
import { AggregationType } from './apm_rule_types';

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

import { AgentName } from '@kbn/elastic-agent-utils';
import { ServiceHealthStatus } from './service_health_status';
import type { AgentName } from '@kbn/elastic-agent-utils';
import type { ServiceHealthStatus } from './service_health_status';

export interface ServiceListItem {
serviceName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import { i18n } from '@kbn/i18n';
import cytoscape from 'cytoscape';
import { Coordinate } from '../typings/timeseries';
import { ServiceAnomalyStats } from './anomaly_detection';
import type cytoscape from 'cytoscape';
import type { Coordinate } from '../typings/timeseries';
import type { ServiceAnomalyStats } from './anomaly_detection';

// These should be imported, but until TypeScript 4.2 we're inlining them here.
// All instances of "agent.name", "service.name", "service.environment", "span.type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { AgentName } from '../typings/es_schemas/ui/fields/agent';
import { Environment } from './environment_rt';
import type { AgentName } from '../typings/es_schemas/ui/fields/agent';
import type { Environment } from './environment_rt';

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

import { i18n } from '@kbn/i18n';
import { CustomIntegration } from '@kbn/custom-integrations-plugin/common';
import type { CustomIntegration } from '@kbn/custom-integrations-plugin/common';

const APM_INTEGRATION_CATEGORIES = ['observability', 'apm'];

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

import { ValuesType } from 'utility-types';
import type { ValuesType } from 'utility-types';

// work around a TypeScript limitation described in https://stackoverflow.com/posts/49511416

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

import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { SERVICE_ENVIRONMENT, SERVICE_NODE_NAME } from '../es_fields/apm';
import { ENVIRONMENT_ALL, ENVIRONMENT_NOT_DEFINED } from '../environment_filter_values';
import { SERVICE_NODE_NAME_MISSING } from '../service_nodes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { compact, isObject } from 'lodash';
import { Maybe } from '../../typings/common';
import type { Maybe } from '../../typings/common';

export interface KeyValuePair {
key: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import moment from 'moment';
import { memoize } from 'lodash';
import { NOT_AVAILABLE_LABEL } from '../../i18n';
import { asDecimalOrInteger, asInteger, asDecimal } from './formatters';
import { TimeUnit } from './datetime';
import { Maybe } from '../../../typings/common';
import type { TimeUnit } from './datetime';
import type { Maybe } from '../../../typings/common';
import { isFiniteNumber } from '../is_finite_number';

interface FormatterOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { asPercent as obltAsPercent } from '@kbn/observability-plugin/common';
import numeral from '@elastic/numeral';
import { Maybe } from '../../../typings/common';
import type { Maybe } from '../../../typings/common';
import { NOT_AVAILABLE_LABEL } from '../../i18n';
import { isFiniteNumber } from '../is_finite_number';

Expand Down
Loading

0 comments on commit c00ffd1

Please sign in to comment.