[8.0] [eslint] enable type-specific lint rules (#114184) (#117444)

* [eslint] enable type-specific lint rules (#114184)

* [eslint] enable type-specific lint rules

* autofix violations

* duplicate eslint-disable to new export statement

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	src/plugins/share/common/index.ts

* autofix more types

Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
Spencer 2021-11-03 21:02:56 -06:00 committed by GitHub
parent 1064adb5ce
commit 7d3d79e6a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
641 changed files with 2250 additions and 1860 deletions

View file

@ -147,6 +147,13 @@ steps:
key: linting
timeout_in_minutes: 90
- command: .buildkite/scripts/steps/lint_with_types.sh
label: 'Linting (with types)'
agents:
queue: c2-16
key: linting_with_types
timeout_in_minutes: 90
- command: .buildkite/scripts/steps/checks.sh
label: 'Checks'
agents:

View file

@ -145,6 +145,13 @@ steps:
key: linting
timeout_in_minutes: 90
- command: .buildkite/scripts/steps/lint_with_types.sh
label: 'Linting (with types)'
agents:
queue: c2-16
key: linting_with_types
timeout_in_minutes: 90
- command: .buildkite/scripts/steps/checks.sh
label: 'Checks'
agents:

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
source .buildkite/scripts/common/util.sh
export BUILD_TS_REFS_DISABLE=false
.buildkite/scripts/bootstrap.sh
echo '--- Lint: eslint (with types)'
checks-reporter-with-killswitch "Lint: eslint (with types)" \
node scripts/eslint_with_types

1
.gitignore vendored
View file

@ -19,6 +19,7 @@ target
.idea
*.iml
*.log
types.eslint.config.js
# Ignore example plugin builds
/examples/*/build

View file

@ -10,4 +10,4 @@ import { DeveloperExamplesPlugin } from './plugin';
export const plugin = () => new DeveloperExamplesPlugin();
export { DeveloperExamplesSetup } from './plugin';
export type { DeveloperExamplesSetup } from './plugin';

View file

@ -6,5 +6,6 @@
* Side Public License, v 1.
*/
export { TodoSavedObjectAttributes } from './todo_saved_object_attributes';
export { BookSavedObjectAttributes, BOOK_SAVED_OBJECT } from './book_saved_object_attributes';
export type { TodoSavedObjectAttributes } from './todo_saved_object_attributes';
export type { BookSavedObjectAttributes } from './book_saved_object_attributes';
export { BOOK_SAVED_OBJECT } from './book_saved_object_attributes';

View file

@ -6,14 +6,16 @@
* Side Public License, v 1.
*/
export type { HelloWorldEmbeddableFactory } from './hello_world';
export {
HELLO_WORLD_EMBEDDABLE,
HelloWorldEmbeddable,
HelloWorldEmbeddableFactoryDefinition,
HelloWorldEmbeddableFactory,
} from './hello_world';
export { ListContainer, LIST_CONTAINER, ListContainerFactory } from './list_container';
export { TODO_EMBEDDABLE, TodoEmbeddableFactory } from './todo';
export type { ListContainerFactory } from './list_container';
export { ListContainer, LIST_CONTAINER } from './list_container';
export type { TodoEmbeddableFactory } from './todo';
export { TODO_EMBEDDABLE } from './todo';
export { BOOK_EMBEDDABLE } from './book';
@ -21,10 +23,8 @@ export { SIMPLE_EMBEDDABLE } from './migrations';
import { EmbeddableExamplesPlugin } from './plugin';
export {
SearchableListContainer,
SEARCHABLE_LIST_CONTAINER,
SearchableListContainerFactory,
} from './searchable_list_container';
export { MULTI_TASK_TODO_EMBEDDABLE, MultiTaskTodoEmbeddableFactory } from './multi_task_todo';
export type { SearchableListContainerFactory } from './searchable_list_container';
export { SearchableListContainer, SEARCHABLE_LIST_CONTAINER } from './searchable_list_container';
export type { MultiTaskTodoEmbeddableFactory } from './multi_task_todo';
export { MULTI_TASK_TODO_EMBEDDABLE } from './multi_task_todo';
export const plugin = () => new EmbeddableExamplesPlugin();

View file

@ -7,4 +7,5 @@
*/
export { ListContainer, LIST_CONTAINER } from './list_container';
export { ListContainerFactoryDefinition, ListContainerFactory } from './list_container_factory';
export type { ListContainerFactory } from './list_container_factory';
export { ListContainerFactoryDefinition } from './list_container_factory';

View file

@ -7,7 +7,5 @@
*/
export { SearchableListContainer, SEARCHABLE_LIST_CONTAINER } from './searchable_list_container';
export {
SearchableListContainerFactoryDefinition,
SearchableListContainerFactory,
} from './searchable_list_container_factory';
export type { SearchableListContainerFactory } from './searchable_list_container_factory';
export { SearchableListContainerFactoryDefinition } from './searchable_list_container_factory';

View file

@ -8,12 +8,12 @@
import { LocatorExamplesPlugin } from './plugin';
export {
export type {
HelloLocator,
HelloLocatorV1Params,
HelloLocatorV2Params,
HelloLocatorParams,
HELLO_LOCATOR,
} from './locator';
export { HELLO_LOCATOR } from './locator';
export const plugin = () => new LocatorExamplesPlugin();

View file

@ -15,4 +15,4 @@ import { SearchExamplesPlugin } from './plugin';
export function plugin() {
return new SearchExamplesPlugin();
}
export { SearchExamplesPluginSetup, SearchExamplesPluginStart } from './types';
export type { SearchExamplesPluginSetup, SearchExamplesPluginStart } from './types';

View file

@ -13,4 +13,4 @@ export function plugin(initializerContext: PluginInitializerContext) {
return new SearchExamplesPlugin(initializerContext);
}
export { SearchExamplesPluginSetup, SearchExamplesPluginStart } from './types';
export type { SearchExamplesPluginSetup, SearchExamplesPluginStart } from './types';

View file

@ -633,9 +633,9 @@
"@types/xml2js": "^0.4.5",
"@types/yauzl": "^2.9.1",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^4.31.2",
"@typescript-eslint/parser": "^4.31.2",
"@typescript-eslint/typescript-estree": "^4.31.2",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"@typescript-eslint/typescript-estree": "^5.2.0",
"@yarnpkg/lockfile": "^1.1.0",
"abab": "^2.0.4",
"aggregate-error": "^3.1.0",

View file

@ -7,7 +7,8 @@
*/
import { Duration, duration as momentDuration, DurationInputArg2, isDuration } from 'moment';
export { Duration, isDuration };
export type { Duration };
export { isDuration };
const timeFormatRegex = /^(0|[1-9][0-9]*)(ms|s|m|h|d|w|M|Y)$/;

View file

@ -49,7 +49,8 @@ import {
StreamType,
} from './types';
export { ObjectType, TypeOf, Type, Props, NullableProps };
export type { TypeOf, Props, NullableProps };
export { ObjectType, Type };
export { ByteSizeValue } from './byte_size_value';
export { SchemaTypeError, ValidationError } from './errors';
export { isConfigSchema } from './typeguards';

View file

@ -6,23 +6,35 @@
* Side Public License, v 1.
*/
export { Type, TypeOptions } from './type';
export type { TypeOptions } from './type';
export { Type } from './type';
export { AnyType } from './any_type';
export { ArrayOptions, ArrayType } from './array_type';
export type { ArrayOptions } from './array_type';
export { ArrayType } from './array_type';
export { BooleanType } from './boolean_type';
export { BufferType } from './buffer_type';
export { ByteSizeOptions, ByteSizeType } from './byte_size_type';
export { ConditionalType, ConditionalTypeValue } from './conditional_type';
export { DurationOptions, DurationType } from './duration_type';
export type { ByteSizeOptions } from './byte_size_type';
export { ByteSizeType } from './byte_size_type';
export type { ConditionalTypeValue } from './conditional_type';
export { ConditionalType } from './conditional_type';
export type { DurationOptions } from './duration_type';
export { DurationType } from './duration_type';
export { LiteralType } from './literal_type';
export { MaybeType } from './maybe_type';
export { MapOfOptions, MapOfType } from './map_type';
export { NumberOptions, NumberType } from './number_type';
export { ObjectType, ObjectTypeOptions, Props, NullableProps, TypeOf } from './object_type';
export { RecordOfOptions, RecordOfType } from './record_type';
export type { MapOfOptions } from './map_type';
export { MapOfType } from './map_type';
export type { NumberOptions } from './number_type';
export { NumberType } from './number_type';
export type { ObjectTypeOptions, Props, NullableProps, TypeOf } from './object_type';
export { ObjectType } from './object_type';
export type { RecordOfOptions } from './record_type';
export { RecordOfType } from './record_type';
export { StreamType } from './stream_type';
export { StringOptions, StringType } from './string_type';
export type { StringOptions } from './string_type';
export { StringType } from './string_type';
export { UnionType } from './union_type';
export { URIOptions, URIType } from './uri_type';
export type { URIOptions } from './uri_type';
export { URIType } from './uri_type';
export { NeverType } from './never_type';
export { IpType, IpOptions } from './ip_type';
export type { IpOptions } from './ip_type';
export { IpType } from './ip_type';

View file

@ -19,16 +19,15 @@ export type {
export { applyDeprecations, configDeprecationFactory } from './deprecation';
export {
RawConfigurationProvider,
RawConfigService,
RawConfigAdapter,
getConfigFromFiles,
} from './raw';
export type { RawConfigurationProvider, RawConfigAdapter } from './raw';
export { RawConfigService, getConfigFromFiles } from './raw';
export { ConfigService, IConfigService, ConfigValidateParameters } from './config_service';
export { Config, ConfigPath, isConfigPath, hasConfigPathIntersection } from './config';
export type { IConfigService, ConfigValidateParameters } from './config_service';
export { ConfigService } from './config_service';
export type { Config, ConfigPath } from './config';
export { isConfigPath, hasConfigPathIntersection } from './config';
export { ObjectToConfigAdapter } from './object_to_config_adapter';
export { CliArgs, Env, RawPackageInfo } from './env';
export { EnvironmentMode, PackageInfo } from './types';
export type { CliArgs, RawPackageInfo } from './env';
export { Env } from './env';
export type { EnvironmentMode, PackageInfo } from './types';
export { getPluginSearchPaths } from './plugins';

View file

@ -6,5 +6,6 @@
* Side Public License, v 1.
*/
export { RawConfigService, RawConfigurationProvider, RawConfigAdapter } from './raw_config_service';
export type { RawConfigurationProvider, RawConfigAdapter } from './raw_config_service';
export { RawConfigService } from './raw_config_service';
export { getConfigFromFiles } from './read_config';

View file

@ -1,23 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
const $isCliError = Symbol('isCliError');
interface CliError extends Error {
[$isCliError]: boolean;
}
export function createCliError(message: string) {
const error: Partial<CliError> = new Error(message);
error[$isCliError] = true;
return error as CliError;
}
export function isCliError(error: any): error is CliError {
return error && !!error[$isCliError];
}

View file

@ -19,7 +19,7 @@ const treeKillAsync = promisify((...args: [number, string, any]) => treeKill(...
import { ToolingLog } from '../tooling_log';
import { observeLines } from '../stdio';
import { createCliError } from './errors';
import { createFailError } from '../run';
const SECOND = 1000;
const STOP_TIMEOUT = 30 * SECOND;
@ -57,7 +57,7 @@ export type Proc = ReturnType<typeof startProc>;
export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
const { cmd, args, cwd, env, stdin } = options;
log.info('[%s] > %s', name, cmd, args.join(' '));
log.info('[%s] > %s', name, cmd === process.execPath ? 'node' : cmd, args.join(' '));
// spawn fails with ENOENT when either the
// cmd or cwd don't exist, so we check for the cwd
@ -97,7 +97,9 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
}
// JVM exits with 143 on SIGTERM and 130 on SIGINT, dont' treat then as errors
if (code > 0 && !(code === 143 || code === 130)) {
throw createCliError(`[${name}] exited with code ${code}`);
throw createFailError(`[${name}] exited with code ${code}`, {
exitCode: code,
});
}
return code;

View file

@ -11,7 +11,7 @@ import { filter, first, catchError, map } from 'rxjs/operators';
import exitHook from 'exit-hook';
import { ToolingLog } from '../tooling_log';
import { createCliError } from './errors';
import { createFailError } from '../run';
import { Proc, ProcOptions, startProc } from './proc';
const SECOND = 1000;
@ -61,7 +61,6 @@ export class ProcRunner {
*/
async run(name: string, options: RunOptions) {
const {
cmd,
args = [],
cwd = process.cwd(),
stdin = undefined,
@ -69,6 +68,7 @@ export class ProcRunner {
waitTimeout = 15 * MINUTE,
env = process.env,
} = options;
const cmd = options.cmd === 'node' ? process.execPath : options.cmd;
if (this.closing) {
throw new Error('ProcRunner is closing');
@ -99,7 +99,7 @@ export class ProcRunner {
first(),
catchError((err) => {
if (err.name !== 'EmptyError') {
throw createCliError(`[${name}] exited without matching pattern: ${wait}`);
throw createFailError(`[${name}] exited without matching pattern: ${wait}`);
} else {
throw err;
}
@ -110,7 +110,7 @@ export class ProcRunner {
: Rx.timer(waitTimeout).pipe(
map(() => {
const sec = waitTimeout / SECOND;
throw createCliError(
throw createFailError(
`[${name}] failed to match pattern within ${sec} seconds [pattern=${wait}]`
);
})

View file

@ -8,8 +8,10 @@
export { ToolingLog } from './tooling_log';
export type { ToolingLogOptions } from './tooling_log';
export { ToolingLogTextWriter, ToolingLogTextWriterConfig } from './tooling_log_text_writer';
export { pickLevelFromFlags, parseLogLevel, LogLevel, ParsedLogLevel } from './log_levels';
export type { ToolingLogTextWriterConfig } from './tooling_log_text_writer';
export { ToolingLogTextWriter } from './tooling_log_text_writer';
export type { LogLevel, ParsedLogLevel } from './log_levels';
export { pickLevelFromFlags, parseLogLevel } from './log_levels';
export { ToolingLogCollectingWriter } from './tooling_log_collecting_writer';
export type { Writer } from './writer';
export type { Message } from './message';

View file

@ -20,7 +20,8 @@ export {
export { createFilterRecordsStream } from './records';
export { createStats, Stats } from './stats';
export type { Stats } from './stats';
export { createStats } from './stats';
export {
isGzip,

View file

@ -7,11 +7,12 @@
*/
export { migrateFilter } from './migrate_filter';
export { buildEsQuery, EsQueryConfig } from './build_es_query';
export type { EsQueryConfig } from './build_es_query';
export { buildEsQuery } from './build_es_query';
export { buildQueryFromFilters } from './from_filters';
export { luceneStringToDsl } from './lucene_string_to_dsl';
export { decorateQuery } from './decorate_query';
export {
export type {
IndexPatternBase,
IndexPatternFieldBase,
IFieldSubType,

View file

@ -6,12 +6,12 @@
* Side Public License, v 1.
*/
export type { FilterCompareOptions } from './helpers';
export {
dedupFilters,
uniqFilters,
compareFilters,
COMPARE_ALL_OPTIONS,
FilterCompareOptions,
cleanFilter,
isFilter,
isFilters,
@ -53,7 +53,7 @@ export {
getFilterParams,
} from './build_filters';
export {
export type {
Query,
Filter,
LatLon,

View file

@ -23,4 +23,4 @@ export const toElasticsearchQuery = (...params: Parameters<typeof astToElasticse
export { KQLSyntaxError } from './kuery_syntax_error';
export { nodeTypes, nodeBuilder } from './node_types';
export { fromKueryExpression } from './ast';
export { DslQuery, KueryNode, KueryQueryOptions } from './types';
export type { DslQuery, KueryNode, KueryQueryOptions } from './types';

View file

@ -12,7 +12,7 @@ import * as namedArg from './named_arg';
import * as wildcard from './wildcard';
import { NodeTypes } from './types';
export { NodeTypes };
export type { NodeTypes };
export { nodeBuilder } from './node_builder';
/**

View file

@ -15,4 +15,5 @@ export {
getFilterableKbnTypeNames,
} from './kbn_field_types';
export { KBN_FIELD_TYPES, ES_FIELD_TYPES, KbnFieldTypeOptions } from './types';
export type { KbnFieldTypeOptions } from './types';
export { KBN_FIELD_TYPES, ES_FIELD_TYPES } from './types';

View file

@ -6,13 +6,8 @@
* Side Public License, v 1.
*/
export {
fromExpression,
toExpression,
safeElementFromExpression,
Ast,
ExpressionFunctionAST,
} from './lib/ast';
export type { Ast, ExpressionFunctionAST } from './lib/ast';
export { fromExpression, toExpression, safeElementFromExpression } from './lib/ast';
export { Fn } from './lib/fn';
export { getType } from './lib/get_type';
export { castProvider } from './lib/cast';

View file

@ -44,7 +44,7 @@ import { EcsUser } from './user';
import { EcsUserAgent } from './user_agent';
import { EcsVulnerability } from './vulnerability';
export { EcsEventCategory, EcsEventKind, EcsEventOutcome, EcsEventType } from './event';
export type { EcsEventCategory, EcsEventKind, EcsEventOutcome, EcsEventType } from './event';
interface EcsField {
/**

View file

@ -6,11 +6,12 @@
* Side Public License, v 1.
*/
export { LogLevel, LogLevelId } from './log_level';
export { LogRecord } from './log_record';
export { Logger } from './logger';
export { LogMeta } from './log_meta';
export { LoggerFactory } from './logger_factory';
export { Layout } from './layout';
export { Appender, DisposableAppender } from './appenders';
export { Ecs, EcsEventCategory, EcsEventKind, EcsEventOutcome, EcsEventType } from './ecs';
export type { LogLevelId } from './log_level';
export { LogLevel } from './log_level';
export type { LogRecord } from './log_record';
export type { Logger } from './logger';
export type { LogMeta } from './log_meta';
export type { LoggerFactory } from './logger_factory';
export type { Layout } from './layout';
export type { Appender, DisposableAppender } from './appenders';
export type { Ecs, EcsEventCategory, EcsEventKind, EcsEventOutcome, EcsEventType } from './ecs';

View file

@ -6,4 +6,5 @@
* Side Public License, v 1.
*/
export { MockedLogger, loggerMock } from './logger.mock';
export type { MockedLogger } from './logger.mock';
export { loggerMock } from './logger.mock';

View file

@ -8,4 +8,4 @@
export { PainlessWorker } from './painless_worker';
export { PainlessError } from './lib';
export type { PainlessError } from './lib';

View file

@ -8,6 +8,6 @@
export { getAutocompleteSuggestions } from './autocomplete';
export { PainlessError } from './error_listener';
export type { PainlessError } from './error_listener';
export { parseAndGetSyntaxErrors } from './parser';

View file

@ -7,7 +7,7 @@
*/
export * from './optimizer_config';
export { WorkerStdio } from './observe_worker';
export type { WorkerStdio } from './observe_worker';
export * from './optimizer_state';
export * from './cache_keys';
export * from './watch_bundles_for_changes';

View file

@ -548,12 +548,6 @@ Object.defineProperty(exports, "ToolingLogTextWriter", {
return _tooling_log_text_writer.ToolingLogTextWriter;
}
});
Object.defineProperty(exports, "ToolingLogTextWriterConfig", {
enumerable: true,
get: function () {
return _tooling_log_text_writer.ToolingLogTextWriterConfig;
}
});
Object.defineProperty(exports, "pickLevelFromFlags", {
enumerable: true,
get: function () {
@ -566,18 +560,6 @@ Object.defineProperty(exports, "parseLogLevel", {
return _log_levels.parseLogLevel;
}
});
Object.defineProperty(exports, "LogLevel", {
enumerable: true,
get: function () {
return _log_levels.LogLevel;
}
});
Object.defineProperty(exports, "ParsedLogLevel", {
enumerable: true,
get: function () {
return _log_levels.ParsedLogLevel;
}
});
Object.defineProperty(exports, "ToolingLogCollectingWriter", {
enumerable: true,
get: function () {
@ -15580,8 +15562,6 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Log", function() { return Log; });
/* harmony import */ var _kbn_dev_utils_tooling_log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
/* harmony import */ var _kbn_dev_utils_tooling_log__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_kbn_dev_utils_tooling_log__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LogLevel", function() { return _kbn_dev_utils_tooling_log__WEBPACK_IMPORTED_MODULE_0__["LogLevel"]; });
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
/*
@ -22197,8 +22177,128 @@ module.exports = function globParent(str, opts) {
var isExtglob = __webpack_require__(267);
var chars = { '{': '}', '(': ')', '[': ']'};
var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
var strictCheck = function(str) {
if (str[0] === '!') {
return true;
}
var index = 0;
var pipeIndex = -2;
var closeSquareIndex = -2;
var closeCurlyIndex = -2;
var closeParenIndex = -2;
var backSlashIndex = -2;
while (index < str.length) {
if (str[index] === '*') {
return true;
}
if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
return true;
}
if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
if (closeSquareIndex < index) {
closeSquareIndex = str.indexOf(']', index);
}
if (closeSquareIndex > index) {
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
return true;
}
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
return true;
}
}
}
if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
closeCurlyIndex = str.indexOf('}', index);
if (closeCurlyIndex > index) {
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
return true;
}
}
}
if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
closeParenIndex = str.indexOf(')', index);
if (closeParenIndex > index) {
backSlashIndex = str.indexOf('\\', index);
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
return true;
}
}
}
if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
if (pipeIndex < index) {
pipeIndex = str.indexOf('|', index);
}
if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
closeParenIndex = str.indexOf(')', pipeIndex);
if (closeParenIndex > pipeIndex) {
backSlashIndex = str.indexOf('\\', pipeIndex);
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
return true;
}
}
}
}
if (str[index] === '\\') {
var open = str[index + 1];
index += 2;
var close = chars[open];
if (close) {
var n = str.indexOf(close, index);
if (n !== -1) {
index = n + 1;
}
}
if (str[index] === '!') {
return true;
}
} else {
index++;
}
}
return false;
};
var relaxedCheck = function(str) {
if (str[0] === '!') {
return true;
}
var index = 0;
while (index < str.length) {
if (/[*?{}()[\]]/.test(str[index])) {
return true;
}
if (str[index] === '\\') {
var open = str[index + 1];
index += 2;
var close = chars[open];
if (close) {
var n = str.indexOf(close, index);
if (n !== -1) {
index = n + 1;
}
}
if (str[index] === '!') {
return true;
}
} else {
index++;
}
}
return false;
};
module.exports = function isGlob(str, options) {
if (typeof str !== 'string' || str === '') {
@ -22209,32 +22309,14 @@ module.exports = function isGlob(str, options) {
return true;
}
var regex = strictRegex;
var match;
var check = strictCheck;
// optionally relax regex
// optionally relax check
if (options && options.strict === false) {
regex = relaxedRegex;
check = relaxedCheck;
}
while ((match = regex.exec(str))) {
if (match[2]) return true;
var idx = match.index + match[0].length;
// if an open bracket/brace/paren is escaped,
// set the index to the next closing character
var open = match[1];
var close = open ? chars[open] : null;
if (open && close) {
var n = str.indexOf(close, idx);
if (n !== -1) {
idx = n + 1;
}
}
str = str.slice(idx);
}
return false;
return check(str);
};

View file

@ -38,4 +38,5 @@ class Log extends ToolingLog {
}
export const log = new Log();
export { LogLevel, Log };
export type { LogLevel };
export { Log };

View file

@ -12,7 +12,7 @@ export { formatRequest } from './format_request';
export { parseEndpoint } from './parse_endpoint';
export { decodeRequestParams } from './decode_request_params';
export { routeValidationObject } from './route_validation_object';
export {
export type {
RouteRepositoryClient,
ReturnOf,
EndpointOf,

View file

@ -7,13 +7,15 @@
*/
export { assertNever } from './assert_never';
export { deepFreeze, Freezable } from './deep_freeze';
export type { Freezable } from './deep_freeze';
export { deepFreeze } from './deep_freeze';
export { get } from './get';
export { mapToObject } from './map_to_object';
export { merge } from './merge';
export { pick } from './pick';
export { withTimeout, isPromise } from './promise';
export { isRelativeUrl, modifyUrl, getUrlOrigin, URLMeaningfulParts } from './url';
export type { URLMeaningfulParts } from './url';
export { isRelativeUrl, modifyUrl, getUrlOrigin } from './url';
export { unset } from './unset';
export { getFlattenedObject } from './get_flattened_object';
export { ensureNoUnsafeProperties } from './ensure_no_unsafe_properties';

View file

@ -103,4 +103,4 @@ export interface FtrConfigProviderContext {
readConfigFile(path: string): Promise<Config>;
}
export { Test, Suite };
export type { Test, Suite };

View file

@ -8,6 +8,7 @@
export { runKibanaServer } from './run_kibana_server';
export { runElasticsearch } from './run_elasticsearch';
export { runFtr, hasTests, assertNoneExcluded, CreateFtrOptions, CreateFtrParams } from './run_ftr';
export type { CreateFtrOptions, CreateFtrParams } from './run_ftr';
export { runFtr, hasTests, assertNoneExcluded } from './run_ftr';
export { KIBANA_ROOT, KIBANA_FTR_SCRIPT, FUNCTIONAL_CONFIG_PATH, API_CONFIG_PATH } from './paths';
export { runCli } from './run_cli';

View file

@ -25,14 +25,8 @@ export { runTests, startServers } from './functional_tests/tasks';
// @internal
export { KIBANA_ROOT } from './functional_tests/lib/paths';
export {
esTestConfig,
createTestEsCluster,
CreateTestEsClusterOptions,
EsTestCluster,
ICluster,
convertToKibanaClient,
} from './es';
export type { CreateTestEsClusterOptions, EsTestCluster, ICluster } from './es';
export { esTestConfig, createTestEsCluster, convertToKibanaClient } from './es';
export { kbnTestConfig, kibanaServerTestUser, kibanaTestUser, adminTestUser } from './kbn';

View file

@ -7,4 +7,4 @@
*/
export { registerTestBed } from './testbed';
export { TestBed, TestBedConfig, SetupFunc, UnwrapPromise } from './types';
export type { TestBed, TestBedConfig, SetupFunc, UnwrapPromise } from './types';

View file

@ -7,7 +7,7 @@
*/
import { PromiseType } from 'utility-types';
export { $Values, Assign, Class, Optional, Required } from 'utility-types';
export type { $Values, Assign, Class, Optional, Required } from 'utility-types';
export type {
JsonArray,

View file

@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
require('../src/setup_node_env');
require('../src/dev/eslint').runEslintWithTypes();

View file

@ -20,9 +20,9 @@ describe('uiSettings/routes', function () {
jest.setTimeout(120_000);
beforeAll(startServers);
/* eslint-disable jest/valid-describe */
// eslint-disable-next-line jest/valid-describe
describe('doc missing', docMissingSuite(savedObjectIndex));
// eslint-disable-next-line jest/valid-describe
describe('doc exists', docExistsSuite(savedObjectIndex));
/* eslint-enable jest/valid-describe */
afterAll(stopServers);
});

View file

@ -8,3 +8,4 @@
export { pickFilesToLint } from './pick_files_to_lint';
export { lintFiles } from './lint_files';
export { runEslintWithTypes } from './run_eslint_with_types';

View file

@ -0,0 +1,171 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import Path from 'path';
import Fs from 'fs';
import Os from 'os';
import execa from 'execa';
import * as Rx from 'rxjs';
import { mergeMap, reduce } from 'rxjs/operators';
import { supportsColor } from 'chalk';
import { REPO_ROOT, run, createFailError } from '@kbn/dev-utils';
import { lastValueFrom } from '@kbn/std';
import { PROJECTS } from '../typescript/projects';
import { Project } from '../typescript/project';
export function runEslintWithTypes() {
run(
async ({ log, flags }) => {
const eslintPath = require.resolve('eslint/bin/eslint');
const ignoreFilePath = Path.resolve(REPO_ROOT, '.eslintignore');
const configTemplate = Fs.readFileSync(
Path.resolve(__dirname, 'types.eslint.config.template.js'),
'utf8'
);
const projectFilter =
flags.project && typeof flags.project === 'string'
? Path.resolve(flags.project)
: undefined;
const projects = PROJECTS.filter((project) => {
if (project.disableTypeCheck) {
log.verbose(`[${project.name}] skipping project with type checking disabled`);
return false;
}
if (projectFilter && project.tsConfigPath !== projectFilter) {
log.verbose(`[${project.name}] skipping because it doesn't match --project`);
return false;
}
return true;
});
if (!projects.length) {
if (projectFilter) {
throw createFailError(`[${projectFilter}] is not a valid tsconfig project`);
}
throw createFailError('unable to find projects to lint');
}
const concurrency = Math.max(1, Math.round((Os.cpus() || []).length / 2) || 1) || 1;
log.info(`Linting ${projects.length} projects, ${concurrency} at a time`);
const failures = await lastValueFrom(
Rx.from(projects).pipe(
mergeMap(async (project) => {
const configFilePath = Path.resolve(project.directory, 'types.eslint.config.js');
Fs.writeFileSync(
configFilePath,
configTemplate.replace(
`'{PACKAGE_CONFIG}'`,
JSON.stringify(JSON.stringify({ rootDir: project.directory }))
),
'utf8'
);
const proc = await execa(
process.execPath,
[
Path.relative(project.directory, eslintPath),
...project.getIncludePatterns().map((p) => (p.endsWith('*') ? `${p}.{ts,tsx}` : p)),
...project.getExcludePatterns().flatMap((p) => ['--ignore-pattern', p]),
...['--ignore-pattern', '**/*.json'],
...['--ext', '.ts,.tsx'],
'--no-error-on-unmatched-pattern',
'--no-inline-config',
'--no-eslintrc',
...['--config', Path.relative(project.directory, configFilePath)],
...['--ignore-path', Path.relative(project.directory, ignoreFilePath)],
...(flags.verbose ? ['--debug'] : []),
...(flags.fix ? ['--fix'] : []),
],
{
cwd: project.directory,
env: {
...(supportsColor ? { FORCE_COLOR: 'true' } : {}),
...process.env,
},
buffer: true,
all: true,
reject: false,
}
);
if (proc.exitCode === 0) {
Fs.unlinkSync(configFilePath);
log.success(project.name);
return undefined;
} else {
log.error(`${project.name} failed`);
log.indent(4);
log.write(proc.all);
log.indent(-4);
return project;
}
}, concurrency),
reduce((acc: Project[], project) => {
if (project) {
return [...acc, project];
} else {
return acc;
}
}, [])
)
);
if (!failures.length) {
log.success(`All projects validated successfully!`);
if (flags.fix) {
log.info(`
After staging your changes, don't forget to run eslint/prettier on them with:
node scripts/precommit_hook --fix
`);
}
return;
}
throw createFailError(
`
${
failures.length
} projects failed, run the following commands locally to try auto-fixing them:
${failures
.map(
(p) =>
`node scripts/eslint_with_types --fix --project ${Path.relative(
REPO_ROOT,
p.tsConfigPath
)}`
)
.join('\n ')}
`
);
},
{
description:
'Run ESLint in each TS project, feeding it the TS config so it can validate our code using the type information',
flags: {
string: ['project'],
boolean: ['fix'],
help: `
--project Only run eslint on a specific ts project
--fix Run eslint in --fix mode
`,
},
}
);
}

View file

@ -0,0 +1,27 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
/**
* THIS FILE IS WRITTEN AUTOMATICALLY by `node scripts/eslint_with_types` and
* should be deleted automatically unless something goes wrong
*/
const config = JSON.parse('{PACKAGE_CONFIG}');
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: config.rootDir,
project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/consistent-type-exports': 'error',
},
};

View file

@ -12,10 +12,6 @@ export { extractMessagesFromPathToMap } from './extract_default_translations';
export { matchEntriesWithExctractors } from './extract_default_translations';
export { arrayify, writeFileAsync, readFileAsync, normalizePath, ErrorReporter } from './utils';
export { serializeToJson, serializeToJson5 } from './serializers';
export {
I18nConfig,
filterConfigPaths,
assignConfigFromPath,
checkConfigNamespacePrefix,
} from './config';
export type { I18nConfig } from './config';
export { filterConfigPaths, assignConfigFromPath, checkConfigNamespacePrefix } from './config';
export { integrateLocaleFiles } from './integrate_locale_files';

View file

@ -66,8 +66,10 @@ export class Project {
const disableTypeCheck = projectOptions?.disableTypeCheck || false;
const name =
projectOptions?.name || Path.relative(REPO_ROOT, directory) || Path.basename(directory);
const include = config.include ? makeMatchers(directory, config.include) : undefined;
const exclude = config.exclude ? makeMatchers(directory, config.exclude) : undefined;
const includePatterns = config.include;
const include = includePatterns ? makeMatchers(directory, includePatterns) : undefined;
const excludePatterns = config.exclude;
const exclude = excludePatterns ? makeMatchers(directory, excludePatterns) : undefined;
let baseProject;
if (config.extends) {
@ -99,7 +101,9 @@ export class Project {
disableTypeCheck,
baseProject,
include,
exclude
includePatterns,
exclude,
excludePatterns
);
cache.set(tsConfigPath, project);
return project;
@ -114,9 +118,22 @@ export class Project {
public readonly baseProject?: Project,
private readonly include?: IMinimatch[],
private readonly exclude?: IMinimatch[]
private readonly includePatterns?: string[],
private readonly exclude?: IMinimatch[],
private readonly excludePatterns?: string[]
) {}
public getIncludePatterns(): string[] {
return this.includePatterns
? this.includePatterns
: this.baseProject?.getIncludePatterns() ?? [];
}
public getExcludePatterns(): string[] {
return this.excludePatterns
? this.excludePatterns
: this.baseProject?.getExcludePatterns() ?? [];
}
private getInclude(): IMinimatch[] {
return this.include ? this.include : this.baseProject?.getInclude() ?? [];
}

View file

@ -9,7 +9,7 @@
import React from 'react';
import { PluginInitializerContext } from 'kibana/public';
import { AdvancedSettingsPlugin } from './plugin';
export { AdvancedSettingsSetup, AdvancedSettingsStart } from './types';
export type { AdvancedSettingsSetup, AdvancedSettingsStart } from './types';
export { ComponentRegistry } from './component_registry';
/**

View file

@ -6,7 +6,5 @@
* Side Public License, v 1.
*/
export {
createStreamingBatchedFunction,
StreamingBatchedFunctionParams,
} from './create_streaming_batched_function';
export type { StreamingBatchedFunctionParams } from './create_streaming_batched_function';
export { createStreamingBatchedFunction } from './create_streaming_batched_function';

View file

@ -9,10 +9,10 @@
import { PluginInitializerContext } from '../../../core/public';
import { BfetchPublicPlugin } from './plugin';
export { BfetchPublicSetup, BfetchPublicStart, BfetchPublicContract } from './plugin';
export type { BfetchPublicSetup, BfetchPublicStart, BfetchPublicContract } from './plugin';
export { split } from './streaming';
export { BatchedFunc } from './batching/types';
export type { BatchedFunc } from './batching/types';
export function plugin(initializerContext: PluginInitializerContext) {
return new BfetchPublicPlugin(initializerContext);

View file

@ -9,7 +9,7 @@
import { PluginInitializerContext } from '../../../core/server';
import { BfetchServerPlugin } from './plugin';
export { BfetchServerSetup, BfetchServerStart, BatchProcessingRouteParams } from './plugin';
export type { BfetchServerSetup, BfetchServerStart, BatchProcessingRouteParams } from './plugin';
export function plugin(initializerContext: PluginInitializerContext) {
return new BfetchServerPlugin(initializerContext);

View file

@ -9,23 +9,19 @@
export const COLOR_MAPPING_SETTING = 'visualization:colorMapping';
export const LEGACY_TIME_AXIS = 'visualization:useLegacyTimeAxis';
export {
export type {
CustomPaletteArguments,
CustomPaletteState,
SystemPaletteArguments,
PaletteOutput,
defaultCustomColors,
palette,
systemPalette,
} from './palette';
export { defaultCustomColors, palette, systemPalette } from './palette';
export { paletteIds } from './constants';
export type { ColorSchema, RawColorSchema, ColorMap } from './static';
export {
ColorSchemas,
ColorSchema,
RawColorSchema,
ColorMap,
vislibColorMaps,
colorSchemas,
getHeatmapColors,
@ -37,4 +33,4 @@ export {
MULTILAYER_TIME_AXIS_STYLE,
} from './static';
export { ColorSchemaParams, Labels, Style } from './types';
export type { ColorSchemaParams, Labels, Style } from './types';

View file

@ -6,13 +6,7 @@
* Side Public License, v 1.
*/
export {
ColorSchemas,
ColorSchema,
RawColorSchema,
ColorMap,
vislibColorMaps,
colorSchemas,
} from './color_maps';
export type { ColorSchema, RawColorSchema, ColorMap } from './color_maps';
export { ColorSchemas, vislibColorMaps, colorSchemas } from './color_maps';
export { getHeatmapColors } from './heatmap_color';
export { truncatedColorMaps, truncatedColorSchemas } from './truncated_color_maps';

View file

@ -6,11 +6,9 @@
* Side Public License, v 1.
*/
export type { ColorSchema, RawColorSchema, ColorMap } from './color_maps';
export {
ColorSchemas,
ColorSchema,
RawColorSchema,
ColorMap,
vislibColorMaps,
colorSchemas,
getHeatmapColors,

View file

@ -13,23 +13,28 @@ import { ChartsPlugin } from './plugin';
export const plugin = () => new ChartsPlugin();
export { ChartsPluginSetup, ChartsPluginStart } from './plugin';
export type { ChartsPluginSetup, ChartsPluginStart } from './plugin';
export * from './static';
export * from './services/palettes/types';
export { lightenColor } from './services/palettes/lighten_color';
export { useActiveCursor } from './services/active_cursor';
export {
export type {
PaletteOutput,
CustomPaletteArguments,
CustomPaletteState,
SystemPaletteArguments,
paletteIds,
ColorSchemas,
ColorSchema,
RawColorSchema,
ColorMap,
ColorSchemaParams,
Labels,
Style,
} from '../common';
export {
paletteIds,
ColorSchemas,
vislibColorMaps,
colorSchemas,
getHeatmapColors,
@ -38,7 +43,4 @@ export {
ColorMode,
LabelRotation,
defaultCountLabel,
ColorSchemaParams,
Labels,
Style,
} from '../common';

View file

@ -39,10 +39,8 @@ export class ThemeService {
/** A React hook for consuming the dark mode value */
public useDarkMode = (): boolean => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const [value, update] = useState(false);
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
const s = this.darkModeEnabled$.subscribe(update);
return () => s.unsubscribe();
@ -53,12 +51,9 @@ export class ThemeService {
/** A React hook for consuming the charts theme */
public useChartsTheme = (): PartialTheme => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const [value, update] = useState(this._chartsTheme$.getValue());
// eslint-disable-next-line react-hooks/rules-of-hooks
const ref = useRef(value);
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
const s = this.chartsTheme$.subscribe((val) => {
if (val !== ref.current) {
@ -74,12 +69,9 @@ export class ThemeService {
/** A React hook for consuming the charts theme */
public useChartsBaseTheme = (): Theme => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const [value, update] = useState(this._chartsBaseTheme$.getValue());
// eslint-disable-next-line react-hooks/rules-of-hooks
const ref = useRef(value);
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(() => {
const s = this.chartsBaseTheme$.subscribe((val) => {
if (val !== ref.current) {

View file

@ -7,12 +7,12 @@
*/
import { ChartsServerPlugin } from './plugin';
export {
export type {
PaletteOutput,
CustomPaletteArguments,
CustomPaletteState,
SystemPaletteArguments,
paletteIds,
} from '../common';
export { paletteIds } from '../common';
export const plugin = () => new ChartsServerPlugin();

View file

@ -8,9 +8,11 @@
export { NetworkRequestStatusBar } from './network_request_status_bar';
export { SomethingWentWrongCallout } from './something_went_wrong_callout';
export { TopNavMenuItem, TopNavMenu } from './top_nav_menu';
export type { TopNavMenuItem } from './top_nav_menu';
export { TopNavMenu } from './top_nav_menu';
export { ConsoleMenu } from './console_menu';
export { WelcomePanel } from './welcome_panel';
export { AutocompleteOptions, DevToolsSettingsModal } from './settings_modal';
export type { AutocompleteOptions } from './settings_modal';
export { DevToolsSettingsModal } from './settings_modal';
export { HelpPanel } from './help_panel';
export { EditorContentSpinner } from './editor_content_spinner';

View file

@ -6,7 +6,8 @@
* Side Public License, v 1.
*/
export { useServicesContext, ServicesContextProvider, ContextValue } from './services_context';
export type { ContextValue } from './services_context';
export { useServicesContext, ServicesContextProvider } from './services_context';
export {
useRequestActionContext,

View file

@ -6,5 +6,6 @@
* Side Public License, v 1.
*/
export { createApi, Api } from './api';
export type { Api } from './api';
export { createApi } from './api';
export { createEsHostService, EsHostService } from './es_host_service';

View file

@ -8,4 +8,5 @@
export { createHistory, History } from './history';
export { createStorage, Storage, StorageKeys } from './storage';
export { createSettings, Settings, DevToolsSettings, DEFAULT_SETTINGS } from './settings';
export type { DevToolsSettings } from './settings';
export { createSettings, Settings, DEFAULT_SETTINGS } from './settings';

View file

@ -11,5 +11,5 @@ export * from './core_editor';
export * from './token';
export * from './tokens_provider';
export * from './common';
export { ClientConfigType } from './config';
export { ConsoleUILocatorParams } from './locator';
export type { ClientConfigType } from './config';
export type { ConsoleUILocatorParams } from './locator';

View file

@ -10,7 +10,7 @@ import { PluginInitializerContext } from 'kibana/server';
import { ConsoleServerPlugin } from './plugin';
export { ConsoleSetup, ConsoleStart } from './types';
export type { ConsoleSetup, ConsoleStart } from './types';
export { config } from './config';

View file

@ -8,7 +8,8 @@
import { ReplacementCard } from './replacement_card';
export { ReplacementCard, Props } from './replacement_card';
export type { Props } from './replacement_card';
export { ReplacementCard } from './replacement_card';
// required for dynamic import using React.lazy()
// eslint-disable-next-line import/no-default-export

View file

@ -14,7 +14,7 @@ export function plugin() {
return new CustomIntegrationsPlugin();
}
export { CustomIntegrationsSetup, CustomIntegrationsStart } from './types';
export type { CustomIntegrationsSetup, CustomIntegrationsStart } from './types';
export { withSuspense, LazyReplacementCard } from './components';
export { filterCustomIntegrations } from './services/find';

View file

@ -17,7 +17,7 @@ export function plugin(initializerContext: PluginInitializerContext) {
return new CustomIntegrationsPlugin(initializerContext);
}
export { CustomIntegrationsPluginSetup, CustomIntegrationsPluginStart } from './types';
export type { CustomIntegrationsPluginSetup, CustomIntegrationsPluginStart } from './types';
export type { IntegrationCategory, CustomIntegration } from '../common';

View file

@ -6,14 +6,14 @@
* Side Public License, v 1.
*/
export { GridData } from './embeddable/types';
export {
export type { GridData } from './embeddable/types';
export type {
RawSavedDashboardPanel730ToLatest,
DashboardDoc730ToLatest,
DashboardDoc700To720,
DashboardDocPre700,
} from './bwc/types';
export {
export type {
DashboardContainerStateWithType,
SavedDashboardPanelTo60,
SavedDashboardPanel610,

View file

@ -6,39 +6,22 @@
* Side Public License, v 1.
*/
export type { ExpandPanelActionContext } from './expand_panel_action';
export { ExpandPanelAction, ACTION_EXPAND_PANEL } from './expand_panel_action';
export type { ReplacePanelActionContext } from './replace_panel_action';
export { ReplacePanelAction, ACTION_REPLACE_PANEL } from './replace_panel_action';
export type { ClonePanelActionContext } from './clone_panel_action';
export { ClonePanelAction, ACTION_CLONE_PANEL } from './clone_panel_action';
export type { AddToLibraryActionContext } from './add_to_library_action';
export { AddToLibraryAction, ACTION_ADD_TO_LIBRARY } from './add_to_library_action';
export type { UnlinkFromLibraryActionContext } from './unlink_from_library_action';
export { UnlinkFromLibraryAction, ACTION_UNLINK_FROM_LIBRARY } from './unlink_from_library_action';
export type { CopyToDashboardActionContext } from './copy_to_dashboard_action';
export { CopyToDashboardAction, ACTION_COPY_TO_DASHBOARD } from './copy_to_dashboard_action';
export type { LibraryNotificationActionContext } from './library_notification_action';
export {
ExpandPanelAction,
ExpandPanelActionContext,
ACTION_EXPAND_PANEL,
} from './expand_panel_action';
export {
ReplacePanelAction,
ReplacePanelActionContext,
ACTION_REPLACE_PANEL,
} from './replace_panel_action';
export {
ClonePanelAction,
ClonePanelActionContext,
ACTION_CLONE_PANEL,
} from './clone_panel_action';
export {
AddToLibraryAction,
AddToLibraryActionContext,
ACTION_ADD_TO_LIBRARY,
} from './add_to_library_action';
export {
UnlinkFromLibraryAction,
UnlinkFromLibraryActionContext,
ACTION_UNLINK_FROM_LIBRARY,
} from './unlink_from_library_action';
export {
CopyToDashboardAction,
CopyToDashboardActionContext,
ACTION_COPY_TO_DASHBOARD,
} from './copy_to_dashboard_action';
export {
LibraryNotificationActionContext,
LibraryNotificationAction,
ACTION_LIBRARY_NOTIFICATION,
} from './library_notification_action';
export { ExportContext, ExportCSVAction, ACTION_EXPORT_CSV } from './export_csv_action';
export type { ExportContext } from './export_csv_action';
export { ExportCSVAction, ACTION_EXPORT_CSV } from './export_csv_action';

View file

@ -6,10 +6,8 @@
* Side Public License, v 1.
*/
export {
DashboardContainerFactoryDefinition,
DashboardContainerFactory,
} from './dashboard_container_factory';
export type { DashboardContainerFactory } from './dashboard_container_factory';
export { DashboardContainerFactoryDefinition } from './dashboard_container_factory';
export type { DashboardContainer } from './dashboard_container';
export { createPanelState } from './panel';

View file

@ -16,22 +16,19 @@ export {
} from './application';
export { DashboardConstants, createDashboardEditUrl } from './dashboard_constants';
export {
export type {
DashboardSetup,
DashboardStart,
DashboardUrlGenerator,
DashboardFeatureFlagConfig,
} from './plugin';
export {
DASHBOARD_APP_URL_GENERATOR,
createDashboardUrlGenerator,
DashboardUrlGeneratorState,
} from './url_generator';
export { DashboardAppLocator, DashboardAppLocatorParams } from './locator';
export type { DashboardUrlGeneratorState } from './url_generator';
export { DASHBOARD_APP_URL_GENERATOR, createDashboardUrlGenerator } from './url_generator';
export type { DashboardAppLocator, DashboardAppLocatorParams } from './locator';
export { DashboardSavedObject } from './saved_dashboards';
export { SavedDashboardPanel, DashboardContainerInput } from './types';
export type { DashboardSavedObject } from './saved_dashboards';
export type { SavedDashboardPanel, DashboardContainerInput } from './types';
export function plugin(initializerContext: PluginInitializerContext) {
return new DashboardPlugin(initializerContext);

View file

@ -6,12 +6,12 @@
* Side Public License, v 1.
*/
export {
export type {
AppMountParameters,
CoreSetup,
Capabilities,
PluginInitializerContext,
ScopedHistory,
NotificationsStart,
ApplicationStart,
} from '../../../../core/public';
export { ScopedHistory } from '../../../../core/public';

View file

@ -6,4 +6,5 @@
* Side Public License, v 1.
*/
export { FeatureCatalogueCategory, HomePublicPluginSetup } from '../../../home/public';
export type { HomePublicPluginSetup } from '../../../home/public';
export { FeatureCatalogueCategory } from '../../../home/public';

View file

@ -6,6 +6,11 @@
* Side Public License, v 1.
*/
export type {
KibanaReactContext,
KibanaReactContextValue,
ExitFullScreenButtonProps,
} from '../../../kibana_react/public';
export {
context,
useKibana,
@ -13,9 +18,6 @@ export {
toMountPoint,
TableListView,
reactToUiComponent,
KibanaReactContext,
ExitFullScreenButton,
KibanaContextProvider,
KibanaReactContextValue,
ExitFullScreenButtonProps,
} from '../../../kibana_react/public';

View file

@ -6,19 +6,21 @@
* Side Public License, v 1.
*/
export type {
ISyncStateRef,
IKbnUrlStateStorage,
ReduxLikeStateContainer,
} from '../../../kibana_utils/public';
export {
Storage,
unhashUrl,
syncState,
ISyncStateRef,
getQueryParams,
setStateToKbnUrl,
removeQueryParam,
withNotifyOnErrors,
IKbnUrlStateStorage,
createKbnUrlTracker,
SavedObjectNotFound,
createStateContainer,
ReduxLikeStateContainer,
createKbnUrlStateStorage,
} from '../../../kibana_utils/public';

View file

@ -6,4 +6,4 @@
* Side Public License, v 1.
*/
export { NavigationPublicPluginStart } from '../../../navigation/public';
export type { NavigationPublicPluginStart } from '../../../navigation/public';

View file

@ -6,9 +6,5 @@
* Side Public License, v 1.
*/
export {
PresentationUtilPluginStart,
LazyDashboardPicker,
withSuspense,
useLabs,
} from '../../../presentation_util/public';
export type { PresentationUtilPluginStart } from '../../../presentation_util/public';
export { LazyDashboardPicker, withSuspense, useLabs } from '../../../presentation_util/public';

View file

@ -6,14 +6,16 @@
* Side Public License, v 1.
*/
export {
export type {
SaveResult,
SavedObject,
showSaveModal,
SavedObjectLoader,
SavedObjectsStart,
SavedObjectSaveOpts,
SavedObjectSaveModal,
getSavedObjectFinder,
SavedObjectLoaderFindOptions,
} from '../../../saved_objects/public';
export {
showSaveModal,
SavedObjectLoader,
SavedObjectSaveModal,
getSavedObjectFinder,
} from '../../../saved_objects/public';

View file

@ -6,9 +6,9 @@
* Side Public License, v 1.
*/
export {
export type {
SharePluginStart,
SharePluginSetup,
downloadMultipleAs,
UrlGeneratorContract,
} from '../../../share/public';
export { downloadMultipleAs } from '../../../share/public';

View file

@ -6,4 +6,4 @@
* Side Public License, v 1.
*/
export { SpacesPluginStart } from '../../../../../x-pack/plugins/spaces/public';
export type { SpacesPluginStart } from '../../../../../x-pack/plugins/spaces/public';

View file

@ -6,9 +6,5 @@
* Side Public License, v 1.
*/
export {
Action,
IncompatibleActionError,
UiActionsSetup,
UiActionsStart,
} from '../../../ui_actions/public';
export type { Action, UiActionsSetup, UiActionsStart } from '../../../ui_actions/public';
export { IncompatibleActionError } from '../../../ui_actions/public';

View file

@ -6,4 +6,4 @@
* Side Public License, v 1.
*/
export { UsageCollectionSetup } from '../../../usage_collection/public';
export type { UsageCollectionSetup } from '../../../usage_collection/public';

View file

@ -39,7 +39,7 @@ import { DashboardAppLocatorParams } from './locator';
import { SpacesPluginStart } from './services/spaces';
import type { DashboardControlGroupInput } from './application/lib/dashboard_control_group';
export { SavedDashboardPanel };
export type { SavedDashboardPanel };
export type NavAction = (anchorElement?: any) => void;
export interface SavedDashboardPanelMap {

View file

@ -24,5 +24,5 @@ export function plugin(initializerContext: PluginInitializerContext) {
return new DashboardPlugin(initializerContext);
}
export { DashboardPluginSetup, DashboardPluginStart } from './types';
export type { DashboardPluginSetup, DashboardPluginStart } from './types';
export { findByValueEmbeddables } from './usage/find_by_value_embeddables';

View file

@ -373,6 +373,21 @@ type EsQueryConfig = oldEsQueryConfig;
* @removeBy 8.1
*/
export type {
Filter,
RangeFilterMeta,
RangeFilterParams,
ExistsFilter,
PhrasesFilter,
PhraseFilter,
MatchAllFilter,
CustomFilter,
RangeFilter,
KueryNode,
FilterMeta,
IFieldSubType,
EsQueryConfig,
};
export {
COMPARE_ALL_OPTIONS,
compareFilters,
@ -414,17 +429,4 @@ export {
onlyDisabledFiltersChanged,
uniqFilters,
FilterStateStore,
Filter,
RangeFilterMeta,
RangeFilterParams,
ExistsFilter,
PhrasesFilter,
PhraseFilter,
MatchAllFilter,
CustomFilter,
RangeFilter,
KueryNode,
FilterMeta,
IFieldSubType,
EsQueryConfig,
};

View file

@ -51,6 +51,12 @@ export type {
IndexPatternLoadStartDependencies,
IndexPatternLoadExpressionFunctionDefinition,
} from '../../data_views/common';
export type {
IndexPatternsContract,
DataViewsContract,
IndexPatternListItem,
DataViewListItem,
} from '../../data_views/common';
export {
RUNTIME_FIELD_TYPES,
FLEET_ASSETS_TO_IGNORE,
@ -64,13 +70,9 @@ export {
DataViewType,
IndexPatternType,
IndexPatternsService,
IndexPatternsContract,
DataViewsService,
DataViewsContract,
IndexPattern,
IndexPatternListItem,
DataView,
DataViewListItem,
DuplicateDataViewError,
DataViewSavedObjectConflictError,
getIndexPatternLoadMeta,

View file

@ -8,4 +8,5 @@
import { KbnFieldTypeOptions, ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types';
export { KbnFieldTypeOptions, ES_FIELD_TYPES, KBN_FIELD_TYPES };
export type { KbnFieldTypeOptions };
export { ES_FIELD_TYPES, KBN_FIELD_TYPES };

View file

@ -89,14 +89,14 @@ import {
aggSinglePercentile,
} from './';
export { IAggConfig, AggConfigSerialized } from './agg_config';
export { CreateAggConfigParams, IAggConfigs } from './agg_configs';
export { IAggType } from './agg_type';
export { AggParam, AggParamOption } from './agg_params';
export { IFieldParamType } from './param_types';
export { IMetricAggType } from './metrics/metric_agg_type';
export { IpRangeKey } from './buckets/lib/ip_range';
export { OptionedValueProp } from './param_types/optioned';
export type { IAggConfig, AggConfigSerialized } from './agg_config';
export type { CreateAggConfigParams, IAggConfigs } from './agg_configs';
export type { IAggType } from './agg_type';
export type { AggParam, AggParamOption } from './agg_params';
export type { IFieldParamType } from './param_types';
export type { IMetricAggType } from './metrics/metric_agg_type';
export type { IpRangeKey } from './buckets/lib/ip_range';
export type { OptionedValueProp } from './param_types/optioned';
/** @internal */
export interface AggsCommonSetup {

View file

@ -6,11 +6,8 @@
* Side Public License, v 1.
*/
export {
ACTION_GLOBAL_APPLY_FILTER,
createFilterAction,
ApplyGlobalFilterActionContext,
} from './apply_filter_action';
export type { ApplyGlobalFilterActionContext } from './apply_filter_action';
export { ACTION_GLOBAL_APPLY_FILTER, createFilterAction } from './apply_filter_action';
export { createFiltersFromValueClickAction } from './filters/create_filters_from_value_click';
export { createFiltersFromRangeSelectAction } from './filters/create_filters_from_range_select';
export * from './select_range_action';

View file

@ -7,4 +7,5 @@
*/
export { createUsageCollector } from './create_usage_collector';
export { AUTOCOMPLETE_EVENT_TYPE, AutocompleteUsageCollector } from './types';
export type { AutocompleteUsageCollector } from './types';
export { AUTOCOMPLETE_EVENT_TYPE } from './types';

View file

@ -6,13 +6,14 @@
* Side Public License, v 1.
*/
export {
export type {
QuerySuggestion,
QuerySuggestionTypes,
QuerySuggestionGetFn,
QuerySuggestionGetFnArgs,
QuerySuggestionBasic,
QuerySuggestionField,
} from './providers/query_suggestion_provider';
export { QuerySuggestionTypes } from './providers/query_suggestion_provider';
export { AutocompleteService, AutocompleteSetup, AutocompleteStart } from './autocomplete_service';
export type { AutocompleteSetup, AutocompleteStart } from './autocomplete_service';
export { AutocompleteService } from './autocomplete_service';

View file

@ -137,7 +137,7 @@ export const esFilters = {
/**
* Deprecated type exports
*/
export {
export type {
KueryNode,
RangeFilter,
RangeFilterMeta,
@ -149,9 +149,8 @@ export {
MatchAllFilter,
IFieldSubType,
EsQueryConfig,
isFilter,
isFilters,
};
export { isFilter, isFilters };
/**
* @deprecated Import helpers from the "@kbn/es-query" package directly instead.

View file

@ -70,29 +70,26 @@ export const indexPatterns = {
validate: validateDataView,
};
export {
IndexPatternsContract,
DataViewsContract,
IndexPattern,
IndexPatternField,
TypeMeta,
} from './data_views';
export type { IndexPatternsContract, DataViewsContract, TypeMeta } from './data_views';
export { IndexPattern, IndexPatternField } from './data_views';
export {
export type {
IIndexPattern,
IFieldType,
ES_FIELD_TYPES,
KBN_FIELD_TYPES,
IndexPatternAttributes,
UI_SETTINGS,
AggregationRestrictions as IndexPatternAggRestrictions,
IndexPatternSpec,
IndexPatternLoadExpressionFunctionDefinition,
fieldList,
GetFieldsOptions,
AggregationRestrictions,
IndexPatternType,
IndexPatternListItem,
} from '../common';
export {
ES_FIELD_TYPES,
KBN_FIELD_TYPES,
UI_SETTINGS,
fieldList,
IndexPatternType,
DuplicateDataViewError,
} from '../common';
@ -217,7 +214,8 @@ export type {
SearchUsageCollector,
} from './search';
export { ISearchOptions, isErrorResponse, isCompleteResponse, isPartialResponse } from '../common';
export type { ISearchOptions } from '../common';
export { isErrorResponse, isCompleteResponse, isPartialResponse } from '../common';
// Search namespace
export const search = {
@ -301,7 +299,8 @@ export {
export { isTimeRange, isQuery } from '../common';
export { ACTION_GLOBAL_APPLY_FILTER, ApplyGlobalFilterActionContext } from './actions';
export type { ApplyGlobalFilterActionContext } from './actions';
export { ACTION_GLOBAL_APPLY_FILTER } from './actions';
export { APPLY_FILTER_TRIGGER } from './triggers';
/*

View file

@ -6,8 +6,5 @@
* Side Public License, v 1.
*/
export {
NowProvider,
NowProviderInternalContract,
NowProviderPublicContract,
} from './now_provider';
export type { NowProviderInternalContract, NowProviderPublicContract } from './now_provider';
export { NowProvider } from './now_provider';

View file

@ -6,4 +6,5 @@
* Side Public License, v 1.
*/
export { QueryStringContract, QueryStringManager } from './query_string_manager';
export type { QueryStringContract } from './query_string_manager';
export { QueryStringManager } from './query_string_manager';

View file

@ -6,5 +6,10 @@
* Side Public License, v 1.
*/
export { SavedQuery, SavedQueryAttributes, SavedQueryService, SavedQueryTimeFilter } from './types';
export type {
SavedQuery,
SavedQueryAttributes,
SavedQueryService,
SavedQueryTimeFilter,
} from './types';
export { createSavedQueryService } from './saved_query_service';

View file

@ -8,4 +8,4 @@
export { connectToQueryState } from './connect_to_query_state';
export { syncQueryStateWithUrl } from './sync_state_with_url';
export { QueryState, QueryStateChange } from './types';
export type { QueryState, QueryStateChange } from './types';

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