From feceb0f98eb817f065834f8b6c9c628cee41383a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2019 16:32:31 -0700 Subject: [PATCH] Update eslint related packages (#48513) * Update eslint related packages * add errorMessage to no-restricted-paths validation * add license to eslintrc file * ignore broken plugin fixture * upgrade tangled peer deps * give name to unnamed func to avoid typescript-eslint/typescript-eslint#1078 * migrate away from removed prefer-interface * migrate away from removed no-angle-bracket-type-assertions rule * migrate away from removed no-triple-slash-reference rule * old config was invalid and made this rule a noop * fix array-type rule config * fix readonly paramProperties that weren't being checked * fix propType ordering * remove references to non-existent rules * remove unnecessary disable that is improperly formatted * fix comment-related spacing * fix typo/invalid namespace overrides * rename fn to avoid hook-alike behavior * remove reference to old removed rule * use caret version for prettier * reference babel-eslint with absolute path --- .eslintignore | 1 + .eslintrc.js | 20 +- kibana.d.ts | 2 +- package.json | 36 +- packages/eslint-config-kibana/javascript.js | 2 +- packages/eslint-config-kibana/package.json | 24 +- packages/eslint-config-kibana/typescript.js | 12 +- packages/kbn-es/src/paths.js | 8 +- .../kbn-eslint-plugin-eslint/package.json | 2 +- .../__tests__/disallow_license_headers.js | 2 +- .../rules/__tests__/no_restricted_paths.js | 2 +- .../rules/__tests__/require_license_header.js | 2 +- .../rules/no_restricted_paths.js | 1 + packages/kbn-test-subj-selector/index.d.ts | 2 +- src/core/public/plugins/plugin.ts | 2 +- .../saved_objects/simple_saved_object.ts | 1 - src/core/server/config/env.ts | 2 +- src/core/server/config/raw_config_service.ts | 2 +- src/core/server/http/router/request.ts | 6 +- src/core/server/http/router/response.ts | 6 +- src/core/server/http/router/router.ts | 2 +- src/core/server/logging/log_level.ts | 2 +- src/core/server/plugins/plugin.ts | 2 +- .../saved_objects/service/lib/repository.ts | 4 +- src/core/server/server.ts | 4 +- .../embeddables/filterable_container.tsx | 2 +- .../embeddables/hello_world_container.tsx | 2 +- .../public/adapters/data/formatted_data.ts | 2 +- .../builtin_action_types/lib/result_type.ts | 4 +- .../legacy/plugins/apm/cypress/cypress.d.ts | 3 - .../apm/cypress/integration/apm.spec.ts | 3 - .../plugins/apm/typings/elasticsearch.ts | 6 +- .../canvas/public/components/app/app.js | 8 +- .../__examples__/color_manager.examples.tsx | 1 - .../__examples__/color_picker.examples.tsx | 1 - .../color_picker_popover.examples.tsx | 1 - .../canvas/public/components/router/router.js | 8 +- .../code/public/monaco/blame/blame_widget.ts | 6 +- .../code/public/monaco/content_widget.ts | 2 +- .../public/monaco/hover/hover_controller.ts | 2 +- .../plugins/code/public/monaco/operation.ts | 8 +- .../code/server/distributed/local_endpoint.ts | 2 +- .../code/server/lsp/abstract_launcher.ts | 8 +- .../plugins/code/server/lsp/controller.ts | 10 +- .../plugins/code/server/lsp/ctags_launcher.ts | 6 +- .../plugins/code/server/lsp/go_launcher.ts | 8 +- .../code/server/lsp/install_manager.ts | 2 +- .../plugins/code/server/lsp/java_launcher.ts | 8 +- .../server/lsp/process/embed_ctag_server.ts | 2 +- .../code/server/lsp/process/embed_program.ts | 2 +- .../server/lsp/process/external_program.ts | 6 +- .../code/server/lsp/request_expander.ts | 10 +- .../plugins/code/server/lsp/ts_launcher.ts | 8 +- .../code/server/lsp/workspace_command.ts | 8 +- .../code/server/lsp/workspace_handler.ts | 2 +- .../server/repository_config_controller.ts | 2 +- x-pack/legacy/plugins/code/server/security.ts | 2 +- .../plugins/code/server/utils/cancelable.ts | 4 +- .../code/server/utils/es_index_client.ts | 2 +- .../server/utils/esclient_with_request.ts | 2 +- .../code/server/utils/format_parser.ts | 2 +- .../plugins/code/server/utils/with_request.ts | 2 +- .../plugins/infra/public/utils/url_state.tsx | 1 - .../dimension_panel/dimension_panel.test.tsx | 2 +- .../public/layers/joins/inner_join.test.js | 2 +- .../public/components/flyout/header/index.tsx | 2 +- .../test_helpers/time_range_container.ts | 2 +- x-pack/test/mocha_decorations.d.ts | 3 +- yarn.lock | 334 ++++++++++-------- 69 files changed, 361 insertions(+), 291 deletions(-) diff --git a/.eslintignore b/.eslintignore index 77c83dc71d7f25..cf13fc28467d94 100644 --- a/.eslintignore +++ b/.eslintignore @@ -40,6 +40,7 @@ bower_components /x-pack/legacy/plugins/infra/public/graphql/types.ts /x-pack/legacy/plugins/infra/server/graphql/types.ts /x-pack/legacy/plugins/apm/cypress/**/snapshots.js +/src/legacy/plugin_discovery/plugin_pack/__tests__/fixtures/plugins/broken **/graphql/types.ts **/*.js.snap !/.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js index 12bdd11fc85288..22d8e67ea702d9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + const { readdirSync } = require('fs'); const { resolve } = require('path'); @@ -622,7 +641,6 @@ module.exports = { // will introduced after the other warns are fixed // 'react/sort-comp': 'error', 'react/void-dom-elements-no-children': 'error', - 'react/jsx-boolean-value': ['error', 'warn'], // will introduced after the other warns are fixed // 'react/jsx-no-bind': 'error', 'react/jsx-no-comment-textnodes': 'error', diff --git a/kibana.d.ts b/kibana.d.ts index d242965e9bdd5a..68538320e05a2c 100644 --- a/kibana.d.ts +++ b/kibana.d.ts @@ -35,7 +35,7 @@ import * as LegacyKibanaServer from './src/legacy/server/kbn_server'; /** * Re-export legacy types under a namespace. */ -// eslint-disable-next-line @typescript/eslint-no-namespace +// eslint-disable-next-line @typescript-eslint/no-namespace export namespace Legacy { export type IndexPatternsService = LegacyKibanaServer.IndexPatternsService; export type KibanaConfig = LegacyKibanaServer.KibanaConfig; diff --git a/package.json b/package.json index 5b52686120bf4f..ffd0e9387809db 100644 --- a/package.json +++ b/package.json @@ -301,7 +301,7 @@ "@types/delete-empty": "^2.0.0", "@types/elasticsearch": "^5.0.33", "@types/enzyme": "^3.9.0", - "@types/eslint": "^4.16.8", + "@types/eslint": "^6.1.2", "@types/execa": "^0.9.0", "@types/fetch-mock": "^7.3.1", "@types/getopts": "^2.0.1", @@ -352,8 +352,8 @@ "@types/uuid": "^3.4.4", "@types/vinyl-fs": "^2.4.11", "@types/zen-observable": "^0.8.0", - "@typescript-eslint/eslint-plugin": "1.13.0", - "@typescript-eslint/parser": "1.13.0", + "@typescript-eslint/eslint-plugin": "^2.5.0", + "@typescript-eslint/parser": "^2.5.0", "angular-mocks": "^1.7.8", "archiver": "^3.1.1", "babel-eslint": "^10.0.3", @@ -373,21 +373,21 @@ "enzyme-adapter-react-16": "^1.14.0", "enzyme-adapter-utils": "^1.12.0", "enzyme-to-json": "^3.3.4", - "eslint": "5.16.0", - "eslint-config-prettier": "6.3.0", + "eslint": "^6.5.1", + "eslint-config-prettier": "^6.4.0", "eslint-plugin-babel": "^5.3.0", - "eslint-plugin-ban": "1.3.0", - "eslint-plugin-cypress": "^2.6.1", - "eslint-plugin-import": "2.18.2", - "eslint-plugin-jest": "22.17.0", - "eslint-plugin-jsx-a11y": "6.2.3", - "eslint-plugin-mocha": "6.1.1", - "eslint-plugin-no-unsanitized": "3.0.2", - "eslint-plugin-node": "9.2.0", - "eslint-plugin-prefer-object-spread": "1.2.1", - "eslint-plugin-prettier": "3.1.1", - "eslint-plugin-react": "7.13.0", - "eslint-plugin-react-hooks": "1.6.0", + "eslint-plugin-ban": "^1.3.0", + "eslint-plugin-cypress": "^2.7.0", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-jest": "^22.19.0", + "eslint-plugin-jsx-a11y": "^6.2.3", + "eslint-plugin-mocha": "^6.2.0", + "eslint-plugin-no-unsanitized": "^3.0.2", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-prefer-object-spread": "^1.2.1", + "eslint-plugin-prettier": "^3.1.1", + "eslint-plugin-react": "^7.16.0", + "eslint-plugin-react-hooks": "^2.1.2", "exit-hook": "^2.2.0", "faker": "1.1.0", "fetch-mock": "^7.3.9", @@ -438,7 +438,7 @@ "pngjs": "^3.4.0", "postcss": "^7.0.5", "postcss-url": "^8.0.0", - "prettier": "1.18.2", + "prettier": "^1.18.2", "proxyquire": "1.8.0", "regenerate": "^1.4.0", "sass-lint": "^1.12.1", diff --git a/packages/eslint-config-kibana/javascript.js b/packages/eslint-config-kibana/javascript.js index f1ed905779fbc1..8462da5cac801c 100644 --- a/packages/eslint-config-kibana/javascript.js +++ b/packages/eslint-config-kibana/javascript.js @@ -11,7 +11,7 @@ module.exports = { */ { files: ['**/*.js'], - parser: 'babel-eslint', + parser: require.resolve('babel-eslint'), plugins: [ 'mocha', diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index da2a37cc41ad3c..b5079a49c8385d 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,19 +15,19 @@ }, "homepage": "https://github.com/elastic/eslint-config-kibana#readme", "peerDependencies": { - "@typescript-eslint/eslint-plugin": "1.13.0", - "@typescript-eslint/parser": "1.13.0", + "@typescript-eslint/eslint-plugin": "^2.5.0", + "@typescript-eslint/parser": "^2.5.0", "babel-eslint": "^10.0.3", - "eslint": "5.16.0", + "eslint": "^6.5.1", "eslint-plugin-babel": "^5.3.0", - "eslint-plugin-ban": "1.3.0", - "eslint-plugin-jsx-a11y": "6.2.3", - "eslint-plugin-import": "2.18.2", - "eslint-plugin-jest": "^22.17.0", - "eslint-plugin-mocha": "^6.1.1", - "eslint-plugin-no-unsanitized": "3.0.2", - "eslint-plugin-prefer-object-spread": "1.2.1", - "eslint-plugin-react": "7.13.0", - "eslint-plugin-react-hooks": "1.6.0" + "eslint-plugin-ban": "^1.3.0", + "eslint-plugin-jsx-a11y": "^6.2.3", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-jest": "^22.19.0", + "eslint-plugin-mocha": "^6.2.0", + "eslint-plugin-no-unsanitized": "^3.0.2", + "eslint-plugin-prefer-object-spread": "^1.2.1", + "eslint-plugin-react": "^7.16.0", + "eslint-plugin-react-hooks": "^2.1.2" } } diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 90e688655ab769..7653c9bb0c3323 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -70,7 +70,7 @@ module.exports = { // // Old recommended tslint rules '@typescript-eslint/adjacent-overload-signatures': 'error', - '@typescript-eslint/array-type': ['error', 'array-simple'], + '@typescript-eslint/array-type': ['error', { default: 'array-simple', readonly: 'array-simple' }], '@typescript-eslint/ban-types': 'error', 'camelcase': 'off', '@typescript-eslint/camelcase': ['error', { @@ -92,15 +92,19 @@ module.exports = { 'indent': 'off', '@typescript-eslint/indent': [ 'error', 2, { SwitchCase: 1 } ], '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-interface': 'error', + '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], '@typescript-eslint/member-ordering': ['error', { 'default': ['public-static-field', 'static-field', 'instance-field'] }], - '@typescript-eslint/no-angle-bracket-type-assertion': 'error', + '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/no-empty-interface': 'error', '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-namespace': 'error', - '@typescript-eslint/no-triple-slash-reference': 'error', + '@typescript-eslint/triple-slash-reference': ['error', { + path: 'never', + types: 'never', + lib: 'never' + }], '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/type-annotation-spacing': 'error', '@typescript-eslint/unified-signatures': 'error', diff --git a/packages/kbn-es/src/paths.js b/packages/kbn-es/src/paths.js index b0c1b9c1e6fe70..f0c16e14c42f8a 100644 --- a/packages/kbn-es/src/paths.js +++ b/packages/kbn-es/src/paths.js @@ -20,7 +20,7 @@ const os = require('os'); const path = require('path'); -function useBat(bin) { +function maybeUseBat(bin) { return os.platform().startsWith('win') ? `${bin}.bat` : bin; } @@ -28,8 +28,8 @@ const tempDir = os.tmpdir(); exports.BASE_PATH = path.resolve(tempDir, 'kbn-es'); -exports.GRADLE_BIN = useBat('./gradlew'); -exports.ES_BIN = useBat('bin/elasticsearch'); +exports.GRADLE_BIN = maybeUseBat('./gradlew'); +exports.ES_BIN = maybeUseBat('bin/elasticsearch'); exports.ES_CONFIG = 'config/elasticsearch.yml'; -exports.ES_KEYSTORE_BIN = useBat('./bin/elasticsearch-keystore'); +exports.ES_KEYSTORE_BIN = maybeUseBat('./bin/elasticsearch-keystore'); diff --git a/packages/kbn-eslint-plugin-eslint/package.json b/packages/kbn-eslint-plugin-eslint/package.json index 2f8f18103e1467..badcf13187cafb 100644 --- a/packages/kbn-eslint-plugin-eslint/package.json +++ b/packages/kbn-eslint-plugin-eslint/package.json @@ -4,7 +4,7 @@ "private": true, "license": "Apache-2.0", "peerDependencies": { - "eslint": "5.16.0", + "eslint": "6.5.1", "babel-eslint": "^10.0.3" }, "dependencies": { diff --git a/packages/kbn-eslint-plugin-eslint/rules/__tests__/disallow_license_headers.js b/packages/kbn-eslint-plugin-eslint/rules/__tests__/disallow_license_headers.js index 0bf71d717bad62..0bdd4e328b396a 100644 --- a/packages/kbn-eslint-plugin-eslint/rules/__tests__/disallow_license_headers.js +++ b/packages/kbn-eslint-plugin-eslint/rules/__tests__/disallow_license_headers.js @@ -22,7 +22,7 @@ const rule = require('../disallow_license_headers'); const dedent = require('dedent'); const ruleTester = new RuleTester({ - parser: 'babel-eslint', + parser: require.resolve('babel-eslint'), parserOptions: { ecmaVersion: 2018, }, diff --git a/packages/kbn-eslint-plugin-eslint/rules/__tests__/no_restricted_paths.js b/packages/kbn-eslint-plugin-eslint/rules/__tests__/no_restricted_paths.js index c821aafb09285d..f393a867d95e0d 100644 --- a/packages/kbn-eslint-plugin-eslint/rules/__tests__/no_restricted_paths.js +++ b/packages/kbn-eslint-plugin-eslint/rules/__tests__/no_restricted_paths.js @@ -32,7 +32,7 @@ const { RuleTester } = require('eslint'); const rule = require('../no_restricted_paths'); const ruleTester = new RuleTester({ - parser: 'babel-eslint', + parser: require.resolve('babel-eslint'), parserOptions: { sourceType: 'module', ecmaVersion: 2018, diff --git a/packages/kbn-eslint-plugin-eslint/rules/__tests__/require_license_header.js b/packages/kbn-eslint-plugin-eslint/rules/__tests__/require_license_header.js index 984c090ceb06b1..f5d3d6b61c5581 100644 --- a/packages/kbn-eslint-plugin-eslint/rules/__tests__/require_license_header.js +++ b/packages/kbn-eslint-plugin-eslint/rules/__tests__/require_license_header.js @@ -22,7 +22,7 @@ const rule = require('../require_license_header'); const dedent = require('dedent'); const ruleTester = new RuleTester({ - parser: 'babel-eslint', + parser: require.resolve('babel-eslint'), parserOptions: { ecmaVersion: 2018, }, diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_restricted_paths.js b/packages/kbn-eslint-plugin-eslint/rules/no_restricted_paths.js index 9074c35d27c7ee..bed10e77597b78 100644 --- a/packages/kbn-eslint-plugin-eslint/rules/no_restricted_paths.js +++ b/packages/kbn-eslint-plugin-eslint/rules/no_restricted_paths.js @@ -77,6 +77,7 @@ module.exports = { anyOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }], }, allowSameFolder: { type: 'boolean' }, + errorMessage: { type: 'string' }, }, additionalProperties: false, }, diff --git a/packages/kbn-test-subj-selector/index.d.ts b/packages/kbn-test-subj-selector/index.d.ts index 7a3a681e585e1c..d6b3d3061f4265 100644 --- a/packages/kbn-test-subj-selector/index.d.ts +++ b/packages/kbn-test-subj-selector/index.d.ts @@ -18,4 +18,4 @@ */ // eslint-disable-next-line import/no-default-export -export default function(selector: string): string; +export default function kbnTestSubjSelector(selector: string): string; diff --git a/src/core/public/plugins/plugin.ts b/src/core/public/plugins/plugin.ts index a8e52cc57cb661..05268bbfcdd05d 100644 --- a/src/core/public/plugins/plugin.ts +++ b/src/core/public/plugins/plugin.ts @@ -71,7 +71,7 @@ export class PluginWrapper< private instance?: Plugin; constructor( - readonly discoveredPlugin: DiscoveredPlugin, + public readonly discoveredPlugin: DiscoveredPlugin, public readonly opaqueId: PluginOpaqueId, private readonly initializerContext: PluginInitializerContext ) { diff --git a/src/core/public/saved_objects/simple_saved_object.ts b/src/core/public/saved_objects/simple_saved_object.ts index 92c228edd5e8ec..7978708c9eabbb 100644 --- a/src/core/public/saved_objects/simple_saved_object.ts +++ b/src/core/public/saved_objects/simple_saved_object.ts @@ -33,7 +33,6 @@ import { SavedObjectsClient } from './saved_objects_client'; export class SimpleSavedObject { public attributes: T; // We want to use the same interface this class had in JS - // eslint-disable-next-line variable-name public _version?: SavedObjectType['version']; public id: SavedObjectType['id']; public type: SavedObjectType['type']; diff --git a/src/core/server/config/env.ts b/src/core/server/config/env.ts index bb6064c71742df..460773d89db852 100644 --- a/src/core/server/config/env.ts +++ b/src/core/server/config/env.ts @@ -96,7 +96,7 @@ export class Env { /** * @internal */ - constructor(readonly homeDir: string, options: EnvOptions) { + constructor(public readonly homeDir: string, options: EnvOptions) { this.configDir = resolve(this.homeDir, 'config'); this.binDir = resolve(this.homeDir, 'bin'); this.logDir = resolve(this.homeDir, 'log'); diff --git a/src/core/server/config/raw_config_service.ts b/src/core/server/config/raw_config_service.ts index 6c1e4800d100c9..b10137fb72f6ac 100644 --- a/src/core/server/config/raw_config_service.ts +++ b/src/core/server/config/raw_config_service.ts @@ -38,7 +38,7 @@ export class RawConfigService { private readonly config$: Observable; constructor( - readonly configFiles: readonly string[], + public readonly configFiles: readonly string[], configAdapter: (rawConfig: Record) => Config = rawConfig => new ObjectToConfigAdapter(rawConfig) ) { diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index 9e4d017f8db3ef..5d3b70ba27eeef 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -128,9 +128,9 @@ export class KibanaRequest { constructor( request: Request, - readonly params: Params, - readonly query: Query, - readonly body: Body, + public readonly params: Params, + public readonly query: Query, + public readonly body: Body, // @ts-ignore we will use this flag as soon as http request proxy is supported in the core // until that time we have to expose all the headers private readonly withoutSecretHeaders: boolean diff --git a/src/core/server/http/router/response.ts b/src/core/server/http/router/response.ts index f1ee44726ebef9..23e0a21ae11525 100644 --- a/src/core/server/http/router/response.ts +++ b/src/core/server/http/router/response.ts @@ -57,9 +57,9 @@ export function isKibanaResponse(response: Record): response is IKi export class KibanaResponse implements IKibanaResponse { constructor( - readonly status: number, - readonly payload?: T, - readonly options: HttpResponseOptions = {} + public readonly status: number, + public readonly payload?: T, + public readonly options: HttpResponseOptions = {} ) {} } diff --git a/src/core/server/http/router/router.ts b/src/core/server/http/router/router.ts index e4f328c51a0083..6b7e2e3ad14cd3 100644 --- a/src/core/server/http/router/router.ts +++ b/src/core/server/http/router/router.ts @@ -149,7 +149,7 @@ export class Router implements IRouter { public put: IRouter['put']; constructor( - readonly routerPath: string, + public readonly routerPath: string, private readonly log: Logger, private readonly enhanceWithContext: ContextEnhancer ) { diff --git a/src/core/server/logging/log_level.ts b/src/core/server/logging/log_level.ts index 8493dd4a848dfd..577239ddae8e55 100644 --- a/src/core/server/logging/log_level.ts +++ b/src/core/server/logging/log_level.ts @@ -68,7 +68,7 @@ export class LogLevel { } } - private constructor(readonly id: LogLevelId, readonly value: number) {} + private constructor(public readonly id: LogLevelId, public readonly value: number) {} /** * Indicates whether current log level covers the one that is passed as an argument. diff --git a/src/core/server/plugins/plugin.ts b/src/core/server/plugins/plugin.ts index 0101862ad32ccb..ff61d8033a4848 100644 --- a/src/core/server/plugins/plugin.ts +++ b/src/core/server/plugins/plugin.ts @@ -61,7 +61,7 @@ export class PluginWrapper< private instance?: Plugin; constructor( - readonly params: { + public readonly params: { readonly path: string; readonly manifest: PluginManifest; readonly opaqueId: PluginOpaqueId; diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index ea6c7f87a55e90..898239e5736de3 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -53,12 +53,12 @@ import { validateConvertFilterToKueryNode } from './filter_utils'; // BEWARE: The SavedObjectClient depends on the implementation details of the SavedObjectsRepository // so any breaking changes to this repository are considered breaking changes to the SavedObjectsClient. -// eslint-disable-next-line @typescript-eslint/prefer-interface +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions type Left = { tag: 'Left'; error: T; }; -// eslint-disable-next-line @typescript-eslint/prefer-interface +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions type Right = { tag: 'Right'; value: T; diff --git a/src/core/server/server.ts b/src/core/server/server.ts index ffe910a87385a6..49136c8e09768c 100644 --- a/src/core/server/server.ts +++ b/src/core/server/server.ts @@ -55,8 +55,8 @@ export class Server { private readonly uiSettings: UiSettingsService; constructor( - readonly config$: Observable, - readonly env: Env, + public readonly config$: Observable, + public readonly env: Env, private readonly logger: LoggerFactory ) { this.log = this.logger.get('server'); diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx index aaa9ed323eee07..eaef8048a6fbff 100644 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx @@ -31,7 +31,7 @@ export interface FilterableContainerInput extends ContainerInput { * https://github.com/microsoft/TypeScript/issues/15300 is fixed so we use a type * here instead */ -// eslint-disable-next-line @typescript-eslint/prefer-interface +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type InheritedChildrenInput = { filters: Filter[]; id?: string; diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx index 8209f5bca2411f..de486598470d33 100644 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx @@ -33,7 +33,7 @@ export const HELLO_WORLD_CONTAINER = 'HELLO_WORLD_CONTAINER'; * https://github.com/microsoft/TypeScript/issues/15300 is fixed so we use a type * here instead */ -// eslint-disable-next-line @typescript-eslint/prefer-interface +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions type InheritedInput = { id: string; viewMode: ViewMode; diff --git a/src/plugins/inspector/public/adapters/data/formatted_data.ts b/src/plugins/inspector/public/adapters/data/formatted_data.ts index 68e0d33bf9874c..c752e8670aca32 100644 --- a/src/plugins/inspector/public/adapters/data/formatted_data.ts +++ b/src/plugins/inspector/public/adapters/data/formatted_data.ts @@ -18,7 +18,7 @@ */ class FormattedData { - constructor(readonly raw: any, readonly formatted: any) {} + constructor(public readonly raw: any, public readonly formatted: any) {} } export { FormattedData }; diff --git a/x-pack/legacy/plugins/actions/server/builtin_action_types/lib/result_type.ts b/x-pack/legacy/plugins/actions/server/builtin_action_types/lib/result_type.ts index aac93f07d7c505..c891f3bf218e7d 100644 --- a/x-pack/legacy/plugins/actions/server/builtin_action_types/lib/result_type.ts +++ b/x-pack/legacy/plugins/actions/server/builtin_action_types/lib/result_type.ts @@ -8,12 +8,12 @@ // Which is basically the Haskel equivalent of Rust/ML/Scala's Result // I'll reach out to other's in Kibana to see if we can merge these into one type -// eslint-disable-next-line @typescript-eslint/prefer-interface +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type Ok = { tag: 'ok'; value: T; }; -// eslint-disable-next-line @typescript-eslint/prefer-interface +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type Err = { tag: 'err'; error: E; diff --git a/x-pack/legacy/plugins/apm/cypress/cypress.d.ts b/x-pack/legacy/plugins/apm/cypress/cypress.d.ts index 18ef5bc30e1d14..7bd1315f782b9d 100644 --- a/x-pack/legacy/plugins/apm/cypress/cypress.d.ts +++ b/x-pack/legacy/plugins/apm/cypress/cypress.d.ts @@ -4,9 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -// eslint-disable-next-line spaced-comment -/// - declare namespace Cypress { interface Chainable { snapshot: () => {}; diff --git a/x-pack/legacy/plugins/apm/cypress/integration/apm.spec.ts b/x-pack/legacy/plugins/apm/cypress/integration/apm.spec.ts index 8bf54de212a0bf..3d0ff276fcdd8c 100644 --- a/x-pack/legacy/plugins/apm/cypress/integration/apm.spec.ts +++ b/x-pack/legacy/plugins/apm/cypress/integration/apm.spec.ts @@ -4,9 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -// eslint-disable-next-line spaced-comment -/// - import { loginAndWaitForPage } from './helpers'; describe('When clicking opbeans-go service', () => { diff --git a/x-pack/legacy/plugins/apm/typings/elasticsearch.ts b/x-pack/legacy/plugins/apm/typings/elasticsearch.ts index 4da52c773a6663..08d1e2b37492e5 100644 --- a/x-pack/legacy/plugins/apm/typings/elasticsearch.ts +++ b/x-pack/legacy/plugins/apm/typings/elasticsearch.ts @@ -34,7 +34,7 @@ declare module 'elasticsearch' { [key: string]: any; }; - // eslint-disable-next-line @typescript-eslint/prefer-interface + // eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type AggregationOptionMap = { aggs?: { [aggregationName: string]: { @@ -47,7 +47,7 @@ declare module 'elasticsearch' { ? AggregationResultMap : {}; - // eslint-disable-next-line @typescript-eslint/prefer-interface + // eslint-disable-next-line @typescript-eslint/consistent-type-definitions type BucketAggregation = { buckets: Array< { @@ -62,7 +62,7 @@ declare module 'elasticsearch' { doc_count: number; } & SubAggregation; - // eslint-disable-next-line @typescript-eslint/prefer-interface + // eslint-disable-next-line @typescript-eslint/consistent-type-definitions type FiltersAggregation = { // The filters aggregation can have named filters or anonymous filters, // which changes the structure of the return diff --git a/x-pack/legacy/plugins/canvas/public/components/app/app.js b/x-pack/legacy/plugins/canvas/public/components/app/app.js index 19fbb53eb10dc2..16484afc8620b9 100644 --- a/x-pack/legacy/plugins/canvas/public/components/app/app.js +++ b/x-pack/legacy/plugins/canvas/public/components/app/app.js @@ -16,10 +16,6 @@ import { ComponentStrings } from '../../../i18n'; const { App: strings } = ComponentStrings; export class App extends React.PureComponent { - static childContextTypes = { - shortcuts: PropTypes.object.isRequired, - }; - static propTypes = { appState: PropTypes.object.isRequired, setAppReady: PropTypes.func.isRequired, @@ -27,6 +23,10 @@ export class App extends React.PureComponent { onRouteChange: PropTypes.func.isRequired, }; + static childContextTypes = { + shortcuts: PropTypes.object.isRequired, + }; + getChildContext() { return { shortcuts: shortcutManager }; } diff --git a/x-pack/legacy/plugins/canvas/public/components/color_manager/__examples__/color_manager.examples.tsx b/x-pack/legacy/plugins/canvas/public/components/color_manager/__examples__/color_manager.examples.tsx index f4f1766783868e..b83ffe70dc185c 100644 --- a/x-pack/legacy/plugins/canvas/public/components/color_manager/__examples__/color_manager.examples.tsx +++ b/x-pack/legacy/plugins/canvas/public/components/color_manager/__examples__/color_manager.examples.tsx @@ -27,7 +27,6 @@ class Interactive extends React.Component<{}, { hasButtons: boolean; value: stri />