Upgrade prettier dependencies (#188032)

## Summary

- Upgrade `prettier` to `v2.8.x`.
- Upgrade related decencies.
- Adds `prettier` group to renovate config.
- Fixes bootstrapping type error.

## Main Changes

### Add parentheses for `TypeofTypeAnnotation` to improve readability

[link](https://github.com/prettier/prettier/blob/main/CHANGELOG.md#add-parentheses-for-typeoftypeannotation-to-improve-readability-14458-by-fisker)

```ts
// Input
type A = (typeof node.children)[];

// Prettier 2.8.4
type A = typeof node.children[];

// Prettier 2.8.5
type A = (typeof node.children)[];
```

### Add parentheses to head of `ExpressionStatement` instead of the
whole statement


[link](https://github.com/prettier/prettier/blob/main/CHANGELOG.md#add-parentheses-to-head-of-expressionstatement-instead-of-the-whole-statement-14077-by-fisker)

```ts
// Input
({}).toString.call(foo) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo);

// Prettier 2.8.1
({}.toString.call(foo) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo));

// Prettier 2.8.2
({}).toString.call(foo.forEach) === "[object Array]"
  ? foo.forEach(iterateArray)
  : iterateObject(foo);
```

## Details

This started because I noticed we were on `typescript@^5` but still on
an old prettier that complained about use of new TS features such as
[`satisfies`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#the-satisfies-operator).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Nick Partridge 2024-07-24 09:29:05 -07:00 committed by GitHub
parent b4d1bc5dd7
commit 49a985625b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
269 changed files with 628 additions and 590 deletions

View file

@ -12,7 +12,7 @@ import { type ReducerStreamApiAction, API_ACTION_NAME } from './reducer_actions'
export const UI_ACTION_NAME = {
RESET: 'reset',
} as const;
export type UiActionName = typeof UI_ACTION_NAME[keyof typeof UI_ACTION_NAME];
export type UiActionName = (typeof UI_ACTION_NAME)[keyof typeof UI_ACTION_NAME];
interface UiActionResetStream {
type: typeof UI_ACTION_NAME.RESET;

View file

@ -12,7 +12,7 @@ export const API_ACTION_NAME = {
DELETE_ENTITY: 'delete_entity',
ERROR: 'error',
} as const;
export type ApiActionName = typeof API_ACTION_NAME[keyof typeof API_ACTION_NAME];
export type ApiActionName = (typeof API_ACTION_NAME)[keyof typeof API_ACTION_NAME];
interface ApiActionUpdateProgress {
type: typeof API_ACTION_NAME.UPDATE_PROGRESS;

View file

@ -42,5 +42,5 @@ export const dataSlice = createSlice({
export const { updateProgress, addToEntity, deleteEntity, error, reset } = dataSlice.actions;
export type ReduxStreamApiAction = ReturnType<
typeof dataSlice.actions[keyof typeof dataSlice.actions]
(typeof dataSlice.actions)[keyof typeof dataSlice.actions]
>;

View file

@ -33,5 +33,5 @@ export const optionsSlice = createSlice({
export const { setSimulateErrors, setCompressResponse, setFlushFix } = optionsSlice.actions;
export type ReduxOptionsApiAction = ReturnType<
typeof optionsSlice.actions[keyof typeof optionsSlice.actions]
(typeof optionsSlice.actions)[keyof typeof optionsSlice.actions]
>;

View file

@ -1542,7 +1542,6 @@
"@types/pidusage": "^2.0.2",
"@types/pixelmatch": "^5.2.4",
"@types/pngjs": "^3.4.0",
"@types/prettier": "^2.3.2",
"@types/prop-types": "^15.7.5",
"@types/rbush": "^3.0.0",
"@types/react": "^17.0.45",
@ -1635,7 +1634,7 @@
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ban": "^1.6.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-eslint-comments": "^3.2.0",
@ -1646,7 +1645,7 @@
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-no-unsanitized": "^4.0.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-perf": "^3.3.1",
@ -1724,7 +1723,7 @@
"postcss-loader": "^4.2.0",
"postcss-prefix-selector": "^1.16.0",
"postcss-scss": "^4.0.4",
"prettier": "^2.7.1",
"prettier": "^2.8.0",
"proxy": "^2.1.1",
"q": "^1.5.1",
"raw-loader": "^3.1.0",

View file

@ -65,7 +65,7 @@ interface FullStoryUserVars {
cloudTrialEndDate?: string;
}
type FullStoryPageContext = Pick<EventContext, typeof PAGE_VARS_KEYS[number]>;
type FullStoryPageContext = Pick<EventContext, (typeof PAGE_VARS_KEYS)[number]>;
/**
* FullStory shipper.

View file

@ -53,7 +53,7 @@ interface BatcherMemory<Data, Query> {
*/
export const createBatcher = <Data, Query, R = Data>(
config: BatcherConfig<Data, Query, R>
): Batcher<Data, Query, ReturnType<typeof config['resolver']>> => {
): Batcher<Data, Query, ReturnType<(typeof config)['resolver']>> => {
const mem: BatcherMemory<Data, Query> = {
batch: new Set<Query>(),
currentRequest: deferred<Data>(),

View file

@ -104,7 +104,10 @@ export type SideNavNodeStatus = 'hidden' | 'visible';
export type RenderAs = 'block' | 'accordion' | 'panelOpener' | 'item';
export type EuiThemeSize = Exclude<typeof EuiThemeSizes[number], 'base' | 'xxs' | 'xxxl' | 'xxxxl'>;
export type EuiThemeSize = Exclude<
(typeof EuiThemeSizes)[number],
'base' | 'xxs' | 'xxxl' | 'xxxxl'
>;
export type GetIsActiveFn = (params: {
/** The current path name including the basePath + hash value but **without** any query params */

View file

@ -265,7 +265,7 @@ export class CoreKibanaRequest<
parse,
maxBytes,
accepts: allow,
output: output as typeof validBodyOutput[number], // We do not support all the HAPI-supported outputs and TS complains
output: output as (typeof validBodyOutput)[number], // We do not support all the HAPI-supported outputs and TS complains
},
} as unknown as KibanaRequestRouteOptions<Method>; // TS does not understand this is OK so I'm enforced to do this enforced casting

View file

@ -86,7 +86,7 @@ export interface RouteConfigOptionsBody {
*
* Default value: 'data', unless no validation.body is provided in the route definition. In that case the default is 'stream' to alleviate memory pressure.
*/
output?: typeof validBodyOutput[number];
output?: (typeof validBodyOutput)[number];
/**
* Determines if the incoming payload is processed or presented raw. Available values:

View file

@ -324,9 +324,12 @@ export interface AsyncPlugin<
* @public
*/
export type SharedGlobalConfig = RecursiveReadonly<{
elasticsearch: Pick<ElasticsearchConfigType, typeof SharedGlobalConfigKeys.elasticsearch[number]>;
path: Pick<PathConfigType, typeof SharedGlobalConfigKeys.path[number]>;
savedObjects: Pick<SavedObjectsConfigType, typeof SharedGlobalConfigKeys.savedObjects[number]>;
elasticsearch: Pick<
ElasticsearchConfigType,
(typeof SharedGlobalConfigKeys.elasticsearch)[number]
>;
path: Pick<PathConfigType, (typeof SharedGlobalConfigKeys.path)[number]>;
savedObjects: Pick<SavedObjectsConfigType, (typeof SharedGlobalConfigKeys.savedObjects)[number]>;
}>;
/**

View file

@ -21,7 +21,7 @@ export const VALID_SERVERLESS_PROJECT_TYPES = ['es', 'oblt', 'security'];
const serverlessConfigSchema = schema.maybe(
schema.oneOf(
VALID_SERVERLESS_PROJECT_TYPES.map((projectName) => schema.literal(projectName)) as [
Type<typeof VALID_SERVERLESS_PROJECT_TYPES[number]> // This cast is needed because it's different to Type<T>[] :sight:
Type<(typeof VALID_SERVERLESS_PROJECT_TYPES)[number]> // This cast is needed because it's different to Type<T>[] :sight:
]
)
);

View file

@ -27,7 +27,7 @@ jest.mock('../utils/find_shared_origin_objects', () => {
});
export const mockRawDocExistsInNamespace = jest.fn() as jest.MockedFunction<
typeof InternalUtils['rawDocExistsInNamespace']
(typeof InternalUtils)['rawDocExistsInNamespace']
>;
jest.mock('../utils/internal_utils', () => {

View file

@ -10,10 +10,10 @@ import type { isNotFoundFromUnsupportedServer } from '@kbn/core-elasticsearch-se
import type * as InternalUtils from '../utils/internal_utils';
export const mockGetSavedObjectFromSource = jest.fn() as jest.MockedFunction<
typeof InternalUtils['getSavedObjectFromSource']
(typeof InternalUtils)['getSavedObjectFromSource']
>;
export const mockRawDocExistsInNamespace = jest.fn() as jest.MockedFunction<
typeof InternalUtils['rawDocExistsInNamespace']
(typeof InternalUtils)['rawDocExistsInNamespace']
>;
jest.mock('../utils/internal_utils', () => {

View file

@ -18,7 +18,7 @@ jest.mock('./find_legacy_url_aliases', () => {
});
export const mockRawDocExistsInNamespaces = jest.fn() as jest.MockedFunction<
typeof InternalUtils['rawDocExistsInNamespaces']
(typeof InternalUtils)['rawDocExistsInNamespaces']
>;
jest.mock('../utils/internal_utils', () => {

View file

@ -10,13 +10,13 @@ import type * as InternalUtils from '../utils/internal_utils';
import type { deleteLegacyUrlAliases } from './delete_legacy_url_aliases';
export const mockGetBulkOperationError = jest.fn() as jest.MockedFunction<
typeof InternalUtils['getBulkOperationError']
(typeof InternalUtils)['getBulkOperationError']
>;
export const mockGetExpectedVersionProperties = jest.fn() as jest.MockedFunction<
typeof InternalUtils['getExpectedVersionProperties']
(typeof InternalUtils)['getExpectedVersionProperties']
>;
export const mockRawDocExistsInNamespace = jest.fn() as jest.MockedFunction<
typeof InternalUtils['rawDocExistsInNamespace']
(typeof InternalUtils)['rawDocExistsInNamespace']
>;
jest.mock('../utils/internal_utils', () => {

View file

@ -29,10 +29,10 @@ jest.mock('./apis/internals/internal_bulk_resolve', () => ({
}));
export const mockGetBulkOperationError = jest.fn() as jest.MockedFunction<
typeof InternalUtils['getBulkOperationError']
(typeof InternalUtils)['getBulkOperationError']
>;
export const mockGetCurrentTime = jest.fn() as jest.MockedFunction<
typeof InternalUtils['getCurrentTime']
(typeof InternalUtils)['getCurrentTime']
>;
jest.mock('./apis/utils/internal_utils', () => {

View file

@ -26,7 +26,7 @@ const methods = [
'updateByQuery',
] as const;
type MethodName = typeof methods[number];
type MethodName = (typeof methods)[number];
export type RepositoryEsClient = Pick<ElasticsearchClient, MethodName | 'transport'>;

View file

@ -63,7 +63,7 @@ const obj4Error = getResultMock.invalidType(obj4.type, obj4.id);
describe('#checkConflicts', () => {
let savedObjectsClient: jest.Mocked<SavedObjectsClientContract>;
let socCheckConflicts: typeof savedObjectsClient['checkConflicts'];
let socCheckConflicts: (typeof savedObjectsClient)['checkConflicts'];
const setupParams = (partial: {
objects: SavedObjectType[];

View file

@ -53,7 +53,7 @@ const OTHER_TYPE = 'other';
describe('#checkOriginConflicts', () => {
let savedObjectsClient: jest.Mocked<SavedObjectsClientContract>;
let typeRegistry: jest.Mocked<ISavedObjectTypeRegistry>;
let find: typeof savedObjectsClient['find'];
let find: (typeof savedObjectsClient)['find'];
const getResultMock = (...objects: SavedObjectType[]) => ({
page: 1,

View file

@ -24,7 +24,7 @@ const OTHER_TYPE = 'other';
describe('checkReferenceOrigins', () => {
let savedObjectsClient: jest.Mocked<SavedObjectsClientContract>;
let typeRegistry: jest.Mocked<ISavedObjectTypeRegistry>;
let find: typeof savedObjectsClient['find'];
let find: (typeof savedObjectsClient)['find'];
const getResultMock = (...objectIds: string[]) => ({
page: 1,

View file

@ -102,7 +102,7 @@ const legacyUrlAliasForObj10 = createLegacyUrlAliasObject(obj10.originId!, obj10
describe('#createSavedObjects', () => {
let savedObjectsClient: jest.Mocked<SavedObjectsClientContract>;
let bulkCreate: typeof savedObjectsClient['bulkCreate'];
let bulkCreate: (typeof savedObjectsClient)['bulkCreate'];
/**
* Creates an options object to be used as an argument for createSavedObjects

View file

@ -343,7 +343,7 @@ export const next = (
// instead of the union.
const nextAction = map[state.controlState] as (
state: State
) => ReturnType<typeof map[AllActionStates]>;
) => ReturnType<(typeof map)[AllActionStates]>;
return delay(nextAction(state));
}
};

View file

@ -205,7 +205,7 @@ export const next = (context: MigratorContext) => {
// instead of the union.
const nextAction = map[state.controlState] as (
state: State
) => ReturnType<typeof map[AllActionStates]>;
) => ReturnType<(typeof map)[AllActionStates]>;
return delay(nextAction(state));
}
};

View file

@ -105,4 +105,4 @@ export const ServiceStatusLevels = deepFreeze({
* A convenience type that represents the union of each value in {@link ServiceStatusLevels}.
* @public
*/
export type ServiceStatusLevel = typeof ServiceStatusLevels[keyof typeof ServiceStatusLevels];
export type ServiceStatusLevel = (typeof ServiceStatusLevels)[keyof typeof ServiceStatusLevels];

View file

@ -18,4 +18,4 @@ export const RecoveredActionGroup: Readonly<ActionGroup<'recovered'>> = Object.f
export type DefaultActionGroupId = 'default';
export type RecoveredActionGroupId = typeof RecoveredActionGroup['id'];
export type RecoveredActionGroupId = (typeof RecoveredActionGroup)['id'];

View file

@ -12,7 +12,7 @@ export const RuleNotifyWhenTypeValues = [
'onThrottleInterval',
] as const;
export type RuleNotifyWhenType = typeof RuleNotifyWhenTypeValues[number];
export type RuleNotifyWhenType = (typeof RuleNotifyWhenTypeValues)[number];
export enum RuleNotifyWhen {
CHANGE = 'onActionGroupChange',

View file

@ -19,7 +19,7 @@ export type RuleActionParams = SavedObjectAttributes;
export type RuleActionParam = SavedObjectAttribute;
export const ISO_WEEKDAYS = [1, 2, 3, 4, 5, 6, 7] as const;
export type IsoWeekday = typeof ISO_WEEKDAYS[number];
export type IsoWeekday = (typeof ISO_WEEKDAYS)[number];
export interface IntervalSchedule extends SavedObjectAttributes {
interval: string;
@ -104,8 +104,8 @@ export enum RuleExecutionStatusWarningReasons {
MAX_QUEUED_ACTIONS = 'maxQueuedActions',
}
export type RuleExecutionStatuses = typeof RuleExecutionStatusValues[number];
export type RuleLastRunOutcomes = typeof RuleLastRunOutcomeValues[number];
export type RuleExecutionStatuses = (typeof RuleExecutionStatusValues)[number];
export type RuleLastRunOutcomes = (typeof RuleLastRunOutcomeValues)[number];
export interface RuleExecutionStatus {
status: RuleExecutionStatuses;

View file

@ -72,7 +72,7 @@ export const FilterGroup = (props: PropsWithChildren<FilterGroupProps>) => {
const defaultControlsObj = useMemo(
() =>
defaultControls.reduce<Record<string, typeof defaultControls[0]>>((prev, current) => {
defaultControls.reduce<Record<string, (typeof defaultControls)[0]>>((prev, current) => {
prev[current.fieldName] = current;
return prev;
}, {}),

View file

@ -21,4 +21,4 @@ export const healthCheckErrors = {
API_KEYS_AND_ENCRYPTION_ERROR: 'apiKeysAndEncryptionError',
} as const;
export type HealthCheckErrors = typeof healthCheckErrors[keyof typeof healthCheckErrors];
export type HealthCheckErrors = (typeof healthCheckErrors)[keyof typeof healthCheckErrors];

View file

@ -24,7 +24,7 @@ export const supportedFieldTypes = [
export const isSupportedFieldType = (type: string): type is SupportedFieldType =>
supportedFieldTypes.includes(type as SupportedFieldType);
export type SupportedFieldType = typeof supportedFieldTypes[number];
export type SupportedFieldType = (typeof supportedFieldTypes)[number];
export type FunctionParameterType =
| SupportedFieldType

View file

@ -34,7 +34,7 @@ run(async ({ log }) => {
}
}
const updatedJson = updateVscodeConfig(
const updatedJson = await updateVscodeConfig(
MANAGED_CONFIG_KEYS,
dedent`
Some settings in this file are managed by @kbn/dev-utils. When a setting is managed it is preceeded

View file

@ -70,7 +70,7 @@ export interface ManagementAppProps {
}
export interface AppDefinition {
category: typeof appCategories[keyof typeof appCategories];
category: (typeof appCategories)[keyof typeof appCategories];
description: string;
icon: EuiIconProps['type'];
}

View file

@ -156,7 +156,7 @@ describe('hover', () => {
describe('policies', () => {
function createPolicyContent(
policyName: string,
customPolicies: Array<typeof policies[number]> = policies
customPolicies: Array<(typeof policies)[number]> = policies
) {
const policyHit = customPolicies.find((p) => p.name === policyName);
if (!policyHit) {

View file

@ -14,7 +14,7 @@ import { registerTemplates } from './register_templates';
export const AVAILABLE_TEMPLATES = ['zod_operation_schema'] as const;
export type TemplateName = typeof AVAILABLE_TEMPLATES[number];
export type TemplateName = (typeof AVAILABLE_TEMPLATES)[number];
export interface ITemplateService {
compileTemplate: (templateName: TemplateName, context: GenerationContext) => string;

View file

@ -25,7 +25,7 @@ const toStringArray = (input: any): string[] | null =>
Array.isArray(input) && input.every((x) => typeof x === 'string') ? input : null;
export interface BundleSpec {
readonly type: typeof VALID_BUNDLE_TYPES[0];
readonly type: (typeof VALID_BUNDLE_TYPES)[0];
/** Unique id for this bundle */
readonly id: string;
/** Absolute path to the plugin source directory */

View file

@ -19,28 +19,28 @@ import {
} from './const';
/** An enumeration of plugin classes within a single plugin. */
export type PluginLayer = typeof PLUGIN_LAYERS[number];
export type PluginLayer = (typeof PLUGIN_LAYERS)[number];
/** An enumeration of dependency requirements for a plugin. */
export type PluginRequirement = typeof PLUGIN_REQUIREMENTS[number];
export type PluginRequirement = (typeof PLUGIN_REQUIREMENTS)[number];
/** An enumeration of lifecycles a plugin should implement. */
export type PluginLifecycle = typeof PLUGIN_LIFECYCLES[number];
export type PluginLifecycle = (typeof PLUGIN_LIFECYCLES)[number];
/** An enumeration of manifest requirement states for a plugin dependency. */
export type ManifestRequirement = typeof MANIFEST_REQUIREMENTS[number];
export type ManifestRequirement = (typeof MANIFEST_REQUIREMENTS)[number];
/** An enumeration of derived manifest states for a plugin dependency. */
export type ManifestState = typeof MANIFEST_STATES[number];
export type ManifestState = (typeof MANIFEST_STATES)[number];
/** An enumeration of derived plugin states for a dependency. */
export type PluginState = typeof PLUGIN_STATES[number];
export type PluginState = (typeof PLUGIN_STATES)[number];
/** An enumeration of derived dependency states. */
export type DependencyState = typeof DEPENDENCY_STATES[number];
export type DependencyState = (typeof DEPENDENCY_STATES)[number];
/** An enumeration of where a type could be derived from a plugin class. */
export type SourceOfType = typeof SOURCE_OF_TYPE[number];
export type SourceOfType = (typeof SOURCE_OF_TYPE)[number];
/** Information about a given plugin. */
export interface PluginInfo {

View file

@ -28,7 +28,7 @@ function assertInstanceOfZodType(schema: unknown): asserts schema is z.ZodTypeAn
const instanceofZodTypeKind = <Z extends z.ZodFirstPartyTypeKind>(
type: z.ZodTypeAny,
zodTypeKind: Z
): type is InstanceType<typeof z[Z]> => {
): type is InstanceType<(typeof z)[Z]> => {
return type?._def?.typeName === zodTypeKind;
};

View file

@ -28,7 +28,7 @@ export const AlertConsumers = {
EXAMPLE: 'AlertingExample',
MONITORING: 'monitoring',
} as const;
export type AlertConsumers = typeof AlertConsumers[keyof typeof AlertConsumers];
export type AlertConsumers = (typeof AlertConsumers)[keyof typeof AlertConsumers];
export type STATUS_VALUES = 'open' | 'acknowledged' | 'closed' | 'in-progress'; // TODO: remove 'in-progress' after migration to 'acknowledged'
export type ValidFeatureId = AlertConsumers;

View file

@ -8,7 +8,7 @@
const LEVELS = ['silent', 'error', 'warning', 'success', 'info', 'debug', 'verbose'] as const;
export const DEFAULT_LOG_LEVEL = 'info' as const;
export type LogLevel = typeof LEVELS[number];
export type LogLevel = (typeof LEVELS)[number];
export function pickLevelFromFlags(
flags: Record<string, string | boolean | string[] | undefined>,

View file

@ -16,5 +16,5 @@ type AsActionVariables<Keys extends string> = {
[Req in Keys]: ActionVariable[];
};
export type ActionVariables = AsActionVariables<typeof REQUIRED_ACTION_VARIABLES[number]> &
Partial<AsActionVariables<typeof OPTIONAL_ACTION_VARIABLES[number]>>;
export type ActionVariables = AsActionVariables<(typeof REQUIRED_ACTION_VARIABLES)[number]> &
Partial<AsActionVariables<(typeof OPTIONAL_ACTION_VARIABLES)[number]>>;

View file

@ -19,7 +19,7 @@ class FeatureFlag<T extends string = string> {
}
export const createFeatureFlagService = <T extends string>(featureFlags: T[]) => {
return new FeatureFlag<typeof featureFlags[number]>(featureFlags);
return new FeatureFlag<(typeof featureFlags)[number]>(featureFlags);
};
export type FeatureFlagService<T extends string = string> = InstanceType<typeof FeatureFlag<T>>;

View file

@ -91,7 +91,16 @@
},
{
"groupName": "typescript",
"matchDepNames": ["typescript", "prettier", "@types/jsdom"],
"matchDepNames": ["typescript", "@types/jsdom"],
"reviewers": ["team:kibana-operations"],
"matchBaseBranches": ["main"],
"labels": ["Team:Operations", "release_note:skip"],
"minimumReleaseAge": "7 days",
"enabled": true
},
{
"groupName": "prettier",
"matchDepNames": ["prettier", "eslint-plugin-prettier", "eslint-config-prettier"],
"reviewers": ["team:kibana-operations"],
"matchBaseBranches": ["main"],
"labels": ["Team:Operations", "release_note:skip"],

View file

@ -145,7 +145,7 @@ const createSeriesLayers = (
column: Partial<BucketColumns>
): SeriesLayer[] => {
const seriesLayers: SeriesLayer[] = [];
let tempParent: typeof arrayNode | typeof arrayNode['parent'] = arrayNode;
let tempParent: typeof arrayNode | (typeof arrayNode)['parent'] = arrayNode;
while (tempParent.parent && tempParent.depth > 0) {
const nodeKey = tempParent.parent.children[tempParent.sortIndex][0];
const seriesName = String(nodeKey);

View file

@ -25,10 +25,10 @@ const stringToAxesId = { l: 'yLeft', r: 'yRight', x: 'x' } as const;
const posToId = { left: 'yLeft', right: 'yRight', bottom: 'x' } as const;
export type StringPos = keyof typeof stringToPos;
export type PosType = typeof stringToPos[StringPos];
export type PosType = (typeof stringToPos)[StringPos];
export type StringId = keyof typeof stringToAxesId;
export type AxisTypeId = typeof stringToAxesId[StringId];
export type AxisTypeId = (typeof stringToAxesId)[StringId];
function buildPositionObject<T extends unknown>(
posString: string,

View file

@ -75,4 +75,4 @@ export class Mode extends TextMode {
return worker;
};
}.call(Mode.prototype));
}).call(Mode.prototype);

View file

@ -33,4 +33,4 @@ export class Mode extends JSONMode {
};
this.$id = 'sense/mode/input';
}.call(Mode.prototype));
}).call(Mode.prototype);

View file

@ -44,4 +44,4 @@ export class ScriptMode extends TextMode {
this.autoOutdent = function (state: unknown, doc: string, row: string) {
this.$outdent.autoOutdent(doc, row);
};
}.call(ScriptMode.prototype));
}).call(ScriptMode.prototype);

View file

@ -18,7 +18,7 @@ export const procedureNames = [
'mSearch',
] as const;
export type ProcedureName = typeof procedureNames[number];
export type ProcedureName = (typeof procedureNames)[number];
export const versionSchema = schema.number({
validate: (value) => {

View file

@ -45,7 +45,7 @@ export const persistableControlGroupInputKeys: Array<
> = ['panels', 'chainingSystem', 'controlStyle', 'ignoreParentSettings', 'showApplySelections'];
export type PersistableControlGroupInput = Pick<
ControlGroupInput,
typeof persistableControlGroupInputKeys[number]
(typeof persistableControlGroupInputKeys)[number]
>;
/**

View file

@ -109,7 +109,7 @@ describe('Field', () => {
const aggParam = new FieldParamType({
name: 'field',
type: 'field',
filterField: (field: typeof indexPattern['fields'][0]) =>
filterField: (field: (typeof indexPattern)['fields'][0]) =>
field.esTypes?.includes(ES_FIELD_TYPES.TEXT),
});
@ -123,7 +123,7 @@ describe('Field', () => {
const aggParam = new FieldParamType({
name: 'field',
type: 'field',
filterField: (field: typeof indexPattern['fields'][0]) =>
filterField: (field: (typeof indexPattern)['fields'][0]) =>
field.esTypes?.includes(ES_FIELD_TYPES.TEXT),
filterFieldTypes: KBN_FIELD_TYPES.NUMBER,
});

View file

@ -16,7 +16,7 @@ const INVALID_DATE = 'invalid';
const PREVIOUS_DATE = 'previous';
const START_AT_ANCHOR = 'startAt';
type AllowedUnit = typeof ALLOWED_UNITS[number];
type AllowedUnit = (typeof ALLOWED_UNITS)[number];
type PreviousDateType = typeof PREVIOUS_DATE;
type InvalidDateType = typeof INVALID_DATE;

View file

@ -151,7 +151,7 @@ describe('tabifyAggResponse Integration', () => {
function getTopAggregations(
rawResp: typeof threeTermBuckets
): typeof threeTermBuckets['aggregations'] {
): (typeof threeTermBuckets)['aggregations'] {
return !isSamplingEnabled(probability)
? rawResp.aggregations!
: // @ts-ignore

View file

@ -96,15 +96,15 @@ export const WithFieldEditorDependencies =
(props: T) => {
// Setup mocks
(
fieldFormats.getByFieldType as jest.MockedFunction<typeof fieldFormats['getByFieldType']>
fieldFormats.getByFieldType as jest.MockedFunction<(typeof fieldFormats)['getByFieldType']>
).mockReturnValue(fieldFormatsOptions);
(
fieldFormats.getDefaultType as jest.MockedFunction<typeof fieldFormats['getDefaultType']>
fieldFormats.getDefaultType as jest.MockedFunction<(typeof fieldFormats)['getDefaultType']>
).mockReturnValue(MockDefaultFieldFormat);
(
fieldFormats.getInstance as jest.MockedFunction<typeof fieldFormats['getInstance']>
fieldFormats.getInstance as jest.MockedFunction<(typeof fieldFormats)['getInstance']>
).mockImplementation((id: string) => {
if (id === MockCustomFieldFormat.id) {
return new MockCustomFieldFormat();
@ -114,7 +114,7 @@ export const WithFieldEditorDependencies =
});
(
fieldFormats.getDefaultInstance as jest.MockedFunction<typeof fieldFormats['getInstance']>
fieldFormats.getDefaultInstance as jest.MockedFunction<(typeof fieldFormats)['getInstance']>
).mockImplementation(() => {
return new MockDefaultFieldFormat();
});

View file

@ -22,7 +22,7 @@ export type FieldFormatMap = Record<string, SerializedFieldFormat>;
/**
* Runtime field types
*/
export type RuntimeType = typeof RUNTIME_FIELD_TYPES[number];
export type RuntimeType = (typeof RUNTIME_FIELD_TYPES)[number];
/**
* Runtime field primitive types - excluding composite

View file

@ -59,7 +59,7 @@ export type SearchEmbeddableSerializedAttributes = Omit<
export type SearchEmbeddableSerializedState = SerializedTitles &
SerializedTimeRange &
Partial<Pick<SavedSearchAttributes, typeof EDITABLE_SAVED_SEARCH_KEYS[number]>> & {
Partial<Pick<SavedSearchAttributes, (typeof EDITABLE_SAVED_SEARCH_KEYS)[number]>> & {
// by value
attributes?: SavedSearchAttributes & { references: SavedSearch['references'] };
// by reference

View file

@ -42,7 +42,7 @@ const genericInputKeysToCompare = [
// type used to ensure that only keys present in EmbeddableInput are extracted
type GenericEmbedableInputToCompare = Pick<
EmbeddableInput,
typeof genericInputKeysToCompare[number]
(typeof genericInputKeysToCompare)[number]
>;
export const omitGenericEmbeddableInput = <

View file

@ -42,7 +42,7 @@ const fieldTypeOptions = [
'toggle',
] as const;
type FieldType = typeof fieldTypeOptions[number];
type FieldType = (typeof fieldTypeOptions)[number];
const fieldConfigBase: FieldConfig<unknown> = {
label: 'My field',

View file

@ -10,13 +10,13 @@
* This type contains a unions of all supported font labels, or the the name of
* the font the user would see in a UI.
*/
export type FontLabel = typeof fonts[number]['label'];
export type FontLabel = (typeof fonts)[number]['label'];
/**
* This type contains a union of all supported font values, equivalent to the CSS
* `font-value` property.
*/
export type FontValue = typeof fonts[number]['value'];
export type FontValue = (typeof fonts)[number]['value'];
/**
* An interface representing a font in Canvas, with a textual label and the CSS

View file

@ -32,7 +32,8 @@ export function activemqLogsSpecProvider(context: TutorialContext): TutorialSche
defaultMessage: 'Collect and parse logs from ActiveMQ instances with Filebeat.',
}),
longDescription: i18n.translate('home.tutorials.activemqLogs.longDescription', {
defaultMessage: 'Collect ActiveMQ logs with Filebeat. \
defaultMessage:
'Collect ActiveMQ logs with Filebeat. \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.filebeat}/filebeat-module-activemq.html',

View file

@ -32,7 +32,8 @@ export function ibmmqLogsSpecProvider(context: TutorialContext): TutorialSchema
defaultMessage: 'Collect and parse logs from IBM MQ with Filebeat.',
}),
longDescription: i18n.translate('home.tutorials.ibmmqLogs.longDescription', {
defaultMessage: 'Collect IBM MQ logs with Filebeat. \
defaultMessage:
'Collect IBM MQ logs with Filebeat. \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.filebeat}/filebeat-module-ibmmq.html',

View file

@ -32,7 +32,8 @@ export function kibanaLogsSpecProvider(context: TutorialContext): TutorialSchema
defaultMessage: 'Collect and parse logs from Kibana with Filebeat.',
}),
longDescription: i18n.translate('home.tutorials.kibanaLogs.longDescription', {
defaultMessage: 'This is the Kibana module. \
defaultMessage:
'This is the Kibana module. \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.filebeat}/filebeat-module-kibana.html',

View file

@ -24,7 +24,7 @@ describe('registerEbtCounters', () => {
.spyOn(core.analytics.telemetryCounter$, 'subscribe')
.mockImplementation(((listener) => {
internalListener = listener as (counter: TelemetryCounter) => void;
}) as typeof core.analytics.telemetryCounter$['subscribe']);
}) as (typeof core.analytics.telemetryCounter$)['subscribe']);
});
test('it subscribes to `analytics.telemetryCounters$`', () => {

View file

@ -24,7 +24,7 @@ describe('registerEbtCounters', () => {
.spyOn(core.analytics.telemetryCounter$, 'subscribe')
.mockImplementation(((listener) => {
internalListener = listener as (counter: TelemetryCounter) => void;
}) as typeof core.analytics.telemetryCounter$['subscribe']);
}) as (typeof core.analytics.telemetryCounter$)['subscribe']);
});
test('it subscribes to `analytics.telemetryCounters$`', () => {

View file

@ -50,9 +50,9 @@ export const projects: { [ID in ProjectID]: ProjectConfig & { id: ID } } = {
},
};
export type ProjectID = typeof projectIDs[number];
export type EnvironmentName = typeof environmentNames[number];
export type SolutionName = typeof solutionNames[number];
export type ProjectID = (typeof projectIDs)[number];
export type EnvironmentName = (typeof environmentNames)[number];
export type SolutionName = (typeof solutionNames)[number];
export type EnvironmentStatus = {
[env in EnvironmentName]?: boolean;

View file

@ -15,7 +15,7 @@ import {
} from '@kbn/field-formats-plugin/common';
import { flights } from './flights_data';
export type Flight = typeof flights[number];
export type Flight = (typeof flights)[number];
export type FlightField = keyof Flight;
export const flightFieldNames: FlightField[] = [

View file

@ -13,7 +13,7 @@ import {
ExpressionFunctionDefinition,
} from '@kbn/expressions-plugin/common';
type DefaultFnResultType = typeof typeSpecs[number] &
type DefaultFnResultType = (typeof typeSpecs)[number] &
ExpressionFunctionDefinition<
string,
any,

View file

@ -173,8 +173,8 @@ describe('TelemetrySender', () => {
});
});
describe('sendIfDue', () => {
let originalFetch: typeof window['fetch'];
let mockFetch: jest.Mock<typeof window['fetch']>;
let originalFetch: (typeof window)['fetch'];
let mockFetch: jest.Mock<(typeof window)['fetch']>;
beforeAll(() => {
originalFetch = window.fetch;
@ -236,8 +236,8 @@ describe('TelemetrySender', () => {
});
describe('sendUsageData', () => {
let originalFetch: typeof window['fetch'];
let mockFetch: jest.Mock<typeof window['fetch']>;
let originalFetch: (typeof window)['fetch'];
let mockFetch: jest.Mock<(typeof window)['fetch']>;
let consoleWarnMock: jest.SpyInstance;
beforeAll(() => {

View file

@ -276,8 +276,8 @@ describe('TelemetryService', () => {
});
describe('reportOptInStatus', () => {
let originalFetch: typeof window['fetch'];
let mockFetch: jest.Mock<typeof window['fetch']>;
let originalFetch: (typeof window)['fetch'];
let mockFetch: jest.Mock<(typeof window)['fetch']>;
beforeAll(() => {
originalFetch = window.fetch;

View file

@ -10,9 +10,9 @@ export const DATA_TELEMETRY_ID = 'data';
export const DATA_KNOWN_TYPES = ['logs', 'traces', 'metrics'] as const;
export type DataTelemetryType = typeof DATA_KNOWN_TYPES[number];
export type DataTelemetryType = (typeof DATA_KNOWN_TYPES)[number];
export type DataPatternName = typeof DATA_DATASETS_INDEX_PATTERNS[number]['patternName'];
export type DataPatternName = (typeof DATA_DATASETS_INDEX_PATTERNS)[number]['patternName'];
// TODO: Ideally this list should be updated from an external public URL (similar to the newsfeed)
// But it's good to have a minimum list shipped with the build.

View file

@ -23,7 +23,7 @@ function createAppMountParams(hash: string): AppMountParameters {
describe('forward_app', () => {
let coreSetup: CoreSetup<{}, UrlForwardingStart>;
let coreStart: ReturnType<typeof coreMock['createStart']>;
let coreStart: ReturnType<(typeof coreMock)['createStart']>;
beforeEach(() => {
coreSetup = coreMock.createSetup({ basePath: '/base/path' });

View file

@ -265,7 +265,7 @@ export const SUPPORTED_METRICS: SupportedMetrics = {
type SupportedMetricsKeys = keyof LocalSupportedMetrics;
export type SupportedMetric = typeof SUPPORTED_METRICS[SupportedMetricsKeys];
export type SupportedMetric = (typeof SUPPORTED_METRICS)[SupportedMetricsKeys];
export const getFormulaFromMetric = (metric: SupportedMetric) => {
if (metric.isFormula) {

View file

@ -235,7 +235,7 @@ export const SUPPORTED_METRICS: SupportedMetrics = {
type SupportedMetricsKeys = keyof LocalSupportedMetrics;
export type SupportedMetric = typeof SUPPORTED_METRICS[SupportedMetricsKeys];
export type SupportedMetric = (typeof SUPPORTED_METRICS)[SupportedMetricsKeys];
export const getFormulaFromMetric = (metric: SupportedMetric) => {
if (metric.isFormula) {

View file

@ -32,7 +32,7 @@ import { ExpressionValueVisDimension } from '../../expression_functions';
export type ChartShapes = 'heatmap';
export type CollapseFunction = typeof CollapseFunctions[number];
export type CollapseFunction = (typeof CollapseFunctions)[number];
export type FillType = $Values<typeof FillTypes>;
export type SeriesType = $Values<typeof SeriesTypes>;

View file

@ -25,7 +25,7 @@ const SUPPORTED_AGGREGATIONS = [
SHARD_DELAY_AGG_NAME,
];
type SupportedAggregation = typeof SUPPORTED_AGGREGATIONS[number];
type SupportedAggregation = (typeof SUPPORTED_AGGREGATIONS)[number];
function isSupportedAggType(name: string): name is SupportedAggregation {
return SUPPORTED_AGGREGATIONS.includes(name as SupportedAggregation);

View file

@ -434,7 +434,7 @@ export class VisualizeChartPageObject extends FtrService {
}
public async getAxesCountByPosition(
axesPosition: typeof Position[keyof typeof Position],
axesPosition: (typeof Position)[keyof typeof Position],
selector: string
) {
const yAxes = (await this.getEsChartDebugState(selector))?.axes?.y ?? [];

View file

@ -122,7 +122,7 @@ type SignificantItemTypeKeys = keyof typeof SIGNIFICANT_ITEM_TYPE;
/**
* Represents the type of significant item as determined by the SIGNIFICANT_ITEM_TYPE enumeration.
*/
export type SignificantItemType = typeof SIGNIFICANT_ITEM_TYPE[SignificantItemTypeKeys];
export type SignificantItemType = (typeof SIGNIFICANT_ITEM_TYPE)[SignificantItemTypeKeys];
/**
* Represents significant item metadata for a field/value pair.

View file

@ -25,4 +25,4 @@ export const CHANGE_POINT_DETECTION_VIEW_TYPE = {
} as const;
export type ChangePointDetectionViewType =
typeof CHANGE_POINT_DETECTION_VIEW_TYPE[keyof typeof CHANGE_POINT_DETECTION_VIEW_TYPE];
(typeof CHANGE_POINT_DETECTION_VIEW_TYPE)[keyof typeof CHANGE_POINT_DETECTION_VIEW_TYPE];

View file

@ -12,7 +12,7 @@ export const QUERY_MODE = {
INCLUDE: 'should',
EXCLUDE: 'must_not',
} as const;
export type QueryMode = typeof QUERY_MODE[keyof typeof QUERY_MODE];
export type QueryMode = (typeof QUERY_MODE)[keyof typeof QUERY_MODE];
export const getCategoryQuery = (
field: string,

View file

@ -18,4 +18,4 @@ export const LOG_RATE_ANALYSIS_TYPE = {
* Union type of log rate analysis types.
*/
export type LogRateAnalysisType =
typeof LOG_RATE_ANALYSIS_TYPE[keyof typeof LOG_RATE_ANALYSIS_TYPE];
(typeof LOG_RATE_ANALYSIS_TYPE)[keyof typeof LOG_RATE_ANALYSIS_TYPE];

View file

@ -76,7 +76,7 @@ export const SPARSE_DATA_AGGREGATIONS = [
/**
* Type definition of SPARSE_DATA_AGGREGATIONS values.
*/
export type SparseDataAggregation = typeof SPARSE_DATA_AGGREGATIONS[number];
export type SparseDataAggregation = (typeof SPARSE_DATA_AGGREGATIONS)[number];
/**
* Enum for Kibana aggregations.

View file

@ -37,7 +37,7 @@ export const ML_ENTITY_FIELD_OPERATIONS = {
* Union type of entity field operations
*/
export type MlEntityFieldOperation =
typeof ML_ENTITY_FIELD_OPERATIONS[keyof typeof ML_ENTITY_FIELD_OPERATIONS];
(typeof ML_ENTITY_FIELD_OPERATIONS)[keyof typeof ML_ENTITY_FIELD_OPERATIONS];
/**
* Interface of an entity field

View file

@ -23,7 +23,7 @@ export const ML_JOB_FIELD_TYPES = {
/**
* Union type for ML_JOB_FIELD_TYPES
*/
export type MlJobFieldType = typeof ML_JOB_FIELD_TYPES[keyof typeof ML_JOB_FIELD_TYPES];
export type MlJobFieldType = (typeof ML_JOB_FIELD_TYPES)[keyof typeof ML_JOB_FIELD_TYPES];
/**
* MLCATEGORY

View file

@ -365,7 +365,7 @@ export interface MlAnomaliesTableRecordExtended extends MlAnomaliesTableRecord {
/**
* Union type for partitiion field types.
*/
export type MlPartitionFieldsType = typeof ML_PARTITION_FIELDS[number];
export type MlPartitionFieldsType = (typeof ML_PARTITION_FIELDS)[number];
/**
* Anomaly record document for categorizer stats.
@ -453,4 +453,4 @@ export type MlEntityFieldType = 'partition_field' | 'over_field' | 'by_field';
* The type of the anomaly result, such as bucket, influencer or record.
*/
export type MlAnomalyResultType =
typeof ML_ANOMALY_RESULT_TYPE[keyof typeof ML_ANOMALY_RESULT_TYPE];
(typeof ML_ANOMALY_RESULT_TYPE)[keyof typeof ML_ANOMALY_RESULT_TYPE];

View file

@ -46,7 +46,7 @@ export const JOB_MAP_NODE_TYPES = {
/**
* Union type of JOB_MAP_NODE_TYPES
*/
export type JobMapNodeTypes = typeof JOB_MAP_NODE_TYPES[keyof typeof JOB_MAP_NODE_TYPES];
export type JobMapNodeTypes = (typeof JOB_MAP_NODE_TYPES)[keyof typeof JOB_MAP_NODE_TYPES];
/**
* Custom enum for the metadata to be stored about which tool was used to create an index

View file

@ -210,7 +210,7 @@ export function isDataFrameAnalyticsConfigs(arg: unknown): arg is DataFrameAnaly
* Union type of DFA anlaysis config types
*/
export type DataFrameAnalysisConfigType =
typeof ANALYSIS_CONFIG_TYPE[keyof typeof ANALYSIS_CONFIG_TYPE];
(typeof ANALYSIS_CONFIG_TYPE)[keyof typeof ANALYSIS_CONFIG_TYPE];
/**
* Union type of DFA task states

View file

@ -17,4 +17,4 @@ export const FROZEN_TIER_PREFERENCE = {
* Union type of `FROZEN_TIER_PREFERENCE` options.
*/
export type FrozenTierPreference =
typeof FROZEN_TIER_PREFERENCE[keyof typeof FROZEN_TIER_PREFERENCE];
(typeof FROZEN_TIER_PREFERENCE)[keyof typeof FROZEN_TIER_PREFERENCE];

View file

@ -10,7 +10,7 @@ import Path from 'path';
import { jsonSchemaOverrides } from './schema_overrides';
import { type PropertyDefinition } from './types';
export type EditorEndpoints = typeof supportedEndpoints[number]['path'];
export type EditorEndpoints = (typeof supportedEndpoints)[number]['path'];
const supportedEndpoints = [
{

View file

@ -18,7 +18,8 @@ export const SEARCH_QUERY_LANGUAGE = {
/**
* Type for SearchQueryLanguage
*/
export type SearchQueryLanguage = typeof SEARCH_QUERY_LANGUAGE[keyof typeof SEARCH_QUERY_LANGUAGE];
export type SearchQueryLanguage =
(typeof SEARCH_QUERY_LANGUAGE)[keyof typeof SEARCH_QUERY_LANGUAGE];
/**
* Placeholder for the structure for a saved search query.

View file

@ -42,7 +42,8 @@ export const RANDOM_SAMPLER_OPTION = {
/**
* Default option for random sampler type
*/
export type RandomSamplerOption = typeof RANDOM_SAMPLER_OPTION[keyof typeof RANDOM_SAMPLER_OPTION];
export type RandomSamplerOption =
(typeof RANDOM_SAMPLER_OPTION)[keyof typeof RANDOM_SAMPLER_OPTION];
/**
* Type for the random sampler probability

View file

@ -9,7 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { RUNTIME_FIELD_TYPES } from '@kbn/data-plugin/common';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
type RuntimeType = typeof RUNTIME_FIELD_TYPES[number];
type RuntimeType = (typeof RUNTIME_FIELD_TYPES)[number];
/**
* Type guard for a runtime field

View file

@ -25,14 +25,14 @@ export const DEPLOYMENT_STATE = {
STOPPING: 'stopping',
} as const;
export type DeploymentState = typeof DEPLOYMENT_STATE[keyof typeof DEPLOYMENT_STATE];
export type DeploymentState = (typeof DEPLOYMENT_STATE)[keyof typeof DEPLOYMENT_STATE];
export const TRAINED_MODEL_TYPE = {
PYTORCH: 'pytorch',
TREE_ENSEMBLE: 'tree_ensemble',
LANG_IDENT: 'lang_ident',
} as const;
export type TrainedModelType = typeof TRAINED_MODEL_TYPE[keyof typeof TRAINED_MODEL_TYPE];
export type TrainedModelType = (typeof TRAINED_MODEL_TYPE)[keyof typeof TRAINED_MODEL_TYPE];
export const SUPPORTED_PYTORCH_TASKS = {
NER: 'ner',
@ -45,7 +45,7 @@ export const SUPPORTED_PYTORCH_TASKS = {
TEXT_EXPANSION: 'text_expansion',
} as const;
export type SupportedPytorchTasksType =
typeof SUPPORTED_PYTORCH_TASKS[keyof typeof SUPPORTED_PYTORCH_TASKS];
(typeof SUPPORTED_PYTORCH_TASKS)[keyof typeof SUPPORTED_PYTORCH_TASKS];
export const BUILT_IN_MODEL_TYPE = i18n.translate(
'xpack.ml.trainedModels.modelsList.builtInModelLabel',
@ -180,7 +180,7 @@ export const MODEL_STATE = {
NOT_DOWNLOADED: 'notDownloaded',
} as const;
export type ModelState = typeof MODEL_STATE[keyof typeof MODEL_STATE] | null;
export type ModelState = (typeof MODEL_STATE)[keyof typeof MODEL_STATE] | null;
export type ElserVersion = 1 | 2;

View file

@ -80,4 +80,4 @@ export const VIEW_SELECTION = {
export type ViewSelectionTypes = keyof typeof VIEW_SELECTION;
export type ViewSelection = typeof VIEW_SELECTION[ViewSelectionTypes];
export type ViewSelection = (typeof VIEW_SELECTION)[ViewSelectionTypes];

View file

@ -41,7 +41,7 @@ const patternRollups: Record<string, PatternRollup> = {
};
describe('helpers', () => {
let originalFetch: typeof global['fetch'];
let originalFetch: (typeof global)['fetch'];
beforeAll(() => {
originalFetch = global.fetch;

View file

@ -18,7 +18,7 @@ import { UnallowedValueRequestItem, UnallowedValueSearchResult } from '../types'
import { INTERNAL_API_VERSION } from '../helpers';
describe('helpers', () => {
let originalFetch: typeof global['fetch'];
let originalFetch: (typeof global)['fetch'];
beforeAll(() => {
originalFetch = global.fetch;

View file

@ -59,4 +59,4 @@ export const executionLogSortableColumns = [
'schedule_delay',
] as const;
export type ExecutionLogSortFields = typeof executionLogSortableColumns[number];
export type ExecutionLogSortFields = (typeof executionLogSortableColumns)[number];

View file

@ -39,7 +39,7 @@ export interface ValidatedEmail {
// the result returned from an action type executor function
const ActionTypeExecutorResultStatusValues = ['ok', 'error'] as const;
type ActionTypeExecutorResultStatus = typeof ActionTypeExecutorResultStatusValues[number];
type ActionTypeExecutorResultStatus = (typeof ActionTypeExecutorResultStatusValues)[number];
export interface ActionTypeExecutorResult<Data> {
actionId: string;

View file

@ -11,7 +11,7 @@ import {
getAlertHistoryIndexTemplate,
} from './create_alert_history_index_template';
type MockedLogger = ReturnType<typeof loggingSystemMock['createLogger']>;
type MockedLogger = ReturnType<(typeof loggingSystemMock)['createLogger']>;
describe('createAlertHistoryIndexTemplate', () => {
let logger: MockedLogger;

View file

@ -29,7 +29,7 @@ export const CHANGE_POINT_TYPES = {
INDETERMINABLE: 'indeterminable',
} as const;
export type ChangePointType = typeof CHANGE_POINT_TYPES[keyof typeof CHANGE_POINT_TYPES];
export type ChangePointType = (typeof CHANGE_POINT_TYPES)[keyof typeof CHANGE_POINT_TYPES];
export const EXCLUDED_CHANGE_POINT_TYPES = new Set<ChangePointType>([
CHANGE_POINT_TYPES.STATIONARY,

View file

@ -23,7 +23,8 @@ export const RANDOM_SAMPLER_OPTION = {
OFF: 'off',
} as const;
export type RandomSamplerOption = typeof RANDOM_SAMPLER_OPTION[keyof typeof RANDOM_SAMPLER_OPTION];
export type RandomSamplerOption =
(typeof RANDOM_SAMPLER_OPTION)[keyof typeof RANDOM_SAMPLER_OPTION];
export type RandomSamplerProbability = number | null;
export const RANDOM_SAMPLER_SELECT_OPTIONS: Array<{

Some files were not shown because too many files have changed in this diff Show more