From 80475b8f7a7739a7b4ade08c3a863a96318e4488 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 19 Mar 2019 19:55:39 +0000 Subject: [PATCH 01/36] chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. --- .eslintrc.js | 14 +- TYPESCRIPT.md | 4 +- package.json | 13 +- packages/eslint-config-kibana/package.json | 2 + packages/eslint-config-kibana/typescript.js | 65 +++++++++ scripts/tslint.js | 21 --- src/dev/run_eslint.js | 4 + src/dev/run_precommit_hook.js | 3 +- src/dev/tslint/index.ts | 22 --- src/dev/tslint/lint_files.ts | 78 ----------- src/dev/tslint/pick_files_to_lint.ts | 26 ---- .../tslint/rules/disallowLicenseHeaderRule.js | 51 ------- .../tslint/rules/requireLicenseHeaderRule.js | 48 ------- src/dev/tslint/run_tslint_cli.ts | 49 ------- tslint.yaml | 69 ---------- .../common/services/es.js | 3 +- yarn.lock | 126 ++++++++++-------- 17 files changed, 164 insertions(+), 434 deletions(-) create mode 100644 packages/eslint-config-kibana/typescript.js delete mode 100644 scripts/tslint.js delete mode 100644 src/dev/tslint/index.ts delete mode 100644 src/dev/tslint/lint_files.ts delete mode 100644 src/dev/tslint/pick_files_to_lint.ts delete mode 100644 src/dev/tslint/rules/disallowLicenseHeaderRule.js delete mode 100644 src/dev/tslint/rules/requireLicenseHeaderRule.js delete mode 100644 src/dev/tslint/run_tslint_cli.ts delete mode 100644 tslint.yaml diff --git a/.eslintrc.js b/.eslintrc.js index c99cfbb1680c77..2e5f5f072e24bf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,7 +33,11 @@ const ELASTIC_LICENSE_HEADER = ` `; module.exports = { - extends: ['@elastic/eslint-config-kibana', '@elastic/eslint-config-kibana/jest'], + extends: [ + '@elastic/eslint-config-kibana', + '@elastic/eslint-config-kibana/jest', + '@elastic/eslint-config-kibana/typescript', + ], settings: { 'import/resolver': { @@ -70,6 +74,7 @@ module.exports = { 'src/legacy/server/saved_objects/**/*', 'x-pack/plugins/apm/**/*', 'x-pack/plugins/canvas/**/*', + '**/*.{ts,tsx}', ], plugins: ['prettier'], rules: Object.assign( @@ -154,7 +159,8 @@ module.exports = { 'packages/kbn-interpreter/src/plugin/**/*', 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*', 'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*', - 'x-pack/**/*.test.js', + 'x-pack/**/*.test.{js,ts,tsx}', + 'x-pack/**/*.test.mocks.{js,ts,tsx}', 'x-pack/gulpfile.js', 'x-pack/plugins/apm/public/utils/testHelpers.js', ], @@ -265,7 +271,7 @@ module.exports = { * Licence headers */ { - files: ['**/*.js'], + files: ['**/*.{js,ts,tsx}'], plugins: ['@kbn/eslint-plugin-license-header'], rules: { '@kbn/license-header/require-license-header': [ @@ -287,7 +293,7 @@ module.exports = { * Files that require Elastic license headers instead of Apache 2.0 header */ { - files: ['x-pack/**/*.js'], + files: ['x-pack/**/*.{js,ts,tsx}'], plugins: ['@kbn/eslint-plugin-license-header'], rules: { '@kbn/license-header/require-license-header': [ diff --git a/TYPESCRIPT.md b/TYPESCRIPT.md index 68cb32ce36c746..934b2eb702d9ac 100644 --- a/TYPESCRIPT.md +++ b/TYPESCRIPT.md @@ -4,8 +4,8 @@ To convert existing code over to TypeScript: 1. rename the file from `.js` to either `.ts` (if there is no html or jsx in the file) or `.tsx` (if there is). -2. Ensure tslint is running and installed in the IDE of your choice. There will usually be some linter errors after the file rename. -3. Auto-fix what you can. This will save you a lot of time! VSCode can be set to auto fix tslint errors when files are saved. +2. Ensure eslint is running and installed in the IDE of your choice. There will usually be some linter errors after the file rename. +3. Auto-fix what you can. This will save you a lot of time! VSCode can be set to auto fix eslint errors when files are saved. ### How to fix common TypeScript errors diff --git a/package.json b/package.json index 7b9e791f86b44d..56813657c91104 100644 --- a/package.json +++ b/package.json @@ -56,9 +56,8 @@ "debug-break": "node --nolazy --inspect-brk scripts/kibana --dev", "precommit": "node scripts/precommit_hook", "karma": "karma start", - "lint": "yarn run lint:es && yarn run lint:ts && yarn run lint:sass", + "lint": "yarn run lint:es && yarn run lint:sass", "lint:es": "node scripts/eslint", - "lint:ts": "node scripts/tslint", "lint:sass": "node scripts/sasslint", "makelogs": "node scripts/makelogs", "mocha": "node scripts/mocha", @@ -318,6 +317,8 @@ "@types/type-detect": "^4.0.1", "@types/uuid": "^3.4.4", "@types/zen-observable": "^0.8.0", + "@typescript-eslint/eslint-plugin": "^1.4.2", + "@typescript-eslint/parser": "^1.4.2", "angular-mocks": "1.4.7", "archiver": "^3.0.0", "babel-eslint": "^9.0.0", @@ -336,7 +337,7 @@ "enzyme-adapter-utils": "^1.10.0", "enzyme-to-json": "^3.3.4", "eslint": "^5.6.0", - "eslint-config-prettier": "^3.1.0", + "eslint-config-prettier": "^4.1.0", "eslint-plugin-babel": "^5.2.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-jest": "^21.26.2", @@ -344,7 +345,7 @@ "eslint-plugin-mocha": "^5.2.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-prettier": "^2.6.2", + "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.11.1", "expect.js": "0.3.1", "faker": "1.1.0", @@ -405,10 +406,6 @@ "ts-jest": "^23.1.4", "ts-loader": "^5.2.2", "ts-node": "^7.0.1", - "tslint": "^5.11.0", - "tslint-config-prettier": "^1.15.0", - "tslint-microsoft-contrib": "^6.0.0", - "tslint-plugin-prettier": "^2.0.0", "typescript": "^3.3.3333", "typings-tester": "^0.3.2", "vinyl-fs": "^3.0.2", diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index d2e639eebbbe33..9f466d60f431cf 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,6 +15,8 @@ }, "homepage": "https://github.com/elastic/eslint-config-kibana#readme", "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^1.4.2", + "@typescript-eslint/parser": "^1.4.2", "babel-eslint": "^9.0.0", "eslint": "^5.6.0", "eslint-plugin-babel": "^5.2.0", diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js new file mode 100644 index 00000000000000..19dc95558c87a8 --- /dev/null +++ b/packages/eslint-config-kibana/typescript.js @@ -0,0 +1,65 @@ +// NOTE: this is the configuration to apply the typescript eslint parser +// in order to lint typescript files with eslint. +// Some IDEs could not yet ran eslint with the correct extensions +// as this package was moved from typescript-eslint-parser to @typescript-eslint/parser +// +// For example in IntelliJ this would be fixed on 2019.1 to be launched soon. +// In order to have it working now we should add the extensions `ts,tsx` to the option +// `eslint.additional.file.extensions` that can be found on Help > Find Action > Registry +// More info: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000225170-ESLint-and-ts-Typescript-files + +const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin').configs.recommended; +const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules; + +// Remove every non @typescript-eslint rules from typescript eslint plugin recommended rules +const typescriptEslintRecommendedSanitizedRules = Object.keys(typescriptEslintRecommended.rules) + .filter((key) => !!key.includes('@typescript-eslint')) + .reduce((obj, key) => ({ ...obj, [key]: typescriptEslintRecommended.rules[key] }), {}); + +module.exports = { + overrides: [ + { + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaFeatures: { jsx: true }, + }, + files: ['**/*.{ts,tsx}'], + plugins: ['@typescript-eslint'], + // NOTE: we can't override the extends option here to apply + // all the recommend rules as it is not allowed yet + // more info on: https://github.com/eslint/rfcs/pull/13 and + // https://github.com/eslint/eslint/issues/8813 + // + // For now we are using an workaround to create + // those extended rules arrays + rules: Object.assign( + typescriptEslintRecommendedSanitizedRules, + { + "@typescript-eslint/adjacent-overload-signatures": "error", + "@typescript-eslint/array-type": "error", + "@typescript-eslint/ban-types": "error", + "@typescript-eslint/class-name-casing": "error", + "@typescript-eslint/indent": "error", + "@typescript-eslint/interface-name-prefix": "error", + "@typescript-eslint/member-delimiter-style": "error", + "@typescript-eslint/no-angle-bracket-type-assertion": "error", + "@typescript-eslint/no-array-constructor": "error", + "@typescript-eslint/no-empty-interface": "error", + "@typescript-eslint/no-inferrable-types": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-non-null-assertion": "error", + "@typescript-eslint/no-object-literal-type-assertion": "error", + "@typescript-eslint/no-parameter-properties": "error", + "@typescript-eslint/no-triple-slash-reference": "error", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/prefer-interface": "error", + "@typescript-eslint/prefer-namespace-keyword": "error", + "@typescript-eslint/type-annotation-spacing": "error" + }, + eslintConfigPrettierTypescriptEslintRules, + ) + }, + ] +}; diff --git a/scripts/tslint.js b/scripts/tslint.js deleted file mode 100644 index 0ec8ce7dd632a3..00000000000000 --- a/scripts/tslint.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -require('../src/setup_node_env'); -require('../src/dev/tslint').runTslintCli(); diff --git a/src/dev/run_eslint.js b/src/dev/run_eslint.js index d6763769dec64e..3bfbb9cc876e06 100644 --- a/src/dev/run_eslint.js +++ b/src/dev/run_eslint.js @@ -30,5 +30,9 @@ if (!process.argv.includes('--no-cache')) { process.argv.push('--cache'); } +if (!process.argv.includes('--ext')) { + process.argv.push('--ext', '.js,.ts,.tsx'); +} + // common-js is required so that logic before this executes before loading eslint require('eslint/bin/eslint'); diff --git a/src/dev/run_precommit_hook.js b/src/dev/run_precommit_hook.js index b1cd2f13846fac..1b925beb577cb9 100644 --- a/src/dev/run_precommit_hook.js +++ b/src/dev/run_precommit_hook.js @@ -19,7 +19,6 @@ import { run, combineErrors } from './run'; import * as Eslint from './eslint'; -import * as Tslint from './tslint'; import * as Sasslint from './sasslint'; import { getFilesForCommit, checkFileCasing } from './precommit_hook'; @@ -33,7 +32,7 @@ run(async ({ log }) => { errors.push(error); } - for (const Linter of [Eslint, Tslint, Sasslint]) { + for (const Linter of [Eslint, Sasslint]) { const filesToLint = Linter.pickFilesToLint(log, files); if (filesToLint.length > 0) { try { diff --git a/src/dev/tslint/index.ts b/src/dev/tslint/index.ts deleted file mode 100644 index ff349a93354dda..00000000000000 --- a/src/dev/tslint/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -export { runTslintCli } from './run_tslint_cli'; -export { lintFiles } from './lint_files'; -export { pickFilesToLint } from './pick_files_to_lint'; diff --git a/src/dev/tslint/lint_files.ts b/src/dev/tslint/lint_files.ts deleted file mode 100644 index 20117e2dff3d81..00000000000000 --- a/src/dev/tslint/lint_files.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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. - */ - -import { run } from 'tslint/lib/runner'; - -import { ToolingLog } from '@kbn/dev-utils'; -import { File } from '../file'; -import { createFailError } from '../run'; -import { getTsProjectForAbsolutePath, Project } from '../typescript'; - -function groupFilesByProject(files: File[]) { - const filesByProject: Map = new Map(); - - files.forEach(file => { - const project = getTsProjectForAbsolutePath(file.getAbsolutePath()); - const filesForProject = filesByProject.get(project); - - if (!filesForProject) { - filesByProject.set(project, [file]); - } else { - filesForProject.push(file); - } - }); - - return filesByProject; -} - -/** - * Lints a list of files with tslint. tslint reports are written to the log - * and a FailError is thrown when linting errors occur. - * - * @param {ToolingLog} log - * @param {Array} files - * @return {undefined} - */ -export async function lintFiles(log: ToolingLog, files: File[]) { - for (const [project, filesInProject] of groupFilesByProject(files)) { - const exitCode = await run( - { - exclude: [], - files: filesInProject.map(f => f.getAbsolutePath()), - fix: false, - format: 'stylish', - project: project.tsConfigPath, - }, - { - log(m: string) { - log.write(m); - }, - error(m: string) { - log.error(m); - }, - } - ); - - if (exitCode > 0) { - throw createFailError(`[tslint] failure`, 1); - } else { - log.success('[tslint/%s] %d files linted successfully', project.name, filesInProject.length); - } - } -} diff --git a/src/dev/tslint/pick_files_to_lint.ts b/src/dev/tslint/pick_files_to_lint.ts deleted file mode 100644 index 7dc27c6a4d130c..00000000000000 --- a/src/dev/tslint/pick_files_to_lint.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -import { ToolingLog } from '@kbn/dev-utils'; - -import { File } from '../file'; - -export function pickFilesToLint(log: ToolingLog, files: File[]) { - return files.filter(file => file.isTypescript() && !file.isFixture()); -} diff --git a/src/dev/tslint/rules/disallowLicenseHeaderRule.js b/src/dev/tslint/rules/disallowLicenseHeaderRule.js deleted file mode 100644 index 09995c47ff7410..00000000000000 --- a/src/dev/tslint/rules/disallowLicenseHeaderRule.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 Lint = require('tslint'); - -const FAILURE_STRING = 'This license header is not allowed in this file.'; -const RULE_NAME = 'disallow-license-header'; - -exports.Rule = class extends Lint.Rules.AbstractRule { - apply(sourceFile) { - const [headerText] = this.getOptions().ruleArguments; - - if (!headerText) { - throw new Error(`${RULE_NAME} requires a single argument containing the header text`); - } - - if (!sourceFile.text.includes(headerText)) { - return []; - } - - const start = sourceFile.text.indexOf(headerText); - const end = start + headerText.length; - - return [ - new Lint.RuleFailure( - sourceFile, - start, - end, - FAILURE_STRING, - RULE_NAME, - new Lint.Replacement(start, headerText.length, '') - ) - ]; - } -}; diff --git a/src/dev/tslint/rules/requireLicenseHeaderRule.js b/src/dev/tslint/rules/requireLicenseHeaderRule.js deleted file mode 100644 index 91db7a49795d35..00000000000000 --- a/src/dev/tslint/rules/requireLicenseHeaderRule.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 Lint = require('tslint'); - -const FAILURE_STRING = 'File must start with a license header'; -const RULE_NAME = 'require-license-header'; - -exports.Rule = class extends Lint.Rules.AbstractRule { - apply(sourceFile) { - const [headerText] = this.getOptions().ruleArguments; - - if (!headerText) { - throw new Error(`${RULE_NAME} requires a single argument containing the header text`); - } - - if (sourceFile.text.startsWith(headerText)) { - return []; - } - - return [ - new Lint.RuleFailure( - sourceFile, - 0, - 0, - FAILURE_STRING, - RULE_NAME, - new Lint.Replacement(0, 0, `${headerText}\n\n`) - ) - ]; - } -}; diff --git a/src/dev/tslint/run_tslint_cli.ts b/src/dev/tslint/run_tslint_cli.ts deleted file mode 100644 index 28840e45d54a4d..00000000000000 --- a/src/dev/tslint/run_tslint_cli.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -import { ToolingLog } from '@kbn/dev-utils'; -import getopts from 'getopts'; - -import { execInProjects, filterProjectsByFlag, Project } from '../typescript'; - -export function runTslintCliOnTsConfigPaths(tsConfigPaths: string[]) { - runTslintCli(tsConfigPaths.map(tsConfigPath => new Project(tsConfigPath))); -} - -export function runTslintCli(projects?: Project[]) { - const log = new ToolingLog({ - level: 'info', - writeTo: process.stdout, - }); - - const opts = getopts(process.argv.slice(2)); - projects = projects || filterProjectsByFlag(opts.project); - - if (!opts.format) { - process.argv.push('--format', 'stylish'); - } - - const getProjectArgs = (project: Project) => [ - ...process.argv.slice(2), - '--project', - project.tsConfigPath, - ]; - - execInProjects(log, projects, 'tslint', getProjectArgs); -} diff --git a/tslint.yaml b/tslint.yaml deleted file mode 100644 index c914787ec7a681..00000000000000 --- a/tslint.yaml +++ /dev/null @@ -1,69 +0,0 @@ -extends: - - tslint:recommended - - tslint-config-prettier - - -rulesDirectory: - - tslint-plugin-prettier - - src/dev/tslint/rules - - node_modules/tslint-microsoft-contrib - -rules: - prettier: true - object-literal-sort-keys: false - interface-name: false - no-default-export: true - react-a11y-anchors: true - react-a11y-aria-unsupported-elements: true - react-a11y-event-has-role: true - react-a11y-image-button-has-alt: true - react-a11y-img-has-alt: true - react-a11y-input-elements: true - react-a11y-lang: true - react-a11y-meta: true - react-a11y-no-onchange: true - react-a11y-props: true - react-a11y-proptypes: true - react-a11y-required: true - react-a11y-role-has-required-aria-props: true - react-a11y-role-supports-aria-props: true - react-a11y-role: true - react-a11y-tabindex-no-positive: true - react-a11y-titles: true - ban: - - true - - name: [describe, only] - message: No exclusive suites. - - name: [it, only] - message: No exclusive tests. - - name: [test, only] - message: No exclusive tests. - require-license-header: - - true - - |- - /* - * 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. - */ - disallow-license-header: - - true - - |- - /* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ diff --git a/x-pack/test/saved_object_api_integration/common/services/es.js b/x-pack/test/saved_object_api_integration/common/services/es.js index f5ef3be4b4bde2..af188ca5e39716 100644 --- a/x-pack/test/saved_object_api_integration/common/services/es.js +++ b/x-pack/test/saved_object_api_integration/common/services/es.js @@ -8,9 +8,8 @@ import { format as formatUrl } from 'url'; import elasticsearch from 'elasticsearch'; import shieldPlugin from '../../../../server/lib/esjs_shield_plugin'; -import { TestInvoker } from '../lib/types'; -export function EsProvider({ getService }: TestInvoker) { +export function EsProvider({ getService }) { const config = getService('config'); return new elasticsearch.Client({ diff --git a/yarn.lock b/yarn.lock index 4f238c9ecc5a71..55a62910f41bc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2381,6 +2381,33 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d" integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg== +"@typescript-eslint/eslint-plugin@^1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.4.2.tgz#370bc32022d1cc884a5dcf62624ef2024182769d" + integrity sha512-6WInypy/cK4rM1dirKbD5p7iFW28DbSRKT/+PGn+DYzBWEvHq5KnZAqQ5cX25JBc0qMkFxJNxNfBbFXJyyzVcw== + dependencies: + "@typescript-eslint/parser" "1.4.2" + "@typescript-eslint/typescript-estree" "1.4.2" + requireindex "^1.2.0" + tsutils "^3.7.0" + +"@typescript-eslint/parser@1.4.2", "@typescript-eslint/parser@^1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.4.2.tgz#acfdee2019958a41d308d768e53ded975ef90ce8" + integrity sha512-OqLkY9295DXXaWToItUv3olO2//rmzh6Th6Sc7YjFFEpEuennsm5zhygLLvHZjPxPlzrQgE8UDaOPurDylaUuw== + dependencies: + "@typescript-eslint/typescript-estree" "1.4.2" + eslint-scope "^4.0.0" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.4.2.tgz#b16bc36c9a4748a7fca92cba4c2d73c5325c8a85" + integrity sha512-wKgi/w6k1v3R4b6oDc20cRWro2gBzp0wn6CAeYC8ExJMfvXMfiaXzw2tT9ilxdONaVWMCk7B9fMdjos7bF/CWw== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + "@webassemblyjs/ast@1.7.10": version "1.7.10" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.7.10.tgz#0cfc61d61286240b72fc522cb755613699eea40a" @@ -3876,7 +3903,7 @@ babel-cli@^6.26.0: optionalDependencies: chokidar "^1.6.1" -babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: +babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= @@ -5636,7 +5663,7 @@ buffered-spawn@~1.1.1: err-code "^0.1.0" q "^1.0.1" -builtin-modules@^1.0.0, builtin-modules@^1.1.1: +builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= @@ -6675,7 +6702,7 @@ commander@0.6.1: resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06" integrity sha1-+mihT2qUXVTbvlDYzbMyDp47GgY= -commander@2, commander@2.19.0, commander@^2.11.0, commander@^2.12.1, commander@^2.12.2, commander@^2.19.0, commander@^2.9.0: +commander@2, commander@2.19.0, commander@^2.11.0, commander@^2.12.2, commander@^2.19.0, commander@^2.9.0: version "2.19.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== @@ -9111,10 +9138,10 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-prettier@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-3.1.0.tgz#2c26d2cdcfa3a05f0642cd7e6e4ef3316cdabfa2" - integrity sha512-QYGfmzuc4q4J6XIhlp8vRKdI/fI0tQfQPy1dME3UOLprE+v4ssH/3W9LM2Q7h5qBcy5m0ehCrBDU2YF8q6OY8w== +eslint-config-prettier@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-4.1.0.tgz#181364895899fff9fd3605fecb5c4f20e7d5f395" + integrity sha512-zILwX9/Ocz4SV2vX7ox85AsrAgXV3f2o2gpIicdMIOra48WYqgUnWNH/cR/iHtmD2Vb3dLSC3LiEJnS05Gkw7w== dependencies: get-stdin "^6.0.0" @@ -9217,13 +9244,12 @@ eslint-plugin-prettier@^2.2.0: fast-diff "^1.1.1" jest-docblock "^21.0.0" -eslint-plugin-prettier@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz#71998c60aedfa2141f7bfcbf9d1c459bf98b4fad" - integrity sha512-tGek5clmW5swrAx1mdPYM8oThrBE83ePh7LeseZHBWfHVGrHPhKn7Y5zgRMbU/9D5Td9K4CEmUPjGxA7iw98Og== +eslint-plugin-prettier@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz#19d521e3981f69dd6d14f64aec8c6a6ac6eb0b0d" + integrity sha512-/PMttrarPAY78PLvV3xfWibMOdMDl57hmlQ2XqFeA37wd+CJ7WSxV7txqjVPHi/AAFKd2lX0ZqfsOc/i5yFCSQ== dependencies: - fast-diff "^1.1.1" - jest-docblock "^21.0.0" + prettier-linter-helpers "^1.0.0" eslint-plugin-react@^7.11.1: version "7.11.1" @@ -9929,6 +9955,11 @@ fast-diff@^1.1.1: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" integrity sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-glob@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.0.4.tgz#a4b9f49e36175f5ef1a3456f580226a6e7abcc9e" @@ -14219,14 +14250,6 @@ js-yaml@^3.10.0, js-yaml@^3.12.0, js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4 argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.7.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" - integrity sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - js-yaml@~3.4.3: version "3.4.6" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.4.6.tgz#6be1b23f6249f53d293370fd4d1aaa63ce1b4eb0" @@ -15456,6 +15479,11 @@ lodash.topath@^4.5.2: resolved "https://registry.yarnpkg.com/lodash.topath/-/lodash.topath-4.5.2.tgz#3616351f3bba61994a0931989660bd03254fd009" integrity sha1-NhY1Hzu6YZlKCTGYlmC9AyVP0Ak= +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + lodash.union@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" @@ -18270,6 +18298,13 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + prettier@1.14.3: version "1.14.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" @@ -20282,6 +20317,11 @@ requirefresh@^2.0.0: dependencies: editions "^1.1.1" +requireindex@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" + integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== + requires-port@1.x.x, requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -20866,16 +20906,16 @@ semver@5.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.1.0.tgz#85f2cf8550465c4df000cf7d86f6b054106ab9e5" integrity sha1-hfLPhVBGXE3wAM99hvawVBBqueU= +semver@5.5.0, semver@^5.0.1, semver@^5.0.3, semver@^5.1.0, semver@^5.4.1, semver@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== + semver@^4.1.0: version "4.3.6" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" integrity sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto= -semver@^5.0.1, semver@^5.0.3, semver@^5.1.0, semver@^5.4.1, semver@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== - semver@^5.5.1: version "5.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" @@ -22939,7 +22979,7 @@ ts-node@^7.0.1: source-map-support "^0.5.6" yn "^2.0.0" -tslib@1.9.3, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.2, tslib@^1.9.3: +tslib@1.9.3, tslib@^1.7.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.2, tslib@^1.9.3: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== @@ -22964,31 +23004,6 @@ tslint-plugin-prettier@^2.0.0: eslint-plugin-prettier "^2.2.0" tslib "^1.7.1" -tslint@^5.11.0: - version "5.11.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed" - integrity sha1-mPMMAurjzecAYgHkwzywi0hYHu0= - dependencies: - babel-code-frame "^6.22.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^3.2.0" - glob "^7.1.1" - js-yaml "^3.7.0" - minimatch "^3.0.4" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.8.0" - tsutils "^2.27.2" - -tsutils@^2.27.2: - version "2.29.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - "tsutils@^2.27.2 <2.29.0": version "2.28.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.28.0.tgz#6bd71e160828f9d019b6f4e844742228f85169a1" @@ -22996,6 +23011,13 @@ tsutils@^2.27.2: dependencies: tslib "^1.8.1" +tsutils@^3.7.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.9.1.tgz#2a40dc742943c71eca6d5c1994fcf999956be387" + integrity sha512-hrxVtLtPqQr//p8/msPT1X1UYXUjizqSit5d9AQ5k38TcV38NyecL5xODNxa73cLe/5sdiJ+w1FqzDhRBA/anA== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" From 3779da17c7d8b4723bd25a0dc147bac3d5ab1d96 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 19 Mar 2019 20:39:28 +0000 Subject: [PATCH 02/36] fix(NA): apply recommend eslint typescript rule.s --- packages/eslint-config-kibana/typescript.js | 48 ++++++--------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 19dc95558c87a8..f7b22677e1e030 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -1,21 +1,17 @@ -// NOTE: this is the configuration to apply the typescript eslint parser +// NOTE: This is the configuration to apply the typescript eslint parser // in order to lint typescript files with eslint. -// Some IDEs could not yet ran eslint with the correct extensions +// Some IDEs could not be running eslint with the correct extensions yet // as this package was moved from typescript-eslint-parser to @typescript-eslint/parser // -// For example in IntelliJ this would be fixed on 2019.1 to be launched soon. -// In order to have it working now we should add the extensions `ts,tsx` to the option +// As a matter of example in IntelliJ IDEA this would be fixed on 2019.1 release to be launched soon. +// In order to have it working for now, we should add the extensions `ts,tsx` to the option // `eslint.additional.file.extensions` that can be found on Help > Find Action > Registry -// More info: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000225170-ESLint-and-ts-Typescript-files +// To read bore about it please visit +// https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000225170-ESLint-and-ts-Typescript-files -const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin').configs.recommended; +const typescriptEslintRecommendedRules = require('@typescript-eslint/eslint-plugin').configs.recommended.rules; const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules; -// Remove every non @typescript-eslint rules from typescript eslint plugin recommended rules -const typescriptEslintRecommendedSanitizedRules = Object.keys(typescriptEslintRecommended.rules) - .filter((key) => !!key.includes('@typescript-eslint')) - .reduce((obj, key) => ({ ...obj, [key]: typescriptEslintRecommended.rules[key] }), {}); - module.exports = { overrides: [ { @@ -33,30 +29,14 @@ module.exports = { // For now we are using an workaround to create // those extended rules arrays rules: Object.assign( - typescriptEslintRecommendedSanitizedRules, + typescriptEslintRecommendedRules, { - "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/array-type": "error", - "@typescript-eslint/ban-types": "error", - "@typescript-eslint/class-name-casing": "error", - "@typescript-eslint/indent": "error", - "@typescript-eslint/interface-name-prefix": "error", - "@typescript-eslint/member-delimiter-style": "error", - "@typescript-eslint/no-angle-bracket-type-assertion": "error", - "@typescript-eslint/no-array-constructor": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-inferrable-types": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-non-null-assertion": "error", - "@typescript-eslint/no-object-literal-type-assertion": "error", - "@typescript-eslint/no-parameter-properties": "error", - "@typescript-eslint/no-triple-slash-reference": "error", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-interface": "error", - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/type-annotation-spacing": "error" + "@typescript-eslint/camelcase": [ 'error', { properties: 'never' } ], + "@typescript-eslint/indent": [ 'error', 2, { SwitchCase: 1 } ], + "@typescript-eslint/no-unused-vars": [ 'error' ], + "@typescript-eslint/no-use-before-define": [ 'error', 'nofunc' ], + "@typescript-eslint/explicit-function-return-type": false, + "@typescript-eslint/no-explicit-any": false, }, eslintConfigPrettierTypescriptEslintRules, ) From b28fc8587e12b7f0a110d5cd2085efe92bc2d78e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 20 Mar 2019 03:33:48 +0000 Subject: [PATCH 03/36] chore(NA): upgrade eslint package versions. --- .eslintrc.js | 3 +- package.json | 16 +- packages/eslint-config-kibana/.eslintrc.js | 2 +- packages/eslint-config-kibana/jest.js | 4 +- packages/eslint-config-kibana/typescript.js | 48 ++- yarn.lock | 438 ++++++++++++-------- 6 files changed, 313 insertions(+), 198 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2e5f5f072e24bf..a97567b88d7d0b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -159,8 +159,7 @@ module.exports = { 'packages/kbn-interpreter/src/plugin/**/*', 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*', 'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*', - 'x-pack/**/*.test.{js,ts,tsx}', - 'x-pack/**/*.test.mocks.{js,ts,tsx}', + 'x-pack/**/*.{test,test.mocks,mock}.{js,ts,tsx}', 'x-pack/gulpfile.js', 'x-pack/plugins/apm/public/utils/testHelpers.js', ], diff --git a/package.json b/package.json index 56813657c91104..ac3daf434e6ef9 100644 --- a/package.json +++ b/package.json @@ -274,7 +274,7 @@ "@types/delete-empty": "^2.0.0", "@types/elasticsearch": "^5.0.30", "@types/enzyme": "^3.1.12", - "@types/eslint": "^4.16.2", + "@types/eslint": "^4.16.6", "@types/execa": "^0.9.0", "@types/fetch-mock": "7.2.1", "@types/getopts": "^2.0.0", @@ -336,17 +336,17 @@ "enzyme-adapter-react-16": "^1.9.0", "enzyme-adapter-utils": "^1.10.0", "enzyme-to-json": "^3.3.4", - "eslint": "^5.6.0", + "eslint": "^5.15.3", "eslint-config-prettier": "^4.1.0", - "eslint-plugin-babel": "^5.2.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jest": "^21.26.2", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-mocha": "^5.2.0", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jest": "^22.4.1", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", "eslint-plugin-prettier": "^3.0.1", - "eslint-plugin-react": "^7.11.1", + "eslint-plugin-react": "^7.12.4", "expect.js": "0.3.1", "faker": "1.1.0", "fetch-mock": "7.3.0", diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index 9906f9cf8dfe6c..f926915ddd3e2c 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -177,4 +177,4 @@ module.exports = { 'prefer-object-spread/prefer-object-spread': 'error', } -} +}; diff --git a/packages/eslint-config-kibana/jest.js b/packages/eslint-config-kibana/jest.js index c28a9c48c68268..a590fca735a496 100644 --- a/packages/eslint-config-kibana/jest.js +++ b/packages/eslint-config-kibana/jest.js @@ -1,7 +1,9 @@ module.exports = { overrides: [ { - files: ['**/*.test.js'], + files: [ + '**/*.{test,test.mocks,mock}.{js,ts,tsx}', + ], plugins: [ 'jest', ], diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index f7b22677e1e030..02cfb98b7ff3e3 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -18,6 +18,7 @@ module.exports = { parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { jsx: true }, + project: './tsconfig.json' }, files: ['**/*.{ts,tsx}'], plugins: ['@typescript-eslint'], @@ -29,17 +30,50 @@ module.exports = { // For now we are using an workaround to create // those extended rules arrays rules: Object.assign( - typescriptEslintRecommendedRules, { - "@typescript-eslint/camelcase": [ 'error', { properties: 'never' } ], - "@typescript-eslint/indent": [ 'error', 2, { SwitchCase: 1 } ], - "@typescript-eslint/no-unused-vars": [ 'error' ], - "@typescript-eslint/no-use-before-define": [ 'error', 'nofunc' ], - "@typescript-eslint/explicit-function-return-type": false, - "@typescript-eslint/no-explicit-any": false, + typescriptEslintRecommendedRules, + "camelcase": "off", + '@typescript-eslint/camelcase': [ 'error', { properties: 'never' } ], + "indent": "off", + '@typescript-eslint/indent': [ 'error', 2, { SwitchCase: 1 } ], + "no-unused-vars": "off", + '@typescript-eslint/no-unused-vars': [ 'error' ], + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'off', + + "@typescript-eslint/adjacent-overload-signatures": 'off', + "@typescript-eslint/array-type": 'off', + "@typescript-eslint/ban-types": "error", + "@typescript-eslint/class-name-casing": "error", + "@typescript-eslint/explicit-function-return-type": 'off', + "@typescript-eslint/explicit-member-accessibility": 'off', + "@typescript-eslint/interface-name-prefix": "off", + "@typescript-eslint/member-delimiter-style": "error", + "@typescript-eslint/no-angle-bracket-type-assertion": "error", + "no-array-constructor": "off", + "@typescript-eslint/no-array-constructor": "error", + "@typescript-eslint/no-empty-interface": "error", + "@typescript-eslint/no-explicit-any": 'off', + "@typescript-eslint/no-inferrable-types": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-non-null-assertion": 'off', + "@typescript-eslint/no-object-literal-type-assertion": "error", + "@typescript-eslint/no-parameter-properties": "off", + "@typescript-eslint/no-triple-slash-reference": "error", + "@typescript-eslint/no-var-requires": "offr", + "@typescript-eslint/prefer-interface": "error", + "@typescript-eslint/prefer-namespace-keyword": "error", + "@typescript-eslint/type-annotation-spacing": "error" }, eslintConfigPrettierTypescriptEslintRules, ) }, + { + parserOptions: { + project: 'x-pack/tsconfig.json' + }, + files: ['x-pack/**/*.{ts,tsx}'], + }, ] }; diff --git a/yarn.lock b/yarn.lock index 55a62910f41bc1..00f356d8be4884 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1764,10 +1764,10 @@ "@types/cheerio" "*" "@types/react" "*" -"@types/eslint@^4.16.2": - version "4.16.2" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-4.16.2.tgz#30f4f026019eb78a6ef12f276b75cd16ea2afb27" - integrity sha512-gCqhoFlyLic8Ux1OQt9cjlPbXk/dS7zPpofazBkie6SWCl+e1IEZBgLqyakm27nh0/uSZYW2TqkBusV9fLmztw== +"@types/eslint@^4.16.6": + version "4.16.6" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-4.16.6.tgz#96d4ecddbea618ab0b55eaf0dffedf387129b06c" + integrity sha512-GL7tGJig55FeclpOytU7nCCqtR143jBoC7AUdH0DO9xBSIFiNNUFCY/S3KNWsHeQJuU3hjw/OC1+kRTFNXqUZQ== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -2810,19 +2810,17 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn-jsx@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" - integrity sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw== - dependencies: - acorn "^5.0.3" +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== acorn-walk@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.0.1.tgz#c7827bdbb8e21aa97b609adfa225400d9ae348ba" integrity sha512-PqVQ8c6a3kyqdsUZlC7nljp3FFuxipBRHKu+7C1h8QygBFlzTaDX5HD383jej3Peed+1aDG8HwkfB1Z1HMNPkw== -acorn@5.X, acorn@^5.0.3, acorn@^5.5.0, acorn@^5.6.0, acorn@^5.6.2, acorn@^5.7.1: +acorn@5.X, acorn@^5.0.3, acorn@^5.5.0, acorn@^5.6.2, acorn@^5.7.1: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== @@ -2847,6 +2845,11 @@ acorn@^6.0.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754" integrity sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg== +acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + address@1.0.3, address@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9" @@ -2929,7 +2932,7 @@ ajv-keywords@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" integrity sha1-MU3QpLM2j609/NxU7eYXG4htrzw= -ajv-keywords@^3.0.0, ajv-keywords@^3.1.0: +ajv-keywords@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= @@ -2952,7 +2955,7 @@ ajv@^5.0.0, ajv@^5.1.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.0.1, ajv@^6.1.0, ajv@^6.1.1, ajv@^6.5.3, ajv@^6.5.5: +ajv@^6.1.0, ajv@^6.1.1, ajv@^6.5.5: version "6.5.5" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.5.tgz#cf97cdade71c6399a92c6d6c4177381291b781a1" integrity sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg== @@ -2962,6 +2965,16 @@ ajv@^6.0.1, ajv@^6.1.0, ajv@^6.1.1, ajv@^6.5.3, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.9.1: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -3076,6 +3089,11 @@ ansi-escapes@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" integrity sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ== +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + ansi-gray@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" @@ -3122,6 +3140,11 @@ ansi-regex@^4.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" integrity sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w== +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + ansi-styles@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" @@ -3869,7 +3892,7 @@ axios@^0.18.0: follow-redirects "^1.3.0" is-buffer "^1.1.5" -axobject-query@^2.0.1: +axobject-query@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== @@ -6144,6 +6167,11 @@ chardet@^0.5.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.5.0.tgz#fe3ac73c00c3d865ffcc02a0682e2c20b6a06029" integrity sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g== +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + checksum@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/checksum/-/checksum-0.1.1.tgz#dc6527d4c90be8560dbd1ed4cecf3297d528e9e9" @@ -7892,7 +7920,7 @@ debug@3.X, debug@^3.1.0, debug@^3.2.5: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -8333,6 +8361,13 @@ doctrine@^2.0.0, doctrine@^2.1.0: dependencies: esutils "^2.0.2" +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + doctypes@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" @@ -8691,10 +8726,10 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" -emoji-regex@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2" - integrity sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ== +emoji-regex@^7.0.1, emoji-regex@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== emojis-list@^2.0.0: version "2.1.0" @@ -9145,7 +9180,7 @@ eslint-config-prettier@^4.1.0: dependencies: get-stdin "^6.0.0" -eslint-import-resolver-node@^0.3.1, eslint-import-resolver-node@^0.3.2: +eslint-import-resolver-node@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== @@ -9169,62 +9204,62 @@ eslint-import-resolver-webpack@^0.10.1: resolve "^1.4.0" semver "^5.3.0" -eslint-module-utils@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" - integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= +eslint-module-utils@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz#546178dab5e046c8b562bbb50705e2456d7bda49" + integrity sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w== dependencies: debug "^2.6.8" - pkg-dir "^1.0.0" + pkg-dir "^2.0.0" -eslint-plugin-babel@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.2.0.tgz#3041a0c26aa3ca4a0e0f2aa11591f0396790d981" - integrity sha512-9pNH/e214SN3r2nEwwTLRI27jUN4+nuLMv1+qxfDv8Za9cJ3F+aPkNinYiVeUmAmiEtOttbS32yuwRG2DREvJg== +eslint-plugin-babel@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz#2e7f251ccc249326da760c1a4c948a91c32d0023" + integrity sha512-HPuNzSPE75O+SnxHIafbW5QB45r2w78fxqwK3HmjqIUoPfPzVrq6rD+CINU3yzoDSzEhUkX07VUphbF73Lth/w== dependencies: eslint-rule-composer "^0.3.0" -eslint-plugin-import@^2.14.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" - integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== +eslint-plugin-import@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f" + integrity sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A== dependencies: contains-path "^0.1.0" - debug "^2.6.8" + debug "^2.6.9" doctrine "1.5.0" - eslint-import-resolver-node "^0.3.1" - eslint-module-utils "^2.2.0" - has "^1.0.1" - lodash "^4.17.4" - minimatch "^3.0.3" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.3.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" read-pkg-up "^2.0.0" - resolve "^1.6.0" + resolve "^1.9.0" -eslint-plugin-jest@^21.26.2: - version "21.27.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.27.2.tgz#2a795b7c3b5e707df48a953d651042bd01d7b0a8" - integrity sha512-0E4OIgBJVlAmf1KfYFtZ3gYxgUzC5Eb3Jzmrc9ikI1OY+/cM8Kh72Ti7KfpeHNeD3HJNf9SmEfmvQLIz44Hrhw== +eslint-plugin-jest@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.4.1.tgz#a5fd6f7a2a41388d16f527073b778013c5189a9c" + integrity sha512-gcLfn6P2PrFAVx3AobaOzlIEevpAEf9chTpFZz7bYfc7pz8XRv7vuKTIE4hxPKZSha6XWKKplDQ0x9Pq8xX2mg== -eslint-plugin-jsx-a11y@^6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.1.2.tgz#69bca4890b36dcf0fe16dd2129d2d88b98f33f88" - integrity sha512-7gSSmwb3A+fQwtw0arguwMdOdzmKUgnUcbSNlo+GjKLAQFuC2EZxWqG9XHRI8VscBJD5a8raz3RuxQNFW+XJbw== +eslint-plugin-jsx-a11y@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz#4ebba9f339b600ff415ae4166e3e2e008831cf0c" + integrity sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w== dependencies: aria-query "^3.0.0" array-includes "^3.0.3" ast-types-flow "^0.0.7" - axobject-query "^2.0.1" + axobject-query "^2.0.2" damerau-levenshtein "^1.0.4" - emoji-regex "^6.5.1" + emoji-regex "^7.0.2" has "^1.0.3" jsx-ast-utils "^2.0.1" -eslint-plugin-mocha@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-5.2.0.tgz#d8786d9fff8cb8b5f6e4b61e40395d6568a5c4e2" - integrity sha512-4VTX/qIoxUFRnXLNm6bEhEJyfGnGagmQzV4TWXKzkZgIYyP2FSubEdCjEFTyS/dGwSVRWCWGX7jO7BK8R0kppg== +eslint-plugin-mocha@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-5.3.0.tgz#cf3eb18ae0e44e433aef7159637095a7cb19b15b" + integrity sha512-3uwlJVLijjEmBeNyH60nzqgA1gacUWLUmcKV8PIGNvj1kwP/CTgAWQHn2ayyJVwziX+KETkr9opNwT1qD/RZ5A== dependencies: - ramda "^0.25.0" + ramda "^0.26.1" eslint-plugin-no-unsanitized@^3.0.2: version "3.0.2" @@ -9236,14 +9271,6 @@ eslint-plugin-prefer-object-spread@^1.2.1: resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-object-spread/-/eslint-plugin-prefer-object-spread-1.2.1.tgz#27fb91853690cceb3ae6101d9c8aecc6a67a402c" integrity sha1-J/uRhTaQzOs65hAdnIrsxqZ6QCw= -eslint-plugin-prettier@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7" - integrity sha512-floiaI4F7hRkTrFe8V2ItOK97QYrX75DjmdzmVITZoAP6Cn06oEDPQRsO6MlHEP/u2SxI3xQ52Kpjw6j5WGfeQ== - dependencies: - fast-diff "^1.1.1" - jest-docblock "^21.0.0" - eslint-plugin-prettier@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.1.tgz#19d521e3981f69dd6d14f64aec8c6a6ac6eb0b0d" @@ -9251,16 +9278,18 @@ eslint-plugin-prettier@^3.0.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react@^7.11.1: - version "7.11.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz#c01a7af6f17519457d6116aa94fc6d2ccad5443c" - integrity sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw== +eslint-plugin-react@^7.12.4: + version "7.12.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c" + integrity sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ== dependencies: array-includes "^3.0.3" doctrine "^2.1.0" has "^1.0.3" jsx-ast-utils "^2.0.1" + object.fromentries "^2.0.0" prop-types "^15.6.2" + resolve "^1.9.0" eslint-rule-composer@^0.3.0: version "0.3.0" @@ -9283,6 +9312,14 @@ eslint-scope@^4.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + eslint-utils@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" @@ -9332,48 +9369,46 @@ eslint@^2.7.0: text-table "~0.2.0" user-home "^2.0.0" -eslint@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.6.0.tgz#b6f7806041af01f71b3f1895cbb20971ea4b6223" - integrity sha512-/eVYs9VVVboX286mBK7bbKnO1yamUy2UCRjiY6MryhQL2PaaXCExsCQ2aO83OeYRhU2eCU/FMFP+tVMoOrzNrA== +eslint@^5.15.3: + version "5.15.3" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.15.3.tgz#c79c3909dc8a7fa3714fb340c11e30fd2526b8b5" + integrity sha512-vMGi0PjCHSokZxE0NLp2VneGw5sio7SSiDNgIUn2tC0XkWJRNOIoHIg3CliLVfXnJsiHxGAYrkw0PieAu8+KYQ== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.5.3" + ajv "^6.9.1" chalk "^2.1.0" cross-spawn "^6.0.5" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^4.0.0" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^4.0.0" + espree "^5.0.1" esquery "^1.0.1" esutils "^2.0.2" - file-entry-cache "^2.0.0" + file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" glob "^7.1.2" globals "^11.7.0" ignore "^4.0.6" + import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.1.0" - is-resolvable "^1.1.0" + inquirer "^6.2.2" js-yaml "^3.12.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.5" + lodash "^4.17.11" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^7.0.0" progress "^2.0.0" - regexpp "^2.0.0" - require-uncached "^1.0.3" + regexpp "^2.0.1" semver "^5.5.1" strip-ansi "^4.0.0" strip-json-comments "^2.0.1" - table "^4.0.3" + table "^5.2.3" text-table "^0.2.0" esm@^3.0.84: @@ -9389,13 +9424,14 @@ espree@^3.1.6: acorn "^5.5.0" acorn-jsx "^3.0.0" -espree@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" - integrity sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg== +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== dependencies: - acorn "^5.6.0" - acorn-jsx "^4.1.1" + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" @@ -9842,6 +9878,15 @@ external-editor@^3.0.0: iconv-lite "^0.4.22" tmp "^0.0.33" +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -9950,11 +9995,6 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= -fast-diff@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" - integrity sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig== - fast-diff@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" @@ -10094,13 +10134,12 @@ file-entry-cache@^1.1.1: flat-cache "^1.2.1" object-assign "^4.0.1" -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" + flat-cache "^2.0.1" file-loader@1.1.11: version "1.1.11" @@ -10367,6 +10406,15 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + flatted@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" @@ -12429,7 +12477,7 @@ icalendar@0.7.1: resolved "https://registry.yarnpkg.com/icalendar/-/icalendar-0.7.1.tgz#d0d3486795f8f1c5cf4f8cafac081b4b4e7a32ae" integrity sha1-0NNIZ5X48cXPT4yvrAgbS056Mq4= -iconv-lite@0.4, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.22, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.22, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -12539,6 +12587,14 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-from@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" @@ -12667,7 +12723,7 @@ inline-style@^2.0.0: dependencies: dashify "^0.1.0" -inquirer@6.2.0, inquirer@^6.1.0, inquirer@^6.2.0: +inquirer@6.2.0, inquirer@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" integrity sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg== @@ -12802,6 +12858,25 @@ inquirer@^6.0.0: strip-ansi "^4.0.0" through "^2.3.6" +inquirer@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" + integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.0.0" + through "^2.3.6" + insane@2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/insane/-/insane-2.5.0.tgz#3252baec85c53b108cdf731e7962b7ce9c5cff1f" @@ -13389,7 +13464,7 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" -is-resolvable@^1.0.0, is-resolvable@^1.1.0: +is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== @@ -13821,11 +13896,6 @@ jest-diff@^24.0.0: jest-get-type "^24.0.0" pretty-format "^24.0.0" -jest-docblock@^21.0.0: - version "21.2.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" - integrity sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw== - jest-docblock@^24.0.0: version "24.0.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.0.0.tgz#54d77a188743e37f62181a91a01eb9222289f94e" @@ -17632,6 +17702,13 @@ param-case@2.1.x, param-case@^2.1.0: dependencies: no-case "^2.2.0" +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" @@ -17843,6 +17920,11 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME= +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + path-root-regex@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" @@ -18020,13 +18102,6 @@ pixelmatch@4.0.2, pixelmatch@^4.0.0: dependencies: pngjs "^3.0.0" -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= - dependencies: - find-up "^1.0.0" - pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -18103,11 +18178,6 @@ pluralize@^1.2.1: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" integrity sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU= -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - pn@^1.0.0, pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -18821,10 +18891,10 @@ ramda@^0.21.0: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.21.0.tgz#a001abedb3ff61077d4ff1d577d44de77e8d0a35" integrity sha1-oAGr7bP/YQd9T/HVd9RN536NCjU= -ramda@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.25.0.tgz#8fdf68231cffa90bc2f9460390a0cb74a29b29a9" - integrity sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ== +ramda@^0.26.1: + version "0.26.1" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" + integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== randexp@0.4.6: version "0.4.6" @@ -19966,10 +20036,10 @@ regexp.prototype.flags@^1.2.0: dependencies: define-properties "^1.1.2" -regexpp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365" - integrity sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA== +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== regexpu-core@^1.0.0: version "1.0.0" @@ -20302,7 +20372,7 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -require-uncached@^1.0.2, require-uncached@^1.0.3: +require-uncached@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= @@ -20408,7 +20478,7 @@ resolve@^1.1.5, resolve@^1.1.6, resolve@^1.1.7: dependencies: path-parse "^1.0.5" -resolve@^1.3.2, resolve@^1.4.0, resolve@^1.6.0, resolve@^1.8.1: +resolve@^1.3.2, resolve@^1.4.0, resolve@^1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== @@ -20422,6 +20492,13 @@ resolve@^1.5.0, resolve@^1.7.1: dependencies: path-parse "^1.0.5" +resolve@^1.9.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" + integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== + dependencies: + path-parse "^1.0.6" + responselike@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -20488,18 +20565,18 @@ rimraf@2.4.3: dependencies: glob "^5.0.14" -rimraf@~2.2.6: - version "2.2.8" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" - integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= - -rimraf@~2.6.2: +rimraf@2.6.3, rimraf@~2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" +rimraf@~2.2.6: + version "2.2.8" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" + integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" @@ -20650,6 +20727,13 @@ rxjs@^6.2.1: dependencies: tslib "^1.9.0" +rxjs@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504" + integrity sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -21254,11 +21338,13 @@ slice-ansi@0.0.4: resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" slide@^1.1.5, slide@~1.1.3: @@ -21865,6 +21951,15 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + string.prototype.matchall@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-3.0.0.tgz#66f4d8dd5c6c6cea4dffb55ec5f3184a8dd0dd59" @@ -21962,6 +22057,13 @@ strip-ansi@^5.0.0: dependencies: ansi-regex "^4.0.0" +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + strip-bom-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca" @@ -22297,17 +22399,15 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -table@^4.0.3: - version "4.0.3" - resolved "http://registry.npmjs.org/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" - integrity sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg== +table@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" + integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== dependencies: - ajv "^6.0.1" - ajv-keywords "^3.0.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" tabtab@^1.3.2: version "1.3.2" @@ -22979,38 +23079,11 @@ ts-node@^7.0.1: source-map-support "^0.5.6" yn "^2.0.0" -tslib@1.9.3, tslib@^1.7.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.2, tslib@^1.9.3: +tslib@1.9.3, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.2, tslib@^1.9.3: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== -tslint-config-prettier@^1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.15.0.tgz#76b9714399004ab6831fdcf76d89b73691c812cf" - integrity sha512-06CgrHJxJmNYVgsmeMoa1KXzQRoOdvfkqnJth6XUkNeOz707qxN0WfxfhYwhL5kXHHbYJRby2bqAPKwThlZPhw== - -tslint-microsoft-contrib@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-6.0.0.tgz#7bff73c9ad7a0b7eb5cdb04906de58f42a2bf7a2" - integrity sha512-R//efwn+34IUjTJeYgNDAJdzG0jyLWIehygPt/PHuZAieTolFVS56FgeFW7DOLap9ghXzMiFPTmDgm54qaL7QA== - dependencies: - tsutils "^2.27.2 <2.29.0" - -tslint-plugin-prettier@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/tslint-plugin-prettier/-/tslint-plugin-prettier-2.0.0.tgz#ade328b26c71f37418d4d01187dca232a7447b49" - integrity sha512-nA8yM+1tS9dylirSajTxxFV6jCQrIMQ0Ykl//jjRgqmwwmGp3hqodG+rtr16S/OUwyQBfoFScFDK7nuHYPd4Gw== - dependencies: - eslint-plugin-prettier "^2.2.0" - tslib "^1.7.1" - -"tsutils@^2.27.2 <2.29.0": - version "2.28.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.28.0.tgz#6bd71e160828f9d019b6f4e844742228f85169a1" - integrity sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA== - dependencies: - tslib "^1.8.1" - tsutils@^3.7.0: version "3.9.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.9.1.tgz#2a40dc742943c71eca6d5c1994fcf999956be387" @@ -25125,6 +25198,13 @@ write-pkg@^3.1.0: sort-keys "^2.0.0" write-json-file "^2.2.0" +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" From 94843ac1d6f33002bca564ba2035773a860b500f Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 20 Mar 2019 05:03:19 +0000 Subject: [PATCH 04/36] chore(NA): split javascript eslint config in an override section. --- .eslintrc.js | 3 +- packages/eslint-config-kibana/.eslintrc.js | 171 ------------------ packages/eslint-config-kibana/javascript.js | 185 ++++++++++++++++++++ packages/eslint-config-kibana/typescript.js | 73 ++++---- 4 files changed, 221 insertions(+), 211 deletions(-) create mode 100644 packages/eslint-config-kibana/javascript.js diff --git a/.eslintrc.js b/.eslintrc.js index a97567b88d7d0b..efa5771344cb8f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -35,8 +35,9 @@ const ELASTIC_LICENSE_HEADER = ` module.exports = { extends: [ '@elastic/eslint-config-kibana', - '@elastic/eslint-config-kibana/jest', + '@elastic/eslint-config-kibana/javascript', '@elastic/eslint-config-kibana/typescript', + '@elastic/eslint-config-kibana/jest', ], settings: { diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index f926915ddd3e2c..e3025f5cae434a 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -1,180 +1,9 @@ -const semver = require('semver'); - -const PKG = require('../../package.json'); -const RESTRICTED_GLOBALS = require('./restricted_globals'); - module.exports = { - parser: 'babel-eslint', - - plugins: [ - 'mocha', - 'babel', - 'react', - 'import', - 'no-unsanitized', - 'prefer-object-spread', - 'jsx-a11y', - ], - - settings: { - react: { - version: semver.valid(semver.coerce(PKG.dependencies.react)), - }, - }, - env: { es6: true, - node: true, - mocha: true, - browser: true, }, parserOptions: { - sourceType: 'module', ecmaVersion: 6, - ecmaFeatures: { experimentalObjectRestSpread: true }, }, - - rules: { - 'block-scoped-var': 'error', - camelcase: [ 'error', { properties: 'never' } ], - 'comma-dangle': 'off', - 'comma-spacing': ['error', { before: false, after: true }], - 'comma-style': [ 'error', 'last' ], - 'consistent-return': 'off', - curly: [ 'error', 'multi-line' ], - 'dot-location': [ 'error', 'property' ], - 'dot-notation': [ 'error', { allowKeywords: true } ], - eqeqeq: [ 'error', 'allow-null' ], - 'guard-for-in': 'error', - indent: [ 'error', 2, { SwitchCase: 1 } ], - 'key-spacing': ['error', { beforeColon: false, afterColon: true }], - 'max-len': [ 'error', 140, 2, { ignoreComments: true, ignoreUrls: true } ], - 'new-cap': [ 'error', { capIsNewExceptions: [ 'Private' ] } ], - 'no-bitwise': 'off', - 'no-caller': 'error', - 'no-cond-assign': 'off', - 'no-const-assign': 'error', - 'no-debugger': 'error', - 'no-empty': 'error', - 'no-eval': 'error', - 'no-extend-native': 'error', - 'no-extra-parens': 'off', - 'no-extra-semi': [ 'error' ], - 'no-global-assign': 'error', - 'no-irregular-whitespace': 'error', - 'no-iterator': 'error', - 'no-loop-func': 'error', - 'no-multi-spaces': 'off', - 'no-multi-str': 'off', - 'no-nested-ternary': 'error', - 'no-new': 'off', - 'no-path-concat': 'off', - 'no-proto': 'error', - 'no-redeclare': 'error', - 'no-restricted-globals': ['error', ...RESTRICTED_GLOBALS], - 'no-return-assign': 'off', - 'no-script-url': 'error', - 'no-sequences': 'error', - 'no-shadow': 'off', - 'no-trailing-spaces': 'error', - 'no-undef': 'error', - 'no-underscore-dangle': 'off', - 'no-unsanitized/method': 'error', - 'no-unsanitized/property': 'error', - 'no-unused-expressions': 'off', - 'no-unused-vars': [ 'error' ], - 'no-use-before-define': [ 'error', 'nofunc' ], - 'no-var': 'error', - 'no-with': 'error', - 'one-var': [ 'error', 'never' ], - 'prefer-const': 'error', - quotes: [ 'error', 'single', { allowTemplateLiterals: true } ], - 'semi-spacing': [ 'error', { before: false, after: true } ], - semi: [ 'error', 'always' ], - 'space-before-blocks': [ 'error', 'always' ], - 'space-before-function-paren': [ 'error', { anonymous: 'always', named: 'never' } ], - 'space-in-parens': [ 'error', 'never' ], - 'space-infix-ops': [ 'error', { int32Hint: false } ], - 'space-unary-ops': [ 'error' ], - strict: [ 'error', 'never' ], - 'valid-typeof': 'error', - 'wrap-iife': [ 'error', 'outside' ], - 'eol-last': ['error', 'always'], - yoda: 'off', - - 'object-curly-spacing': 'off', // overridden with babel/object-curly-spacing - 'babel/object-curly-spacing': [ 'error', 'always' ], - - 'jsx-quotes': ['error', 'prefer-double'], - 'react/jsx-uses-react': 'error', - 'react/react-in-jsx-scope': 'error', - 'react/jsx-uses-vars': 'error', - 'react/jsx-no-undef': 'error', - 'react/jsx-pascal-case': 'error', - 'react/jsx-closing-bracket-location': ['error', 'line-aligned'], - 'react/jsx-closing-tag-location': 'error', - 'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }], - 'react/jsx-indent-props': ['error', 2], - 'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }], - 'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }], - 'react/no-danger': 'error', - 'react/self-closing-comp': 'error', - 'react/jsx-wrap-multilines': ['error', { - declaration: true, - assignment: true, - return: true, - arrow: true, - }], - 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'], - 'jsx-a11y/accessible-emoji': 'error', - 'jsx-a11y/alt-text': 'error', - 'jsx-a11y/anchor-has-content': 'error', - 'jsx-a11y/aria-activedescendant-has-tabindex': 'error', - 'jsx-a11y/aria-props': 'error', - 'jsx-a11y/aria-proptypes': 'error', - 'jsx-a11y/aria-role': 'error', - 'jsx-a11y/aria-unsupported-elements': 'error', - 'jsx-a11y/heading-has-content': 'error', - 'jsx-a11y/html-has-lang': 'error', - 'jsx-a11y/iframe-has-title': 'error', - 'jsx-a11y/interactive-supports-focus': 'error', - 'jsx-a11y/media-has-caption': 'error', - 'jsx-a11y/mouse-events-have-key-events': 'error', - 'jsx-a11y/no-access-key': 'error', - 'jsx-a11y/no-distracting-elements': 'error', - 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error', - 'jsx-a11y/no-noninteractive-element-interactions': 'error', - 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error', - 'jsx-a11y/no-redundant-roles': 'error', - 'jsx-a11y/role-has-required-aria-props': 'error', - 'jsx-a11y/role-supports-aria-props': 'error', - 'jsx-a11y/scope': 'error', - 'jsx-a11y/tabindex-no-positive': 'error', - 'jsx-a11y/label-has-associated-control': 'error', - 'react/jsx-equals-spacing': ['error', 'never'], - 'react/jsx-indent': ['error', 2], - 'react/no-will-update-set-state': 'error', - 'react/no-is-mounted': 'error', - 'react/no-multi-comp': ['error', { ignoreStateless: true }], - 'react/no-unknown-property': 'error', - 'react/prefer-es6-class': ['error', 'always'], - 'react/prefer-stateless-function': ['error', { ignorePureComponents: true }], - 'react/no-unescaped-entities': 'error', - - 'mocha/handle-done-callback': 'error', - 'mocha/no-exclusive-tests': 'error', - - 'import/no-unresolved': [ 'error', { 'amd': true, 'commonjs': true } ], - 'import/named': 'error', - 'import/namespace': 'error', - 'import/default': 'error', - 'import/export': 'error', - 'import/no-named-as-default': 'error', - 'import/no-named-as-default-member': 'error', - 'import/no-duplicates': 'error', - 'import/no-dynamic-require': 'error', - - 'prefer-object-spread/prefer-object-spread': 'error', - } }; diff --git a/packages/eslint-config-kibana/javascript.js b/packages/eslint-config-kibana/javascript.js new file mode 100644 index 00000000000000..fb7943e549f30d --- /dev/null +++ b/packages/eslint-config-kibana/javascript.js @@ -0,0 +1,185 @@ +const semver = require('semver'); + +const PKG = require('../../package.json'); +const RESTRICTED_GLOBALS = require('./restricted_globals'); + +module.exports = { + overrides: [ + { + files: ['**/*.js'], + parser: 'babel-eslint', + + plugins: [ + 'mocha', + 'babel', + 'react', + 'import', + 'no-unsanitized', + 'prefer-object-spread', + 'jsx-a11y', + ], + + settings: { + react: { + version: semver.valid(semver.coerce(PKG.dependencies.react)), + }, + }, + + env: { + es6: true, + node: true, + mocha: true, + browser: true, + }, + + parserOptions: { + sourceType: 'module', + ecmaVersion: 6, + ecmaFeatures: { experimentalObjectRestSpread: true }, + }, + + rules: { + 'block-scoped-var': 'error', + camelcase: [ 'error', { properties: 'never' } ], + 'comma-dangle': 'off', + 'comma-spacing': ['error', { before: false, after: true }], + 'comma-style': [ 'error', 'last' ], + 'consistent-return': 'off', + curly: [ 'error', 'multi-line' ], + 'dot-location': [ 'error', 'property' ], + 'dot-notation': [ 'error', { allowKeywords: true } ], + eqeqeq: [ 'error', 'allow-null' ], + 'guard-for-in': 'error', + indent: [ 'error', 2, { SwitchCase: 1 } ], + 'key-spacing': ['error', { beforeColon: false, afterColon: true }], + 'max-len': [ 'error', 140, 2, { ignoreComments: true, ignoreUrls: true } ], + 'new-cap': [ 'error', { capIsNewExceptions: [ 'Private' ] } ], + 'no-bitwise': 'off', + 'no-caller': 'error', + 'no-cond-assign': 'off', + 'no-const-assign': 'error', + 'no-debugger': 'error', + 'no-empty': 'error', + 'no-eval': 'error', + 'no-extend-native': 'error', + 'no-extra-parens': 'off', + 'no-extra-semi': [ 'error' ], + 'no-global-assign': 'error', + 'no-irregular-whitespace': 'error', + 'no-iterator': 'error', + 'no-loop-func': 'error', + 'no-multi-spaces': 'off', + 'no-multi-str': 'off', + 'no-nested-ternary': 'error', + 'no-new': 'off', + 'no-path-concat': 'off', + 'no-proto': 'error', + 'no-redeclare': 'error', + 'no-restricted-globals': ['error', ...RESTRICTED_GLOBALS], + 'no-return-assign': 'off', + 'no-script-url': 'error', + 'no-sequences': 'error', + 'no-shadow': 'off', + 'no-trailing-spaces': 'error', + 'no-undef': 'error', + 'no-underscore-dangle': 'off', + 'no-unsanitized/method': 'error', + 'no-unsanitized/property': 'error', + 'no-unused-expressions': 'off', + 'no-unused-vars': [ 'error' ], + 'no-use-before-define': [ 'error', 'nofunc' ], + 'no-var': 'error', + 'no-with': 'error', + 'one-var': [ 'error', 'never' ], + 'prefer-const': 'error', + quotes: [ 'error', 'single', { allowTemplateLiterals: true } ], + 'semi-spacing': [ 'error', { before: false, after: true } ], + semi: [ 'error', 'always' ], + 'space-before-blocks': [ 'error', 'always' ], + 'space-before-function-paren': [ 'error', { anonymous: 'always', named: 'never' } ], + 'space-in-parens': [ 'error', 'never' ], + 'space-infix-ops': [ 'error', { int32Hint: false } ], + 'space-unary-ops': [ 'error' ], + strict: [ 'error', 'never' ], + 'valid-typeof': 'error', + 'wrap-iife': [ 'error', 'outside' ], + 'eol-last': ['error', 'always'], + yoda: 'off', + + 'object-curly-spacing': 'off', // overridden with babel/object-curly-spacing + 'babel/object-curly-spacing': [ 'error', 'always' ], + + 'jsx-quotes': ['error', 'prefer-double'], + 'react/jsx-uses-react': 'error', + 'react/react-in-jsx-scope': 'error', + 'react/jsx-uses-vars': 'error', + 'react/jsx-no-undef': 'error', + 'react/jsx-pascal-case': 'error', + 'react/jsx-closing-bracket-location': ['error', 'line-aligned'], + 'react/jsx-closing-tag-location': 'error', + 'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }], + 'react/jsx-indent-props': ['error', 2], + 'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }], + 'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }], + 'react/no-danger': 'error', + 'react/self-closing-comp': 'error', + 'react/jsx-wrap-multilines': ['error', { + declaration: true, + assignment: true, + return: true, + arrow: true, + }], + 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'], + 'jsx-a11y/accessible-emoji': 'error', + 'jsx-a11y/alt-text': 'error', + 'jsx-a11y/anchor-has-content': 'error', + 'jsx-a11y/aria-activedescendant-has-tabindex': 'error', + 'jsx-a11y/aria-props': 'error', + 'jsx-a11y/aria-proptypes': 'error', + 'jsx-a11y/aria-role': 'error', + 'jsx-a11y/aria-unsupported-elements': 'error', + 'jsx-a11y/heading-has-content': 'error', + 'jsx-a11y/html-has-lang': 'error', + 'jsx-a11y/iframe-has-title': 'error', + 'jsx-a11y/interactive-supports-focus': 'error', + 'jsx-a11y/media-has-caption': 'error', + 'jsx-a11y/mouse-events-have-key-events': 'error', + 'jsx-a11y/no-access-key': 'error', + 'jsx-a11y/no-distracting-elements': 'error', + 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error', + 'jsx-a11y/no-noninteractive-element-interactions': 'error', + 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error', + 'jsx-a11y/no-redundant-roles': 'error', + 'jsx-a11y/role-has-required-aria-props': 'error', + 'jsx-a11y/role-supports-aria-props': 'error', + 'jsx-a11y/scope': 'error', + 'jsx-a11y/tabindex-no-positive': 'error', + 'jsx-a11y/label-has-associated-control': 'error', + 'react/jsx-equals-spacing': ['error', 'never'], + 'react/jsx-indent': ['error', 2], + 'react/no-will-update-set-state': 'error', + 'react/no-is-mounted': 'error', + 'react/no-multi-comp': ['error', { ignoreStateless: true }], + 'react/no-unknown-property': 'error', + 'react/prefer-es6-class': ['error', 'always'], + 'react/prefer-stateless-function': ['error', { ignorePureComponents: true }], + 'react/no-unescaped-entities': 'error', + + 'mocha/handle-done-callback': 'error', + 'mocha/no-exclusive-tests': 'error', + + 'import/no-unresolved': [ 'error', { 'amd': true, 'commonjs': true } ], + 'import/named': 'error', + 'import/namespace': 'error', + 'import/default': 'error', + 'import/export': 'error', + 'import/no-named-as-default': 'error', + 'import/no-named-as-default-member': 'error', + 'import/no-duplicates': 'error', + 'import/no-dynamic-require': 'error', + + 'prefer-object-spread/prefer-object-spread': 'error', + } + }, + ] +}; diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 02cfb98b7ff3e3..dba0212ffd3dbb 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -9,19 +9,49 @@ // To read bore about it please visit // https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000225170-ESLint-and-ts-Typescript-files +const semver = require('semver'); +const PKG = require('../../package.json'); + const typescriptEslintRecommendedRules = require('@typescript-eslint/eslint-plugin').configs.recommended.rules; const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules; module.exports = { overrides: [ { + files: ['**/*.{ts,tsx}'], parser: '@typescript-eslint/parser', + + plugins: [ + '@typescript-eslint', + 'mocha', + 'no-unsanitized', + 'prefer-object-spread', + 'jsx-a11y', + ], + + settings: { + react: { + version: semver.valid(semver.coerce(PKG.dependencies.react)), + }, + }, + + env: { + es6: true, + node: true, + mocha: true, + browser: true, + }, + parserOptions: { - ecmaFeatures: { jsx: true }, + sourceType: 'module', + ecmaVersion: 6, + ecmaFeatures: { + experimentalObjectRestSpread: true, + jsx: true + }, project: './tsconfig.json' }, - files: ['**/*.{ts,tsx}'], - plugins: ['@typescript-eslint'], + // NOTE: we can't override the extends option here to apply // all the recommend rules as it is not allowed yet // more info on: https://github.com/eslint/rfcs/pull/13 and @@ -30,42 +60,7 @@ module.exports = { // For now we are using an workaround to create // those extended rules arrays rules: Object.assign( - { - typescriptEslintRecommendedRules, - "camelcase": "off", - '@typescript-eslint/camelcase': [ 'error', { properties: 'never' } ], - "indent": "off", - '@typescript-eslint/indent': [ 'error', 2, { SwitchCase: 1 } ], - "no-unused-vars": "off", - '@typescript-eslint/no-unused-vars': [ 'error' ], - 'no-use-before-define': 'off', - '@typescript-eslint/no-use-before-define': 'off', - - "@typescript-eslint/adjacent-overload-signatures": 'off', - "@typescript-eslint/array-type": 'off', - "@typescript-eslint/ban-types": "error", - "@typescript-eslint/class-name-casing": "error", - "@typescript-eslint/explicit-function-return-type": 'off', - "@typescript-eslint/explicit-member-accessibility": 'off', - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/member-delimiter-style": "error", - "@typescript-eslint/no-angle-bracket-type-assertion": "error", - "no-array-constructor": "off", - "@typescript-eslint/no-array-constructor": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": 'off', - "@typescript-eslint/no-inferrable-types": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-non-null-assertion": 'off', - "@typescript-eslint/no-object-literal-type-assertion": "error", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-triple-slash-reference": "error", - "@typescript-eslint/no-var-requires": "offr", - "@typescript-eslint/prefer-interface": "error", - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/type-annotation-spacing": "error" - }, + {}, eslintConfigPrettierTypescriptEslintRules, ) }, From d62e27b7e5ff1d65488cf01a7d22fa991d90cb7e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 20 Mar 2019 17:41:20 +0000 Subject: [PATCH 05/36] chore(NA): split all eslint configs with overrides. --- .eslintrc.js | 483 -------------------- packages/eslint-config-kibana/.eslintrc.js | 113 +++++ packages/eslint-config-kibana/javascript.js | 370 ++++++++++++++- packages/eslint-config-kibana/typescript.js | 4 +- 4 files changed, 483 insertions(+), 487 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index efa5771344cb8f..47b47f41467544 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,37 +1,3 @@ -const { resolve } = require('path'); -const { readdirSync } = require('fs'); - -const restrictedModules = { paths: ['gulp-util'] }; - -const APACHE_2_0_LICENSE_HEADER = ` -/* - * 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 ELASTIC_LICENSE_HEADER = ` -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -`; - module.exports = { extends: [ '@elastic/eslint-config-kibana', @@ -39,453 +5,4 @@ module.exports = { '@elastic/eslint-config-kibana/typescript', '@elastic/eslint-config-kibana/jest', ], - - settings: { - 'import/resolver': { - '@kbn/eslint-import-resolver-kibana': { - forceNode: true, - }, - }, - }, - - rules: { - 'no-restricted-imports': [2, restrictedModules], - 'no-restricted-modules': [2, restrictedModules], - }, - - overrides: [ - /** - * Prettier - */ - { - files: [ - '.eslintrc.js', - 'packages/eslint-plugin-kibana-custom/**/*', - 'packages/kbn-config-schema/**/*', - 'packages/kbn-pm/**/*', - 'packages/kbn-es/**/*', - 'packages/elastic-datemath/**/*', - 'packages/kbn-i18n/**/*', - 'packages/kbn-dev-utils/**/*', - 'packages/kbn-plugin-helpers/**/*', - 'packages/kbn-plugin-generator/**/*', - 'packages/kbn-test-subj-selector/**/*', - 'packages/kbn-test/**/*', - 'packages/kbn-eslint-import-resolver-kibana/**/*', - 'src/legacy/server/saved_objects/**/*', - 'x-pack/plugins/apm/**/*', - 'x-pack/plugins/canvas/**/*', - '**/*.{ts,tsx}', - ], - plugins: ['prettier'], - rules: Object.assign( - { - 'prettier/prettier': ['error'], - }, - require('eslint-config-prettier').rules, - require('eslint-config-prettier/react').rules - ), - }, - - /** - * Allow default exports - */ - { - files: ['x-pack/test/functional/apps/**/*', 'x-pack/plugins/apm/**/*'], - rules: { - 'kibana-custom/no-default-export': 'off', - 'import/no-named-as-default': 'off', - }, - }, - - /** - * Files that are allowed to import webpack-specific stuff - */ - { - files: [ - '**/public/**', - '**/webpackShims/**', - 'packages/kbn-ui-framework/doc_site/src/**', - 'src/fixtures/**', // TODO: this directory needs to be more obviously "public" (or go away) - ], - settings: { - // instructs import/no-extraneous-dependencies to treat modules - // in plugins/ or ui/ namespace as "core modules" so they don't - // trigger failures for not being listed in package.json - 'import/core-modules': ['plugins', 'legacy/ui', 'uiExports'], - - 'import/resolver': { - '@kbn/eslint-import-resolver-kibana': { - forceNode: false, - rootPackageName: 'kibana', - kibanaPath: '.', - pluginMap: readdirSync(resolve(__dirname, 'x-pack/plugins')).reduce((acc, name) => { - if (!name.startsWith('_')) { - acc[name] = `x-pack/plugins/${name}`; - } - return acc; - }, {}), - }, - }, - }, - }, - - /** - * Files that ARE NOT allowed to use devDependencies - */ - { - files: ['packages/kbn-ui-framework/**/*', 'x-pack/**/*', 'packages/kbn-interpreter/**/*'], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: false, - peerDependencies: true, - }, - ], - }, - }, - - /** - * Files that ARE allowed to use devDependencies - */ - { - files: [ - 'packages/kbn-ui-framework/**/*.test.js', - 'packages/kbn-ui-framework/doc_site/**/*', - 'packages/kbn-ui-framework/generator-kui/**/*', - 'packages/kbn-ui-framework/Gruntfile.js', - 'packages/kbn-es/src/**/*', - 'packages/kbn-interpreter/tasks/**/*', - 'packages/kbn-interpreter/src/plugin/**/*', - 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*', - 'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*', - 'x-pack/**/*.{test,test.mocks,mock}.{js,ts,tsx}', - 'x-pack/gulpfile.js', - 'x-pack/plugins/apm/public/utils/testHelpers.js', - ], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: true, - peerDependencies: true, - }, - ], - }, - }, - - /** - * Files that run BEFORE node version check - */ - { - files: ['scripts/**/*', 'src/setup_node_env/**/*'], - rules: { - 'import/no-commonjs': 'off', - 'prefer-object-spread/prefer-object-spread': 'off', - 'no-var': 'off', - 'prefer-const': 'off', - 'prefer-destructuring': 'off', - 'no-restricted-syntax': [ - 'error', - 'ImportDeclaration', - 'ExportNamedDeclaration', - 'ExportDefaultDeclaration', - 'ExportAllDeclaration', - 'ArrowFunctionExpression', - 'AwaitExpression', - 'ClassDeclaration', - 'RestElement', - 'SpreadElement', - 'YieldExpression', - 'VariableDeclaration[kind="const"]', - 'VariableDeclaration[kind="let"]', - 'VariableDeclarator[id.type="ArrayPattern"]', - 'VariableDeclarator[id.type="ObjectPattern"]', - ], - }, - }, - - /** - * Files that run in the browser with only node-level transpilation - */ - { - files: [ - 'test/functional/services/lib/web_element_wrapper/scroll_into_view_if_necessary.js', - '**/browser_exec_scripts/**/*', - ], - rules: { - 'prefer-object-spread/prefer-object-spread': 'off', - 'no-var': 'off', - 'prefer-const': 'off', - 'prefer-destructuring': 'off', - 'no-restricted-syntax': [ - 'error', - 'ArrowFunctionExpression', - 'AwaitExpression', - 'ClassDeclaration', - 'ImportDeclaration', - 'RestElement', - 'SpreadElement', - 'YieldExpression', - 'VariableDeclaration[kind="const"]', - 'VariableDeclaration[kind="let"]', - 'VariableDeclarator[id.type="ArrayPattern"]', - 'VariableDeclarator[id.type="ObjectPattern"]', - ], - }, - }, - - /** - * Files that run AFTER node version check - * and are not also transpiled with babel - */ - { - files: [ - '.eslintrc.js', - '**/webpackShims/**/*', - 'packages/kbn-plugin-generator/**/*', - 'packages/kbn-plugin-helpers/**/*', - 'packages/kbn-eslint-import-resolver-kibana/**/*', - 'packages/kbn-eslint-plugin-license-header/**/*', - 'x-pack/gulpfile.js', - 'x-pack/dev-tools/mocha/setup_mocha.js', - 'x-pack/scripts/*', - ], - rules: { - 'import/no-commonjs': 'off', - 'prefer-object-spread/prefer-object-spread': 'off', - 'no-restricted-syntax': [ - 'error', - 'ImportDeclaration', - 'ExportNamedDeclaration', - 'ExportDefaultDeclaration', - 'ExportAllDeclaration', - ], - }, - }, - - /** - * Files that require Apache 2.0 headers, settings - * are overridden below for files that require Elastic - * Licence headers - */ - { - files: ['**/*.{js,ts,tsx}'], - plugins: ['@kbn/eslint-plugin-license-header'], - rules: { - '@kbn/license-header/require-license-header': [ - 'error', - { - license: APACHE_2_0_LICENSE_HEADER, - }, - ], - '@kbn/license-header/disallow-license-headers': [ - 'error', - { - licenses: [ELASTIC_LICENSE_HEADER], - }, - ], - }, - }, - - /** - * Files that require Elastic license headers instead of Apache 2.0 header - */ - { - files: ['x-pack/**/*.{js,ts,tsx}'], - plugins: ['@kbn/eslint-plugin-license-header'], - rules: { - '@kbn/license-header/require-license-header': [ - 'error', - { - license: ELASTIC_LICENSE_HEADER, - }, - ], - '@kbn/license-header/disallow-license-headers': [ - 'error', - { - licenses: [APACHE_2_0_LICENSE_HEADER], - }, - ], - }, - }, - - /** - * APM overrides - */ - { - files: ['x-pack/plugins/apm/**/*'], - rules: { - 'no-unused-vars': ['error', { ignoreRestSiblings: true }], - 'no-console': ['warn', { allow: ['error'] }], - }, - }, - - /** - * GIS overrides - */ - { - files: ['x-pack/plugins/maps/**/*'], - rules: { - 'react/prefer-stateless-function': [0, { ignorePureComponents: false }], - }, - }, - - /** - * Graph overrides - */ - { - files: ['x-pack/plugins/graph/**/*'], - globals: { - angular: true, - $: true, - }, - rules: { - 'block-scoped-var': 'off', - camelcase: 'off', - eqeqeq: 'off', - 'guard-for-in': 'off', - 'new-cap': 'off', - 'no-loop-func': 'off', - 'no-redeclare': 'off', - 'no-shadow': 'off', - 'no-unused-vars': 'off', - 'one-var': 'off', - }, - }, - - /** - * ML overrides - */ - { - files: ['x-pack/plugins/ml/**/*'], - rules: { - 'no-shadow': 'error', - }, - }, - - /** - * disable jsx-a11y for kbn-ui-framework - */ - { - files: ['packages/kbn-ui-framework/**'], - rules: { - 'jsx-a11y/click-events-have-key-events': 'off', - 'jsx-a11y/anchor-has-content': 'off', - 'jsx-a11y/tabindex-no-positive': 'off', - 'jsx-a11y/label-has-associated-control': 'off', - 'jsx-a11y/aria-role': 'off', - }, - }, - - /** - * Monitoring overrides - */ - { - files: ['x-pack/plugins/monitoring/**/*'], - rules: { - 'block-spacing': ['error', 'always'], - curly: ['error', 'all'], - 'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }], - 'no-else-return': 'error', - }, - }, - { - files: ['x-pack/plugins/monitoring/public/**/*'], - env: { browser: true }, - }, - - /** - * Canvas overrides - */ - { - files: ['x-pack/plugins/canvas/**/*'], - rules: { - radix: 'error', - curly: ['error', 'all'], - - // module importing - 'import/order': [ - 'error', - { - groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], - }, - ], - 'import/extensions': ['error', 'never', { json: 'always', less: 'always', svg: 'always' }], - - // react - 'react/no-did-mount-set-state': 'error', - 'react/no-did-update-set-state': 'error', - 'react/no-multi-comp': ['error', { ignoreStateless: true }], - 'react/self-closing-comp': 'error', - 'react/sort-comp': 'error', - 'react/jsx-boolean-value': 'error', - 'react/jsx-wrap-multilines': 'error', - 'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }], - 'react/forbid-elements': [ - 'error', - { - forbid: [ - { - element: 'EuiConfirmModal', - message: 'Use instead', - }, - { - element: 'EuiPopover', - message: 'Use instead', - }, - { - element: 'EuiIconTip', - message: 'Use instead', - }, - ], - }, - ], - }, - }, - { - files: [ - 'x-pack/plugins/canvas/gulpfile.js', - 'x-pack/plugins/canvas/scripts/*.js', - 'x-pack/plugins/canvas/tasks/*.js', - 'x-pack/plugins/canvas/tasks/**/*.js', - 'x-pack/plugins/canvas/__tests__/**/*', - 'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*', - ], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: true, - peerDependencies: true, - }, - ], - }, - }, - { - files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*'], - globals: { canvas: true, $: true }, - rules: { - 'import/no-unresolved': [ - 'error', - { - ignore: ['!!raw-loader.+.svg$'], - }, - ], - }, - }, - { - files: ['x-pack/plugins/canvas/public/**/*'], - env: { - browser: true, - }, - }, - { - files: ['x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*'], - env: { - jquery: true, - }, - }, - ], }; diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index e3025f5cae434a..a6dc48162dcbce 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -1,9 +1,122 @@ +const APACHE_2_0_LICENSE_HEADER = ` +/* + * 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 ELASTIC_LICENSE_HEADER = ` +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +`; + module.exports = { env: { es6: true, + node: true, + mocha: true, + browser: true, }, parserOptions: { ecmaVersion: 6, }, + + overrides: [ + /** + * Prettier + */ + { + files: [ + '.eslintrc.js', + 'packages/eslint-plugin-kibana-custom/**/*', + 'packages/kbn-config-schema/**/*', + 'packages/kbn-pm/**/*', + 'packages/kbn-es/**/*', + 'packages/elastic-datemath/**/*', + 'packages/kbn-i18n/**/*', + 'packages/kbn-dev-utils/**/*', + 'packages/kbn-plugin-helpers/**/*', + 'packages/kbn-plugin-generator/**/*', + 'packages/kbn-test-subj-selector/**/*', + 'packages/kbn-test/**/*', + 'packages/kbn-eslint-import-resolver-kibana/**/*', + 'src/legacy/server/saved_objects/**/*', + 'x-pack/plugins/apm/**/*', + 'x-pack/plugins/canvas/**/*', + '**/*.{ts,tsx}', + ], + plugins: ['prettier'], + rules: Object.assign( + { + 'prettier/prettier': ['error'], + }, + require('eslint-config-prettier').rules, + require('eslint-config-prettier/react').rules + ), + }, + + /** + * Files that require Apache 2.0 headers, settings + * are overridden below for files that require Elastic + * Licence headers + */ + { + files: ['**/*.{js,ts,tsx}'], + plugins: ['@kbn/eslint-plugin-license-header'], + rules: { + '@kbn/license-header/require-license-header': [ + 'error', + { + license: APACHE_2_0_LICENSE_HEADER, + }, + ], + '@kbn/license-header/disallow-license-headers': [ + 'error', + { + licenses: [ELASTIC_LICENSE_HEADER], + }, + ], + }, + }, + + /** + * Files that require Elastic license headers instead of Apache 2.0 header + */ + { + files: ['x-pack/**/*.{js,ts,tsx}'], + plugins: ['@kbn/eslint-plugin-license-header'], + rules: { + '@kbn/license-header/require-license-header': [ + 'error', + { + license: ELASTIC_LICENSE_HEADER, + }, + ], + '@kbn/license-header/disallow-license-headers': [ + 'error', + { + licenses: [APACHE_2_0_LICENSE_HEADER], + }, + ], + }, + }, + ], }; diff --git a/packages/eslint-config-kibana/javascript.js b/packages/eslint-config-kibana/javascript.js index fb7943e549f30d..5acf56f719eaa6 100644 --- a/packages/eslint-config-kibana/javascript.js +++ b/packages/eslint-config-kibana/javascript.js @@ -1,10 +1,15 @@ const semver = require('semver'); - +const { resolve } = require('path'); +const { readdirSync } = require('fs'); const PKG = require('../../package.json'); const RESTRICTED_GLOBALS = require('./restricted_globals'); +const RESTRICTED_MODULES = { paths: ['gulp-util'] }; module.exports = { overrides: [ + /** + * Main JS configuration + */ { files: ['**/*.js'], parser: 'babel-eslint', @@ -23,6 +28,11 @@ module.exports = { react: { version: semver.valid(semver.coerce(PKG.dependencies.react)), }, + 'import/resolver': { + '@kbn/eslint-import-resolver-kibana': { + forceNode: true, + }, + }, }, env: { @@ -76,6 +86,8 @@ module.exports = { 'no-proto': 'error', 'no-redeclare': 'error', 'no-restricted-globals': ['error', ...RESTRICTED_GLOBALS], + 'no-restricted-imports': [2, RESTRICTED_MODULES], + 'no-restricted-modules': [2, RESTRICTED_MODULES], 'no-return-assign': 'off', 'no-script-url': 'error', 'no-sequences': 'error', @@ -181,5 +193,361 @@ module.exports = { 'prefer-object-spread/prefer-object-spread': 'error', } }, + + /** + * Allow default exports + */ + { + files: ['x-pack/test/functional/apps/**/*.js', 'x-pack/plugins/apm/**/*.js'], + rules: { + 'kibana-custom/no-default-export': 'off', + 'import/no-named-as-default': 'off', + }, + }, + + /** + * Files that are allowed to import webpack-specific stuff + */ + { + files: [ + '**/public/**/*.js', + '**/webpackShims/**/*.js', + 'packages/kbn-ui-framework/doc_site/src/**/*.js', + 'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away) + ], + settings: { + // instructs import/no-extraneous-dependencies to treat modules + // in plugins/ or ui/ namespace as "core modules" so they don't + // trigger failures for not being listed in package.json + 'import/core-modules': ['plugins', 'legacy/ui', 'uiExports'], + + 'import/resolver': { + '@kbn/eslint-import-resolver-kibana': { + forceNode: false, + rootPackageName: 'kibana', + kibanaPath: '.', + pluginMap: readdirSync(resolve(__dirname, '../../x-pack/plugins')).reduce((acc, name) => { + console.log(name); + if (!name.startsWith('_')) { + acc[name] = `x-pack/plugins/${name}`; + } + return acc; + }, {}), + }, + }, + }, + }, + + /** + * Files that ARE NOT allowed to use devDependencies + */ + { + files: ['packages/kbn-ui-framework/**/*.js', 'x-pack/**/*.js', 'packages/kbn-interpreter/**/*.js'], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: false, + peerDependencies: true, + }, + ], + }, + }, + + /** + * Files that ARE allowed to use devDependencies + */ + { + files: [ + 'packages/kbn-ui-framework/**/*.test.js', + 'packages/kbn-ui-framework/doc_site/**/*.js', + 'packages/kbn-ui-framework/generator-kui/**/*.js', + 'packages/kbn-ui-framework/Gruntfile.js', + 'packages/kbn-es/src/**/*.js', + 'packages/kbn-interpreter/tasks/**/*.js', + 'packages/kbn-interpreter/src/plugin/**/*.js', + 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*.js', + 'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', + 'x-pack/**/*.test.js', + 'x-pack/gulpfile.js', + 'x-pack/plugins/apm/public/utils/testHelpers.js', + ], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + peerDependencies: true, + }, + ], + }, + }, + + /** + * Files that run BEFORE node version check + */ + { + files: ['scripts/**/*.js', 'src/setup_node_env/**/*.js'], + rules: { + 'import/no-commonjs': 'off', + 'prefer-object-spread/prefer-object-spread': 'off', + 'no-var': 'off', + 'prefer-const': 'off', + 'prefer-destructuring': 'off', + 'no-restricted-syntax': [ + 'error', + 'ImportDeclaration', + 'ExportNamedDeclaration', + 'ExportDefaultDeclaration', + 'ExportAllDeclaration', + 'ArrowFunctionExpression', + 'AwaitExpression', + 'ClassDeclaration', + 'RestElement', + 'SpreadElement', + 'YieldExpression', + 'VariableDeclaration[kind="const"]', + 'VariableDeclaration[kind="let"]', + 'VariableDeclarator[id.type="ArrayPattern"]', + 'VariableDeclarator[id.type="ObjectPattern"]', + ], + }, + }, + + /** + * Files that run in the browser with only node-level transpilation + */ + { + files: [ + 'test/functional/services/lib/web_element_wrapper/scroll_into_view_if_necessary.js', + '**/browser_exec_scripts/**/*.js', + ], + rules: { + 'prefer-object-spread/prefer-object-spread': 'off', + 'no-var': 'off', + 'prefer-const': 'off', + 'prefer-destructuring': 'off', + 'no-restricted-syntax': [ + 'error', + 'ArrowFunctionExpression', + 'AwaitExpression', + 'ClassDeclaration', + 'ImportDeclaration', + 'RestElement', + 'SpreadElement', + 'YieldExpression', + 'VariableDeclaration[kind="const"]', + 'VariableDeclaration[kind="let"]', + 'VariableDeclarator[id.type="ArrayPattern"]', + 'VariableDeclarator[id.type="ObjectPattern"]', + ], + }, + }, + + /** + * Files that run AFTER node version check + * and are not also transpiled with babel + */ + { + files: [ + '.eslintrc.js', + '**/webpackShims/**/*.js', + 'packages/kbn-plugin-generator/**/*.js', + 'packages/kbn-plugin-helpers/**/*.js', + 'packages/kbn-eslint-import-resolver-kibana/**/*.js', + 'packages/kbn-eslint-plugin-license-header/**/*.js', + 'x-pack/gulpfile.js', + 'x-pack/dev-tools/mocha/setup_mocha.js', + 'x-pack/scripts/*.js', + ], + rules: { + 'import/no-commonjs': 'off', + 'prefer-object-spread/prefer-object-spread': 'off', + 'no-restricted-syntax': [ + 'error', + 'ImportDeclaration', + 'ExportNamedDeclaration', + 'ExportDefaultDeclaration', + 'ExportAllDeclaration', + ], + }, + }, + + /** + * APM overrides + */ + { + files: ['x-pack/plugins/apm/**/*.js'], + rules: { + 'no-unused-vars': ['error', { ignoreRestSiblings: true }], + 'no-console': ['warn', { allow: ['error'] }], + }, + }, + + /** + * GIS overrides + */ + { + files: ['x-pack/plugins/maps/**/*.js'], + rules: { + 'react/prefer-stateless-function': [0, { ignorePureComponents: false }], + }, + }, + + /** + * Graph overrides + */ + { + files: ['x-pack/plugins/graph/**/*.js'], + globals: { + angular: true, + $: true, + }, + rules: { + 'block-scoped-var': 'off', + camelcase: 'off', + eqeqeq: 'off', + 'guard-for-in': 'off', + 'new-cap': 'off', + 'no-loop-func': 'off', + 'no-redeclare': 'off', + 'no-shadow': 'off', + 'no-unused-vars': 'off', + 'one-var': 'off', + }, + }, + + /** + * ML overrides + */ + { + files: ['x-pack/plugins/ml/**/*.js'], + rules: { + 'no-shadow': 'error', + }, + }, + + /** + * disable jsx-a11y for kbn-ui-framework + */ + { + files: ['packages/kbn-ui-framework/**/*.js'], + rules: { + 'jsx-a11y/click-events-have-key-events': 'off', + 'jsx-a11y/anchor-has-content': 'off', + 'jsx-a11y/tabindex-no-positive': 'off', + 'jsx-a11y/label-has-associated-control': 'off', + 'jsx-a11y/aria-role': 'off', + }, + }, + + /** + * Monitoring overrides + */ + { + files: ['x-pack/plugins/monitoring/**/*.js'], + rules: { + 'block-spacing': ['error', 'always'], + curly: ['error', 'all'], + 'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }], + 'no-else-return': 'error', + }, + }, + { + files: ['x-pack/plugins/monitoring/public/**/*.js'], + env: { browser: true }, + }, + + /** + * Canvas overrides + */ + { + files: ['x-pack/plugins/canvas/**/*.js'], + rules: { + radix: 'error', + curly: ['error', 'all'], + + // module importing + 'import/order': [ + 'error', + { + groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], + }, + ], + 'import/extensions': ['error', 'never', { json: 'always', less: 'always', svg: 'always' }], + + // react + 'react/no-did-mount-set-state': 'error', + 'react/no-did-update-set-state': 'error', + 'react/no-multi-comp': ['error', { ignoreStateless: true }], + 'react/self-closing-comp': 'error', + 'react/sort-comp': 'error', + 'react/jsx-boolean-value': 'error', + 'react/jsx-wrap-multilines': 'error', + 'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }], + 'react/forbid-elements': [ + 'error', + { + forbid: [ + { + element: 'EuiConfirmModal', + message: 'Use instead', + }, + { + element: 'EuiPopover', + message: 'Use instead', + }, + { + element: 'EuiIconTip', + message: 'Use instead', + }, + ], + }, + ], + }, + }, + { + files: [ + 'x-pack/plugins/canvas/gulpfile.js', + 'x-pack/plugins/canvas/scripts/*.js', + 'x-pack/plugins/canvas/tasks/*.js', + 'x-pack/plugins/canvas/tasks/**/*.js', + 'x-pack/plugins/canvas/__tests__/**/*.js', + 'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', + ], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + peerDependencies: true, + }, + ], + }, + }, + { + files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'], + globals: { canvas: true, $: true }, + rules: { + 'import/no-unresolved': [ + 'error', + { + ignore: ['!!raw-loader.+.svg$'], + }, + ], + }, + }, + { + files: ['x-pack/plugins/canvas/public/**/*.js'], + env: { + browser: true, + }, + }, + { + files: ['x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*.js'], + env: { + jquery: true, + }, + }, ] }; diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index dba0212ffd3dbb..c6dcb83e0190e9 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -12,7 +12,7 @@ const semver = require('semver'); const PKG = require('../../package.json'); -const typescriptEslintRecommendedRules = require('@typescript-eslint/eslint-plugin').configs.recommended.rules; +// const typescriptEslintRecommendedRules = require('@typescript-eslint/eslint-plugin').configs.recommended.rules; const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules; module.exports = { @@ -23,8 +23,6 @@ module.exports = { plugins: [ '@typescript-eslint', - 'mocha', - 'no-unsanitized', 'prefer-object-spread', 'jsx-a11y', ], From c303fb1ceff31d9eae86d1b0edda07a9dd644f0e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 20 Mar 2019 17:41:50 +0000 Subject: [PATCH 06/36] chore(NA): remove missing console.log. --- packages/eslint-config-kibana/javascript.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/eslint-config-kibana/javascript.js b/packages/eslint-config-kibana/javascript.js index 5acf56f719eaa6..15a52cde03b358 100644 --- a/packages/eslint-config-kibana/javascript.js +++ b/packages/eslint-config-kibana/javascript.js @@ -227,7 +227,6 @@ module.exports = { rootPackageName: 'kibana', kibanaPath: '.', pluginMap: readdirSync(resolve(__dirname, '../../x-pack/plugins')).reduce((acc, name) => { - console.log(name); if (!name.startsWith('_')) { acc[name] = `x-pack/plugins/${name}`; } From a44779351a62ea592c531205d60fa98a43d9c3d5 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 20 Mar 2019 18:06:32 +0000 Subject: [PATCH 07/36] chore(NA): change eslint splits and overrides order. --- .eslintrc.js | 7 +------ packages/eslint-config-kibana/.eslintrc.js | 15 +++++---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 47b47f41467544..1b3e4a8c7dabe4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,8 +1,3 @@ module.exports = { - extends: [ - '@elastic/eslint-config-kibana', - '@elastic/eslint-config-kibana/javascript', - '@elastic/eslint-config-kibana/typescript', - '@elastic/eslint-config-kibana/jest', - ], + extends: ['@elastic/eslint-config-kibana'], }; diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index a6dc48162dcbce..31e60e5bd2560f 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -28,16 +28,11 @@ const ELASTIC_LICENSE_HEADER = ` `; module.exports = { - env: { - es6: true, - node: true, - mocha: true, - browser: true, - }, - - parserOptions: { - ecmaVersion: 6, - }, + extends: [ + './javascript.js', + './typescript.js', + './jest.js', + ], overrides: [ /** From e0205caf3df0086fc776aafa28f74f4343520c5c Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 21 Mar 2019 21:17:54 +0000 Subject: [PATCH 08/36] chore(NA): replace tslint disable comments with eslint ones. --- kibana.d.ts | 2 +- .../src/tooling_log/tooling_log.d.ts | 2 +- packages/kbn-i18n/src/core/helper.test.ts | 2 +- packages/kbn-i18n/tslint.yml | 2 - packages/kbn-pm/dist/index.js | 1040 ++++++++--------- packages/kbn-pm/src/utils/log.ts | 2 +- packages/kbn-system-loader/src/system.test.ts | 2 +- .../src/system_loader.test.ts | 2 +- packages/kbn-test/types/expect.js.d.ts | 2 +- .../fatal_errors/fatal_errors_screen.tsx | 2 +- .../fatal_errors/fatal_errors_service.tsx | 4 +- src/core/server/bootstrap.ts | 2 +- src/core/server/config/config_service.test.ts | 2 +- src/core/server/config/env.ts | 2 +- src/core/server/http/ssl_config.ts | 2 +- .../console/console_appender.test.ts | 4 +- .../appenders/console/console_appender.ts | 2 +- src/core/server/root/index.ts | 2 +- src/dev/precommit_hook/casing_check_config.js | 1 - .../core_plugins/elasticsearch/index.d.ts | 12 +- src/legacy/core_plugins/interpreter/index.ts | 2 +- .../ui/public/ajax_stream/ajax_stream.test.ts | 2 +- .../saved_objects/simple_saved_object.ts | 2 +- .../search_bar/components/search_bar.tsx | 4 +- src/legacy/ui/public/utils/cidr_mask.ts | 2 +- src/legacy/ui/public/utils/decode_geo_hash.ts | 2 +- src/legacy/ui/public/utils/ipv4_address.ts | 2 +- src/legacy/ui/public/utils/memoize.ts | 2 +- src/legacy/utils/package_json.ts | 2 +- tasks/config/run.js | 9 - tasks/jenkins.js | 1 - tasks/test.js | 1 - test/functional/apps/console/_console.ts | 2 +- test/functional/apps/visualize/_tsvb_chart.ts | 2 +- .../apps/visualize/_tsvb_markdown.ts | 2 +- test/functional/apps/visualize/index.ts | 2 +- test/types/mocha_decorations.d.ts | 2 +- .../ServiceIntegrations/WatcherFlyout.tsx | 2 +- x-pack/plugins/apm/readme.md | 5 - .../apm/server/lib/helpers/setup_request.ts | 2 +- x-pack/plugins/apm/server/routes/errors.ts | 2 +- x-pack/plugins/apm/server/routes/metrics.ts | 2 +- x-pack/plugins/apm/server/routes/services.ts | 2 +- .../plugins/apm/server/routes/status_check.ts | 2 +- x-pack/plugins/apm/server/routes/traces.ts | 2 +- .../apm/server/routes/transaction_groups.ts | 2 +- .../beats_management/common/io_ts_types.ts | 4 +- .../framework/kibana_framework_adapter.ts | 4 +- .../public/pages/tag/edit.tsx | 4 +- .../beats_management/scripts/fake_env.ts | 16 +- .../elasticsearch_beat_events_adapter.ts | 2 +- .../server/lib/beat_events.ts | 4 +- .../__fixtures__/typescript/typespec_tests.ts | 6 + x-pack/plugins/infra/common/graphql/types.ts | 2 +- .../infra/common/log_entry/log_entry_list.ts | 2 +- .../log_text_stream/loading_item_view.tsx | 2 +- .../scrollable_log_text_stream_view.tsx | 2 +- x-pack/plugins/infra/public/graphql/types.ts | 2 +- .../framework/kibana_framework_adapter.ts | 2 +- .../infra/public/utils/memoize_last.ts | 2 +- .../plugins/infra/public/utils/url_state.tsx | 2 +- .../plugins/infra/scripts/combined_schema.ts | 2 +- x-pack/plugins/infra/server/graphql/types.ts | 2 +- x-pack/plugins/infra/types/rison_node.d.ts | 2 +- x-pack/plugins/task_manager/task_store.ts | 2 +- .../server/routes/cluster_checkup.test.ts | 2 +- x-pack/plugins/uptime/common/graphql/types.ts | 2 +- .../plugins/uptime/scripts/graphql_schemas.ts | 2 +- .../api_integration/apis/infra/log_entries.ts | 2 +- .../api_integration/apis/infra/log_item.ts | 2 +- .../api_integration/apis/infra/log_summary.ts | 2 +- .../apis/infra/logs_without_millis.ts | 2 +- .../api_integration/apis/infra/metadata.ts | 2 +- .../api_integration/apis/infra/metrics.ts | 2 +- .../api_integration/apis/infra/sources.ts | 2 +- .../test/api_integration/apis/infra/waffle.ts | 2 +- .../test/functional/apps/infra/home_page.ts | 2 +- x-pack/test/functional/apps/infra/index.ts | 2 +- x-pack/test/functional/apps/spaces/index.ts | 2 +- .../apps/spaces/spaces_selection.ts | 2 +- .../test/functional/apps/status_page/index.ts | 2 +- .../apps/status_page/status_page.ts | 2 +- .../apps/upgrade_assistant/index.ts | 2 +- .../upgrade_assistant/upgrade_assistant.ts | 2 +- x-pack/test/functional/apps/uptime/index.ts | 2 +- x-pack/test/functional/apps/uptime/monitor.ts | 2 +- .../test/functional/apps/uptime/overview.ts | 2 +- .../security_and_spaces/apis/bulk_create.ts | 2 +- .../security_and_spaces/apis/bulk_get.ts | 2 +- .../security_and_spaces/apis/create.ts | 2 +- .../security_and_spaces/apis/delete.ts | 2 +- .../security_and_spaces/apis/export.ts | 2 +- .../security_and_spaces/apis/find.ts | 2 +- .../security_and_spaces/apis/get.ts | 2 +- .../security_and_spaces/apis/import.ts | 2 +- .../security_and_spaces/apis/index.ts | 2 +- .../apis/resolve_import_errors.ts | 2 +- .../security_and_spaces/apis/update.ts | 2 +- .../security_and_spaces/config.ts | 2 +- .../security_only/apis/bulk_create.ts | 2 +- .../security_only/apis/bulk_get.ts | 2 +- .../security_only/apis/create.ts | 2 +- .../security_only/apis/delete.ts | 2 +- .../security_only/apis/export.ts | 2 +- .../security_only/apis/find.ts | 2 +- .../security_only/apis/get.ts | 2 +- .../security_only/apis/import.ts | 2 +- .../security_only/apis/index.ts | 2 +- .../apis/resolve_import_errors.ts | 2 +- .../security_only/apis/update.ts | 2 +- .../security_only/config.ts | 2 +- .../spaces_only/apis/bulk_create.ts | 2 +- .../spaces_only/apis/bulk_get.ts | 2 +- .../spaces_only/apis/create.ts | 2 +- .../spaces_only/apis/delete.ts | 2 +- .../spaces_only/apis/export.ts | 2 +- .../spaces_only/apis/find.ts | 2 +- .../spaces_only/apis/get.ts | 2 +- .../spaces_only/apis/import.ts | 2 +- .../spaces_only/apis/index.ts | 2 +- .../spaces_only/apis/resolve_import_errors.ts | 2 +- .../spaces_only/apis/update.ts | 2 +- .../spaces_only/config.ts | 2 +- .../security_and_spaces/apis/create.ts | 2 +- .../security_and_spaces/apis/delete.ts | 2 +- .../security_and_spaces/apis/get.ts | 2 +- .../security_and_spaces/apis/get_all.ts | 2 +- .../security_and_spaces/apis/index.ts | 2 +- .../security_and_spaces/apis/select.ts | 2 +- .../security_and_spaces/apis/update.ts | 2 +- .../security_and_spaces/config.ts | 2 +- .../spaces_only/apis/create.ts | 2 +- .../spaces_only/apis/delete.ts | 2 +- .../spaces_only/apis/get.ts | 2 +- .../spaces_only/apis/get_all.ts | 2 +- .../spaces_only/apis/index.ts | 2 +- .../spaces_only/apis/select.ts | 2 +- .../spaces_only/apis/update.ts | 2 +- .../spaces_only/config.ts | 2 +- x-pack/test/types/mocha_decorations.d.ts | 2 +- x-pack/tslint.yaml | 32 - 141 files changed, 677 insertions(+), 722 deletions(-) delete mode 100644 packages/kbn-i18n/tslint.yml delete mode 100644 x-pack/tslint.yaml diff --git a/kibana.d.ts b/kibana.d.ts index daeb9db4eaf70c..889429e4449f92 100644 --- a/kibana.d.ts +++ b/kibana.d.ts @@ -31,7 +31,7 @@ import * as LegacyKibanaServer from './src/legacy/server/kbn_server'; /** * Re-export legacy types under a namespace. */ -// tslint:disable:no-namespace +// eslint-disable @typescript/eslint-no-namespace export namespace Legacy { export type IndexPatternsService = LegacyKibanaServer.IndexPatternsService; export type KibanaConfig = LegacyKibanaServer.KibanaConfig; diff --git a/packages/kbn-dev-utils/src/tooling_log/tooling_log.d.ts b/packages/kbn-dev-utils/src/tooling_log/tooling_log.d.ts index e59524edbe0d94..672de893236c68 100644 --- a/packages/kbn-dev-utils/src/tooling_log/tooling_log.d.ts +++ b/packages/kbn-dev-utils/src/tooling_log/tooling_log.d.ts @@ -17,7 +17,7 @@ * under the License. */ -// tslint:disable max-classes-per-file +// eslint-disable max-classes-per-file import * as Rx from 'rxjs'; diff --git a/packages/kbn-i18n/src/core/helper.test.ts b/packages/kbn-i18n/src/core/helper.test.ts index ee2202dca7f0c6..cddd1f194c02b1 100644 --- a/packages/kbn-i18n/src/core/helper.test.ts +++ b/packages/kbn-i18n/src/core/helper.test.ts @@ -26,7 +26,7 @@ describe('I18n helper', () => { }); test('should return false for string object', () => { - // tslint:disable-next-line:no-construct + // eslint-disable-next-line no-construct expect(isString(new String('test'))).toBe(false); }); diff --git a/packages/kbn-i18n/tslint.yml b/packages/kbn-i18n/tslint.yml deleted file mode 100644 index e470d241339a77..00000000000000 --- a/packages/kbn-i18n/tslint.yml +++ /dev/null @@ -1,2 +0,0 @@ -extends: - - ../../tslint.yaml diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 7ba71fb12f30e4..da437dd2c583bf 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -1655,158 +1655,158 @@ convert.rgb.gray = function (rgb) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; /***/ }), @@ -4212,7 +4212,7 @@ const log = exports.log = { * @param ...args */ write(...args) { - // tslint:disable no-console + // eslint-disable no-console console.log(...args); } }; @@ -20184,192 +20184,192 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed 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 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __exportStar(m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} /***/ }), @@ -40417,169 +40417,169 @@ module.exports.namespace = namespace; /* 427 */ /***/ (function(module, exports, __webpack_require__) { - -/** - * Expose `Emitter`. - */ - -if (true) { - module.exports = Emitter; -} - -/** - * Initialize a new `Emitter`. - * - * @api public - */ - -function Emitter(obj) { - if (obj) return mixin(obj); -}; - -/** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; -} - -/** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.on = -Emitter.prototype.addEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - (this._callbacks['$' + event] = this._callbacks['$' + event] || []) - .push(fn); - return this; -}; - -/** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.once = function(event, fn){ - function on() { - this.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; -}; - -/** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.off = -Emitter.prototype.removeListener = -Emitter.prototype.removeAllListeners = -Emitter.prototype.removeEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - - // all - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - - // specific event - var callbacks = this._callbacks['$' + event]; - if (!callbacks) return this; - - // remove all handlers - if (1 == arguments.length) { - delete this._callbacks['$' + event]; - return this; - } - - // remove specific handler - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - return this; -}; - -/** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} - */ - -Emitter.prototype.emit = function(event){ - this._callbacks = this._callbacks || {}; - var args = [].slice.call(arguments, 1) - , callbacks = this._callbacks['$' + event]; - - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - - return this; -}; - -/** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public - */ - -Emitter.prototype.listeners = function(event){ - this._callbacks = this._callbacks || {}; - return this._callbacks['$' + event] || []; -}; - -/** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public - */ - -Emitter.prototype.hasListeners = function(event){ - return !! this.listeners(event).length; -}; + +/** + * Expose `Emitter`. + */ + +if (true) { + module.exports = Emitter; +} + +/** + * Initialize a new `Emitter`. + * + * @api public + */ + +function Emitter(obj) { + if (obj) return mixin(obj); +}; + +/** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; +} + +/** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.on = +Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []) + .push(fn); + return this; +}; + +/** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.once = function(event, fn){ + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; +}; + +/** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.off = +Emitter.prototype.removeListener = +Emitter.prototype.removeAllListeners = +Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + // specific event + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + return this; +}; + +/** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + +Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + var args = [].slice.call(arguments, 1) + , callbacks = this._callbacks['$' + event]; + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; +}; + +/** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + +Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; +}; + +/** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + +Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; +}; /***/ }), @@ -49795,23 +49795,23 @@ module.exports = function (encodedURI) { /* 514 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var path = __webpack_require__(16) - -"use strict" - -function urix(aPath) { - if (path.sep === "\\") { - return aPath - .replace(/\\/g, "/") - .replace(/^[a-z]:\/?/i, "/") - } - return aPath -} - -module.exports = urix +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var path = __webpack_require__(16) + +"use strict" + +function urix(aPath) { + if (path.sep === "\\") { + return aPath + .replace(/\\/g, "/") + .replace(/^[a-z]:\/?/i, "/") + } + return aPath +} + +module.exports = urix /***/ }), @@ -58577,4 +58577,4 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a const isKibanaDep = depVersion => depVersion.includes('../../kibana/'); /***/ }) -/******/ ]); \ No newline at end of file +/******/ ]); diff --git a/packages/kbn-pm/src/utils/log.ts b/packages/kbn-pm/src/utils/log.ts index 8e81e8592af47e..ed0fc9b0bbecbf 100644 --- a/packages/kbn-pm/src/utils/log.ts +++ b/packages/kbn-pm/src/utils/log.ts @@ -24,7 +24,7 @@ export const log = { * @param ...args */ write(...args: any[]) { - // tslint:disable no-console + // eslint-disable no-console console.log(...args); }, }; diff --git a/packages/kbn-system-loader/src/system.test.ts b/packages/kbn-system-loader/src/system.test.ts index d4267f82e85ae3..4e13fe409ab68f 100644 --- a/packages/kbn-system-loader/src/system.test.ts +++ b/packages/kbn-system-loader/src/system.test.ts @@ -17,7 +17,7 @@ * under the License. */ -/* tslint:disable max-classes-per-file */ +/* eslint-disable max-classes-per-file */ import { System } from './system'; import { KibanaSystem } from './system_types'; diff --git a/packages/kbn-system-loader/src/system_loader.test.ts b/packages/kbn-system-loader/src/system_loader.test.ts index c6d2beff24f34d..2ffba6853945de 100644 --- a/packages/kbn-system-loader/src/system_loader.test.ts +++ b/packages/kbn-system-loader/src/system_loader.test.ts @@ -17,7 +17,7 @@ * under the License. */ -/* tslint:disable max-classes-per-file */ +/* eslint-disable max-classes-per-file */ import { System } from './system'; import { KibanaSystemApiFactory, SystemLoader } from './system_loader'; diff --git a/packages/kbn-test/types/expect.js.d.ts b/packages/kbn-test/types/expect.js.d.ts index fd3cbd852f9675..e584f1aa723ca5 100644 --- a/packages/kbn-test/types/expect.js.d.ts +++ b/packages/kbn-test/types/expect.js.d.ts @@ -1,4 +1,4 @@ -// tslint:disable +// eslint-disable // Type definitions for expect.js 0.3.1 // Project: https://github.com/Automattic/expect.js diff --git a/src/core/public/fatal_errors/fatal_errors_screen.tsx b/src/core/public/fatal_errors/fatal_errors_screen.tsx index a139e501e44aaf..551e54d3003e43 100644 --- a/src/core/public/fatal_errors/fatal_errors_screen.tsx +++ b/src/core/public/fatal_errors/fatal_errors_screen.tsx @@ -72,7 +72,7 @@ export class FatalErrorsScreen extends React.Component { ) ).subscribe({ error(error) { - // tslint:disable-next-line no-console + // eslint-disable-next-line no-console console.error('Uncaught error in fatal error screen internals', error); }, }); diff --git a/src/core/public/fatal_errors/fatal_errors_service.tsx b/src/core/public/fatal_errors/fatal_errors_service.tsx index 0cd99f7583295a..29d70886424f6d 100644 --- a/src/core/public/fatal_errors/fatal_errors_service.tsx +++ b/src/core/public/fatal_errors/fatal_errors_service.tsx @@ -49,7 +49,7 @@ export class FatalErrorsService { ) .subscribe({ error: error => { - // tslint:disable-next-line no-console + // eslint-disable-next-line no-console console.error('Uncaught error in fatal error screen internals', error); }, }); @@ -62,7 +62,7 @@ export class FatalErrorsService { if (error instanceof Error) { // make stack traces clickable by putting whole error in the console - // tslint:disable-next-line no-console + // eslint-disable-next-line no-console console.error(error); } diff --git a/src/core/server/bootstrap.ts b/src/core/server/bootstrap.ts index d6b4c441d64f4c..eaad0544ef40de 100644 --- a/src/core/server/bootstrap.ts +++ b/src/core/server/bootstrap.ts @@ -111,7 +111,7 @@ function onRootShutdown(reason?: any) { // There is a chance that logger wasn't configured properly and error that // that forced root to shut down could go unnoticed. To prevent this we always // mirror such fatal errors in standard output with `console.error`. - // tslint:disable no-console + // eslint-disable no-console console.error(`\n${chalk.white.bgRed(' FATAL ')} ${reason}\n`); } diff --git a/src/core/server/config/config_service.test.ts b/src/core/server/config/config_service.test.ts index 7a10d4992e2c2a..2e7aa95c73b08c 100644 --- a/src/core/server/config/config_service.test.ts +++ b/src/core/server/config/config_service.test.ts @@ -17,7 +17,7 @@ * under the License. */ -/* tslint:disable max-classes-per-file */ +/* eslint-disable max-classes-per-file */ import { BehaviorSubject } from 'rxjs'; import { first } from 'rxjs/operators'; diff --git a/src/core/server/config/env.ts b/src/core/server/config/env.ts index 4ee7a778e9c8f6..430fb84e04f73e 100644 --- a/src/core/server/config/env.ts +++ b/src/core/server/config/env.ts @@ -21,7 +21,7 @@ import { resolve } from 'path'; import process from 'process'; // `require` is necessary for this to work inside x-pack code as well -// tslint:disable no-var-requires +// eslint-disable no-var-requires const pkg = require('../../../../package.json'); export interface PackageInfo { diff --git a/src/core/server/http/ssl_config.ts b/src/core/server/http/ssl_config.ts index c9b41b493c0043..1aeb6599d49146 100644 --- a/src/core/server/http/ssl_config.ts +++ b/src/core/server/http/ssl_config.ts @@ -105,7 +105,7 @@ export class SslConfig { return Array.from(protocolMap).reduce((secureOptions, [protocolAlias, secureOption]) => { // `secureOption` is the option that turns *off* support for a particular protocol, // so if protocol is supported, we should not enable this option. - // tslint:disable no-bitwise + // eslint-disable no-bitwise return supportedProtocols.includes(protocolAlias) ? secureOptions : secureOptions | secureOption; diff --git a/src/core/server/logging/appenders/console/console_appender.test.ts b/src/core/server/logging/appenders/console/console_appender.test.ts index 9763ebe19ef29c..2ae83be7461628 100644 --- a/src/core/server/logging/appenders/console/console_appender.test.ts +++ b/src/core/server/logging/appenders/console/console_appender.test.ts @@ -82,10 +82,10 @@ test('`append()` correctly formats records and pushes them to console.', () => { for (const record of records) { appender.append(record); - // tslint:disable-next-line no-console + // eslint-disable-next-line no-console expect(console.log).toHaveBeenCalledWith(`mock-${JSON.stringify(record)}`); } - // tslint:disable-next-line no-console + // eslint-disable-next-line no-console expect(console.log).toHaveBeenCalledTimes(records.length); }); diff --git a/src/core/server/logging/appenders/console/console_appender.ts b/src/core/server/logging/appenders/console/console_appender.ts index 67d0ea4d1837aa..cc9dfa2c9f1aef 100644 --- a/src/core/server/logging/appenders/console/console_appender.ts +++ b/src/core/server/logging/appenders/console/console_appender.ts @@ -46,7 +46,7 @@ export class ConsoleAppender implements DisposableAppender { * @param record `LogRecord` instance to be logged. */ public append(record: LogRecord) { - // tslint:disable no-console + // eslint-disable no-console console.log(this.layout.format(record)); } diff --git a/src/core/server/root/index.ts b/src/core/server/root/index.ts index 80ca10665b9f3f..beb5ce9e9af86f 100644 --- a/src/core/server/root/index.ts +++ b/src/core/server/root/index.ts @@ -93,7 +93,7 @@ export class Root { switchMap(() => this.configService.atPath('logging', LoggingConfig)), map(config => this.loggingService.upgrade(config)), // This specifically console.logs because we were not able to configure the logger. - // tslint:disable-next-line no-console + // eslint-disable-next-line no-console tap({ error: err => console.error('Configuring logger failed:', err) }), publishReplay(1) ) as ConnectableObservable; diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 8eb404749219a7..3af9ec21c6d579 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -41,7 +41,6 @@ export const IGNORE_FILE_GLOBS = [ '**/.*', '**/{webpackShims,__mocks__}/**/*', 'x-pack/docs/**/*', - 'src/dev/tslint/rules/*', 'src/legacy/ui/public/assets/fonts/**/*', // filename must match language code which requires capital letters diff --git a/src/legacy/core_plugins/elasticsearch/index.d.ts b/src/legacy/core_plugins/elasticsearch/index.d.ts index 9577f925453842..b212278804bc64 100644 --- a/src/legacy/core_plugins/elasticsearch/index.d.ts +++ b/src/legacy/core_plugins/elasticsearch/index.d.ts @@ -17,7 +17,7 @@ * under the License. */ -/* tslint:disable */ +/* eslint-disable */ import { Client as ESClient, GenericParams, @@ -145,7 +145,7 @@ import { TasksGetParams, TasksListParams, } from 'elasticsearch'; -/* tslint:enable */ +/* eslint-enable */ export class Cluster { public callWithRequest: CallClusterWithRequest; @@ -209,7 +209,7 @@ export interface CallClusterOptions { } export interface CallClusterWithRequest { - /* tslint:disable */ + /* eslint-disable */ (request: Request, endpoint: 'bulk', params: BulkIndexDocumentsParams, options?: CallClusterOptions): ReturnType; (request: Request, endpoint: 'clearScroll', params: ClearScrollParams, options?: CallClusterOptions): ReturnType; (request: Request, endpoint: 'count', params: CountParams, options?: CallClusterOptions): ReturnType; @@ -345,7 +345,7 @@ export interface CallClusterWithRequest { (request: Request, endpoint: 'tasks.cancel', params: TasksCancelParams, options?: CallClusterOptions): ReturnType; (request: Request, endpoint: 'tasks.get', params: TasksGetParams, options?: CallClusterOptions): ReturnType; (request: Request, endpoint: 'tasks.list', params: TasksListParams, options?: CallClusterOptions): ReturnType; - /* tslint:enable */ + /* eslint-enable */ // other APIs accessed via transport.request ( @@ -371,7 +371,7 @@ export interface CallClusterWithRequest { } export interface CallCluster { - /* tslint:disable */ + /* eslint-disable */ (endpoint: 'bulk', params: BulkIndexDocumentsParams, options?: CallClusterOptions): ReturnType; (endpoint: 'clearScroll', params: ClearScrollParams, options?: CallClusterOptions): ReturnType; (endpoint: 'count', params: CountParams, options?: CallClusterOptions): ReturnType; @@ -507,7 +507,7 @@ export interface CallCluster { (endpoint: 'tasks.cancel', params: TasksCancelParams, options?: CallClusterOptions): ReturnType; (endpoint: 'tasks.get', params: TasksGetParams, options?: CallClusterOptions): ReturnType; (endpoint: 'tasks.list', params: TasksListParams, options?: CallClusterOptions): ReturnType; - /* tslint:enable */ + /* eslint-enable */ // other APIs accessed via transport.request (endpoint: 'transport.request', clientParams: AssistantAPIClientParams, options?: {}): Promise< diff --git a/src/legacy/core_plugins/interpreter/index.ts b/src/legacy/core_plugins/interpreter/index.ts index 323c7578aa0f41..60f77ec5b5e429 100644 --- a/src/legacy/core_plugins/interpreter/index.ts +++ b/src/legacy/core_plugins/interpreter/index.ts @@ -21,7 +21,7 @@ import { resolve } from 'path'; import { Legacy } from '../../../../kibana'; import { init } from './init'; -// tslint:disable-next-line +// eslint-disable-next-line export default function InterpreterPlugin(kibana: any) { const config: Legacy.PluginSpecOptions = { id: 'interpreter', diff --git a/src/legacy/ui/public/ajax_stream/ajax_stream.test.ts b/src/legacy/ui/public/ajax_stream/ajax_stream.test.ts index 755473d1ee2373..5dcd322779c7e5 100644 --- a/src/legacy/ui/public/ajax_stream/ajax_stream.test.ts +++ b/src/legacy/ui/public/ajax_stream/ajax_stream.test.ts @@ -19,7 +19,7 @@ import { ajaxStream, XMLHttpRequestLike } from './ajax_stream'; -// tslint:disable-next-line:no-empty +// eslint-disable-next-line:no-empty function noop() {} describe('ajaxStream', () => { diff --git a/src/legacy/ui/public/saved_objects/simple_saved_object.ts b/src/legacy/ui/public/saved_objects/simple_saved_object.ts index 0d271d88162930..06e766d5f7dacf 100644 --- a/src/legacy/ui/public/saved_objects/simple_saved_object.ts +++ b/src/legacy/ui/public/saved_objects/simple_saved_object.ts @@ -34,7 +34,7 @@ import { SavedObjectsClient } from './saved_objects_client'; */ export class SimpleSavedObject { public attributes: T; - // tslint:disable-next-line variable-name We want to use the same interface this class had in JS + // eslint-disable-next-line variable-name We want to use the same interface this class had in JS public _version?: SavedObjectType['version']; public id: SavedObjectType['id']; public type: SavedObjectType['type']; diff --git a/src/legacy/ui/public/search_bar/components/search_bar.tsx b/src/legacy/ui/public/search_bar/components/search_bar.tsx index d811d3db60e410..c4a1d61b482835 100644 --- a/src/legacy/ui/public/search_bar/components/search_bar.tsx +++ b/src/legacy/ui/public/search_bar/components/search_bar.tsx @@ -91,9 +91,9 @@ class SearchBarUI extends Component { }; // member-ordering rules conflict with use-before-declaration rules - /* tslint:disable */ + /* eslint-disable */ public ro = new ResizeObserver(this.setFilterBarHeight); - /* tslint:enable */ + /* eslint-enable */ public toggleFiltersVisible = () => { this.setState({ diff --git a/src/legacy/ui/public/utils/cidr_mask.ts b/src/legacy/ui/public/utils/cidr_mask.ts index 531b5ae5412be5..c392378abd882c 100644 --- a/src/legacy/ui/public/utils/cidr_mask.ts +++ b/src/legacy/ui/public/utils/cidr_mask.ts @@ -42,7 +42,7 @@ export class CidrMask { public getRange() { const variableBits = NUM_BITS - this.prefixLength; - // tslint:disable-next-line:no-bitwise + // eslint-disable-next-line:no-bitwise const fromAddress = ((this.initialAddress.valueOf() >> variableBits) << variableBits) >>> 0; // >>> 0 coerces to unsigned const numAddresses = Math.pow(2, variableBits); return { diff --git a/src/legacy/ui/public/utils/decode_geo_hash.ts b/src/legacy/ui/public/utils/decode_geo_hash.ts index 3a6a427b4b2765..ed20b4814e404d 100644 --- a/src/legacy/ui/public/utils/decode_geo_hash.ts +++ b/src/legacy/ui/public/utils/decode_geo_hash.ts @@ -58,7 +58,7 @@ export function decodeGeoHash(geohash: number[]): Coordinates { } function refine_interval(interval: number[], cd: number, mask: number) { - if (cd & mask) { /* tslint:disable-line */ + if (cd & mask) { /* eslint-disable-line */ interval[0] = (interval[0] + interval[1]) / 2; } else { interval[1] = (interval[0] + interval[1]) / 2; diff --git a/src/legacy/ui/public/utils/ipv4_address.ts b/src/legacy/ui/public/utils/ipv4_address.ts index b8bf3917c471d1..bef008d45b30f1 100644 --- a/src/legacy/ui/public/utils/ipv4_address.ts +++ b/src/legacy/ui/public/utils/ipv4_address.ts @@ -31,7 +31,7 @@ function isIntegerInRange(integer: number, min: number, max: number) { } // eslint-disable-next-line @elastic/kibana-custom/no-default-export -// tslint:disable:no-default-export +// eslint-disable no-default-export export default class Ipv4Address { private value: number; diff --git a/src/legacy/ui/public/utils/memoize.ts b/src/legacy/ui/public/utils/memoize.ts index cf9258538bf60c..795879b578a8e9 100644 --- a/src/legacy/ui/public/utils/memoize.ts +++ b/src/legacy/ui/public/utils/memoize.ts @@ -35,7 +35,7 @@ function memoizeLast any>(func: T): T { let prevCall: MemoizedCall | NeverCalled = neverCalled; // We need to use a `function` here for proper this passing. - // tslint:disable-next-line:only-arrow-functions + // eslint-disable-next-line:only-arrow-functions const memoizedFunction = function(this: any, ...args: any[]) { if ( prevCall !== neverCalled && diff --git a/src/legacy/utils/package_json.ts b/src/legacy/utils/package_json.ts index 750dd7e2e1040b..7cc67b413922a3 100644 --- a/src/legacy/utils/package_json.ts +++ b/src/legacy/utils/package_json.ts @@ -22,6 +22,6 @@ import { dirname } from 'path'; export const pkg = { __filename: require.resolve('../../../package.json'), __dirname: dirname(require.resolve('../../../package.json')), - // tslint:disable no-var-requires + // eslint-disable no-var-requires ...require('../../../package.json'), }; diff --git a/tasks/config/run.js b/tasks/config/run.js index c4f9e91d09fcfb..4f5bb18de95ad6 100644 --- a/tasks/config/run.js +++ b/tasks/config/run.js @@ -90,15 +90,6 @@ module.exports = function (grunt) { ] }, - // used by the test and jenkins:unit tasks - // runs the tslint script to check for Typescript linting errors - tslint: { - cmd: process.execPath, - args: [ - require.resolve('../../scripts/tslint') - ] - }, - // used by the test and jenkins:unit tasks // runs the tslint script to check for Typescript linting errors typeCheck: { diff --git a/tasks/jenkins.js b/tasks/jenkins.js index 47b9429fed001f..c07dffacf6d267 100644 --- a/tasks/jenkins.js +++ b/tasks/jenkins.js @@ -24,7 +24,6 @@ module.exports = function (grunt) { grunt.registerTask('jenkins:unit', [ 'run:eslint', - 'run:tslint', 'run:sasslint', 'run:checkTsProjects', 'run:typeCheck', diff --git a/tasks/test.js b/tasks/test.js index ee6d0e87d95ad5..1858171865ec73 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -70,7 +70,6 @@ module.exports = function (grunt) { grunt.task.run( _.compact([ !grunt.option('quick') && 'run:eslint', - !grunt.option('quick') && 'run:tslint', !grunt.option('quick') && 'run:sasslint', !grunt.option('quick') && 'run:checkTsProjects', !grunt.option('quick') && 'run:typeCheck', diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index d4937962a22410..15c562522074a8 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -31,7 +31,7 @@ GET _search `.trim(); -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default function({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); const log = getService('log'); diff --git a/test/functional/apps/visualize/_tsvb_chart.ts b/test/functional/apps/visualize/_tsvb_chart.ts index 6cb5ab6807f510..be274ea995d8a6 100644 --- a/test/functional/apps/visualize/_tsvb_chart.ts +++ b/test/functional/apps/visualize/_tsvb_chart.ts @@ -20,7 +20,7 @@ import expect from 'expect.js'; import { FtrProviderContext } from '../../ftr_provider_context'; -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line:no-default-export export default function({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const log = getService('log'); diff --git a/test/functional/apps/visualize/_tsvb_markdown.ts b/test/functional/apps/visualize/_tsvb_markdown.ts index 55a5f6f79dc2b5..43dea816beca82 100644 --- a/test/functional/apps/visualize/_tsvb_markdown.ts +++ b/test/functional/apps/visualize/_tsvb_markdown.ts @@ -20,7 +20,7 @@ import expect from 'expect.js'; import { FtrProviderContext } from '../../ftr_provider_context'; -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line:no-default-export export default function({ getPageObjects }: FtrProviderContext) { const { visualBuilder, timePicker } = getPageObjects([ 'visualBuilder', diff --git a/test/functional/apps/visualize/index.ts b/test/functional/apps/visualize/index.ts index fc75dcec6f4f06..21f120c9a51d00 100644 --- a/test/functional/apps/visualize/index.ts +++ b/test/functional/apps/visualize/index.ts @@ -19,7 +19,7 @@ import { FtrProviderContext } from '../../ftr_provider_context.d'; -// tslint:disable-next-line: no-default-export +// eslint-disable-next-line: no-default-export export default function({ getService, loadTestFile }: FtrProviderContext) { const browser = getService('browser'); const log = getService('log'); diff --git a/test/types/mocha_decorations.d.ts b/test/types/mocha_decorations.d.ts index 9d9d72784b863d..c9f3b98a886cba 100644 --- a/test/types/mocha_decorations.d.ts +++ b/test/types/mocha_decorations.d.ts @@ -33,7 +33,7 @@ type Tags = | 'ciGroup11' | 'ciGroup12'; -// tslint:disable-next-line:no-namespace We need to use the namespace here to match the Mocha definition +// eslint-disable-next-line:no-namespace We need to use the namespace here to match the Mocha definition declare module 'mocha' { interface Suite { /** diff --git a/x-pack/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/WatcherFlyout.tsx b/x-pack/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/WatcherFlyout.tsx index 7b7ae1acd5e9f0..fbfffa6049d898 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/WatcherFlyout.tsx +++ b/x-pack/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/WatcherFlyout.tsx @@ -205,7 +205,7 @@ export class WatcherFlyout extends Component< this.addSuccessToast(id); }) .catch(e => { - // tslint:disable-next-line + // eslint-disable-next-line console.error(e); this.addErrorToast(); }); diff --git a/x-pack/plugins/apm/readme.md b/x-pack/plugins/apm/readme.md index 2eb425d0b82660..d82fd0050340c8 100644 --- a/x-pack/plugins/apm/readme.md +++ b/x-pack/plugins/apm/readme.md @@ -26,11 +26,6 @@ yarn prettier "./x-pack/plugins/apm/**/*.{tsx,ts,js}" --write yarn eslint ./x-pack/plugins/apm --fix ``` -### TSLint -``` -yarn tslint ./x-pack/plugins/apm/**/*.{ts,tsx} --fix -``` - ### Ensure everything from master has been backported to 6.x ``` git fetch origin && git checkout 6.x && git diff origin/6.x..origin/master ./plugins/apm | git apply diff --git a/x-pack/plugins/apm/server/lib/helpers/setup_request.ts b/x-pack/plugins/apm/server/lib/helpers/setup_request.ts index 2af6ac3e162ba7..1eabec0b216660 100644 --- a/x-pack/plugins/apm/server/lib/helpers/setup_request.ts +++ b/x-pack/plugins/apm/server/lib/helpers/setup_request.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -/* tslint:disable no-console */ +/* eslint-disable no-console */ import { AggregationSearchResponse, ESFilter, diff --git a/x-pack/plugins/apm/server/routes/errors.ts b/x-pack/plugins/apm/server/routes/errors.ts index 7db8ae4e6d84da..b8a30c007be5b7 100644 --- a/x-pack/plugins/apm/server/routes/errors.ts +++ b/x-pack/plugins/apm/server/routes/errors.ts @@ -16,7 +16,7 @@ import { setupRequest } from '../lib/helpers/setup_request'; const ROOT = '/api/apm/services/{serviceName}/errors'; const defaultErrorHandler = (err: Error) => { - // tslint:disable-next-line + // eslint-disable-next-line console.error(err.stack); throw Boom.boomify(err, { statusCode: 400 }); }; diff --git a/x-pack/plugins/apm/server/routes/metrics.ts b/x-pack/plugins/apm/server/routes/metrics.ts index f6f0161d00d477..76ba0a40077e44 100644 --- a/x-pack/plugins/apm/server/routes/metrics.ts +++ b/x-pack/plugins/apm/server/routes/metrics.ts @@ -11,7 +11,7 @@ import { setupRequest } from '../lib/helpers/setup_request'; import { getAllMetricsChartData } from '../lib/metrics/get_all_metrics_chart_data'; const defaultErrorHandler = (err: Error) => { - // tslint:disable-next-line + // eslint-disable-next-line console.error(err.stack); throw Boom.boomify(err, { statusCode: 400 }); }; diff --git a/x-pack/plugins/apm/server/routes/services.ts b/x-pack/plugins/apm/server/routes/services.ts index e1aaf18766e6f5..09ef41452c8faf 100644 --- a/x-pack/plugins/apm/server/routes/services.ts +++ b/x-pack/plugins/apm/server/routes/services.ts @@ -18,7 +18,7 @@ import { getServices } from '../lib/services/get_services'; const ROOT = '/api/apm/services'; const defaultErrorHandler = (err: Error) => { - // tslint:disable-next-line + // eslint-disable-next-line console.error(err.stack); throw Boom.boomify(err, { statusCode: 400 }); }; diff --git a/x-pack/plugins/apm/server/routes/status_check.ts b/x-pack/plugins/apm/server/routes/status_check.ts index b0d8e3bc2ddc1b..d39969cbe9e524 100644 --- a/x-pack/plugins/apm/server/routes/status_check.ts +++ b/x-pack/plugins/apm/server/routes/status_check.ts @@ -13,7 +13,7 @@ import { getServerStatus } from '../lib/status_check/server_check'; const ROOT = '/api/apm/status'; const defaultErrorHandler = (err: Error) => { - // tslint:disable-next-line + // eslint-disable-next-line console.error(err.stack); throw Boom.boomify(err, { statusCode: 400 }); }; diff --git a/x-pack/plugins/apm/server/routes/traces.ts b/x-pack/plugins/apm/server/routes/traces.ts index 7677d711f9ec63..81dbf741f925e3 100644 --- a/x-pack/plugins/apm/server/routes/traces.ts +++ b/x-pack/plugins/apm/server/routes/traces.ts @@ -13,7 +13,7 @@ import { getTrace } from '../lib/traces/get_trace'; const ROOT = '/api/apm/traces'; const defaultErrorHandler = (err: Error) => { - // tslint:disable-next-line + // eslint-disable-next-line console.error(err.stack); throw Boom.boomify(err, { statusCode: 400 }); }; diff --git a/x-pack/plugins/apm/server/routes/transaction_groups.ts b/x-pack/plugins/apm/server/routes/transaction_groups.ts index 60216b0460f658..74b8f3dc6b58a4 100644 --- a/x-pack/plugins/apm/server/routes/transaction_groups.ts +++ b/x-pack/plugins/apm/server/routes/transaction_groups.ts @@ -14,7 +14,7 @@ import { getDistribution } from '../lib/transactions/distribution'; import { getTopTransactions } from '../lib/transactions/get_top_transactions'; const defaultErrorHandler = (err: Error) => { - // tslint:disable-next-line + // eslint-disable-next-line console.error(err.stack); throw Boom.boomify(err, { statusCode: 400 }); }; diff --git a/x-pack/plugins/beats_management/common/io_ts_types.ts b/x-pack/plugins/beats_management/common/io_ts_types.ts index bc298710c72b16..51ab838ddd6c2b 100644 --- a/x-pack/plugins/beats_management/common/io_ts_types.ts +++ b/x-pack/plugins/beats_management/common/io_ts_types.ts @@ -7,7 +7,7 @@ import * as t from 'io-ts'; export class DateFromStringType extends t.Type { - // tslint:disable-next-line + // eslint-disable-next-line public readonly _tag: 'DateFromISOStringType' = 'DateFromISOStringType'; constructor() { super( @@ -27,7 +27,7 @@ export class DateFromStringType extends t.Type { ); } } -// tslint:disable-next-line +// eslint-disable-next-line export interface DateFromString extends DateFromStringType {} export const DateFromString: DateFromString = new DateFromStringType(); diff --git a/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts index f291988605f146..9500e9af4e6b06 100644 --- a/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts @@ -130,7 +130,7 @@ export class KibanaFrameworkAdapter implements FrameworkAdapter {
`, - // tslint:disable-next-line: max-classes-per-file + // eslint-disable-next-line max-classes-per-file controller: ($scope: any, $route: any) => { try { $scope.$$postDigest(() => { @@ -220,7 +220,7 @@ export class KibanaFrameworkAdapter implements FrameworkAdapter { } } -// tslint:disable-next-line: max-classes-per-file +// eslint-disable-next-line max-classes-per-file class KibanaAdapterServiceProvider { public serviceRefs: KibanaAdapterServiceRefs | null = null; public bufferedCalls: Array> = []; diff --git a/x-pack/plugins/beats_management/public/pages/tag/edit.tsx b/x-pack/plugins/beats_management/public/pages/tag/edit.tsx index 5772c9bd45c0ce..11311139f7fba4 100644 --- a/x-pack/plugins/beats_management/public/pages/tag/edit.tsx +++ b/x-pack/plugins/beats_management/public/pages/tag/edit.tsx @@ -103,7 +103,7 @@ class TagEditPageComponent extends React.PureComponent< this.props.libs.configBlocks .upsert([{ ...block, tag: this.state.tag.id }]) .catch((e: any) => { - // tslint:disable-next-line + // eslint-disable-next-line console.error('Error upseting config block', e); }) .then(() => { @@ -117,7 +117,7 @@ class TagEditPageComponent extends React.PureComponent< alert( 'Error removing block, please check your browsers console logs for more details' ); - // tslint:disable-next-line + // eslint-disable-next-line console.error(`Error removing block ${block.id}`, e); }) .then(() => { diff --git a/x-pack/plugins/beats_management/scripts/fake_env.ts b/x-pack/plugins/beats_management/scripts/fake_env.ts index cda7e71668b749..597efc3656e36e 100644 --- a/x-pack/plugins/beats_management/scripts/fake_env.ts +++ b/x-pack/plugins/beats_management/scripts/fake_env.ts @@ -46,7 +46,7 @@ const enroll = async (kibanaURL: string, token: string) => { (error: any, response: any, body: any) => { const res = JSON.parse(body); if (res.message) { - // tslint:disable-next-line + // eslint-disable-next-line console.log(res.message); } } @@ -61,7 +61,7 @@ const start = async ( ) => { try { const libs = compose(kibanaURL); - // tslint:disable-next-line + // eslint-disable-next-line console.error(`Enrolling ${numberOfBeats} fake beats...`); const enrollmentTokens = await libs.tokens.createEnrollmentTokens(numberOfBeats); @@ -81,11 +81,11 @@ const start = async ( process.stdout.write('\n'); await sleep(2000); - // tslint:disable-next-line + // eslint-disable-next-line console.error(`${numberOfBeats} fake beats are enrolled`); const beats = await libs.beats.getAll(); - // tslint:disable-next-line + // eslint-disable-next-line console.error(`Creating tags, configs, and assigning them...`); process.stdout.write(`creating tags/configs for beat... 0 of ${numberOfBeats}`); count = 0; @@ -137,16 +137,16 @@ Duo Reges: constructio interrete. Itaque his sapiens semper vacabit.`.substring( } } catch (e) { if (e.response && e.response.data && e.response.message) { - // tslint:disable-next-line + // eslint-disable-next-line console.error(e.response.data.message); } else if (e.response && e.response.data && e.response.reason) { - // tslint:disable-next-line + // eslint-disable-next-line console.error(e.response.data.reason); } else if (e.code) { - // tslint:disable-next-line + // eslint-disable-next-line console.error(e.code); } else { - // tslint:disable-next-line + // eslint-disable-next-line console.error(e); } } diff --git a/x-pack/plugins/beats_management/server/lib/adapters/events/elasticsearch_beat_events_adapter.ts b/x-pack/plugins/beats_management/server/lib/adapters/events/elasticsearch_beat_events_adapter.ts index 05e61e80c3d9f0..62759ce0f5215e 100644 --- a/x-pack/plugins/beats_management/server/lib/adapters/events/elasticsearch_beat_events_adapter.ts +++ b/x-pack/plugins/beats_management/server/lib/adapters/events/elasticsearch_beat_events_adapter.ts @@ -13,7 +13,7 @@ export class ElasticsearchBeatEventsAdapter implements BeatEventsAdapter { // @ts-ignore constructor(private readonly database: DatabaseAdapter) {} - // tslint:disable-next-line + // eslint-disable-next-line public bulkInsert = async (user: FrameworkUser, beatId: string, events: BeatEvent[]) => { // await this.database.putTemplate(INDEX_NAMES.EVENTS_TODAY, beatsIndexTemplate); }; diff --git a/x-pack/plugins/beats_management/server/lib/beat_events.ts b/x-pack/plugins/beats_management/server/lib/beat_events.ts index c8a7e1b17baf57..9a3047a2f76e3a 100644 --- a/x-pack/plugins/beats_management/server/lib/beat_events.ts +++ b/x-pack/plugins/beats_management/server/lib/beat_events.ts @@ -30,7 +30,7 @@ export class BeatEventsLib { }, }) .catch(e => { - // tslint:disable-next-line + // eslint-disable-next-line console.error('Error inserting event into beats log.', e); }); } @@ -48,7 +48,7 @@ export class BeatEventsLib { }, }) .catch(e => { - // tslint:disable-next-line + // eslint-disable-next-line console.error('Error inserting event into beats log.', e); }); } diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts b/x-pack/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts index 274e0e64ba3611..ab4cf6c1443f9d 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts +++ b/x-pack/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts @@ -1,3 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + import { select } from '../../select'; import { Json, Selector } from '../..'; diff --git a/x-pack/plugins/infra/common/graphql/types.ts b/x-pack/plugins/infra/common/graphql/types.ts index 0255262df2ac75..f9a1a516bee463 100644 --- a/x-pack/plugins/infra/common/graphql/types.ts +++ b/x-pack/plugins/infra/common/graphql/types.ts @@ -1,4 +1,4 @@ -/* tslint:disable */ +/* eslint-disable */ // ==================================================== // START: Typescript template diff --git a/x-pack/plugins/infra/common/log_entry/log_entry_list.ts b/x-pack/plugins/infra/common/log_entry/log_entry_list.ts index a546d4566fed17..0a7221d7673541 100644 --- a/x-pack/plugins/infra/common/log_entry/log_entry_list.ts +++ b/x-pack/plugins/infra/common/log_entry/log_entry_list.ts @@ -22,7 +22,7 @@ export function getIndexNearLogEntry(logEntries: LogEntryList, key: LogEntryTime let currentKey: LogEntryTime; while (minIndex < maxIndex) { - currentIndex = (minIndex + maxIndex) >>> 1; // tslint:disable-line:no-bitwise + currentIndex = (minIndex + maxIndex) >>> 1; // eslint-disable-line no-bitwise currentKey = getLogEntryKey(logEntries[currentIndex]); if ((highest ? isLessOrEqual : isLess)(currentKey, key)) { diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx index fe626ecfc8b7ea..27cee9e5730d91 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx @@ -111,7 +111,7 @@ interface ProgressEntryProps { isLoading: boolean; } -// tslint:disable-next-line:max-classes-per-file +// eslint-disable-next-line:max-classes-per-file class ProgressEntry extends React.PureComponent { public render() { const { alignment, children, className, color, isLoading } = this.props; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx index 6b114751123e2c..de8efdc3f614bf 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx @@ -209,7 +209,7 @@ class ScrollableLogTextStreamViewClass extends React.PureComponent< }; // this is actually a method but not recognized as such - // tslint:disable-next-line:member-ordering + // eslint-disable-next-line:member-ordering private handleVisibleChildrenChange = callWithoutRepeats( ({ topChild, diff --git a/x-pack/plugins/infra/public/graphql/types.ts b/x-pack/plugins/infra/public/graphql/types.ts index 0255262df2ac75..f9a1a516bee463 100644 --- a/x-pack/plugins/infra/public/graphql/types.ts +++ b/x-pack/plugins/infra/public/graphql/types.ts @@ -1,4 +1,4 @@ -/* tslint:disable */ +/* eslint-disable */ // ==================================================== // START: Typescript template diff --git a/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts index 169e9ccf73a192..7d80aaf74d5907 100644 --- a/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts @@ -151,7 +151,7 @@ export class InfraKibanaFrameworkAdapter implements InfraFrameworkAdapter { }; } -// tslint:disable-next-line: max-classes-per-file +// eslint-disable-next-line: max-classes-per-file class KibanaAdapterServiceProvider { public serviceRefs: InfraKibanaAdapterServiceRefs | null = null; public bufferedCalls: Array> = []; diff --git a/x-pack/plugins/infra/public/utils/memoize_last.ts b/x-pack/plugins/infra/public/utils/memoize_last.ts index fbab4ce22cf6e8..2352ffe251c5de 100644 --- a/x-pack/plugins/infra/public/utils/memoize_last.ts +++ b/x-pack/plugins/infra/public/utils/memoize_last.ts @@ -22,7 +22,7 @@ function memoizeLast any>(func: T): T { let prevCall: MemoizedCall | NeverCalled = neverCalled; // We need to use a `function` here for proper this passing. - // tslint:disable-next-line:only-arrow-functions + // eslint-disable-next-line:only-arrow-functions const memoizedFunction = function(this: any, ...args: any[]) { if ( prevCall !== neverCalled && diff --git a/x-pack/plugins/infra/public/utils/url_state.tsx b/x-pack/plugins/infra/public/utils/url_state.tsx index 60ee939a9e2e52..e9fa1f782b2a37 100644 --- a/x-pack/plugins/infra/public/utils/url_state.tsx +++ b/x-pack/plugins/infra/public/utils/url_state.tsx @@ -53,7 +53,7 @@ class UrlStateContainerLifecycle extends React.Component< this.handleInitialize(location); } - // tslint:disable-next-line:member-ordering this is really a method despite what tslint thinks + // eslint-disable-next-line:member-ordering this is really a method despite what tslint thinks private replaceStateInLocation = throttle(1000, (urlState: UrlState | undefined) => { const { history, location, urlStateKey } = this.props; diff --git a/x-pack/plugins/infra/scripts/combined_schema.ts b/x-pack/plugins/infra/scripts/combined_schema.ts index ec3628b2632c96..ed898743d17e38 100644 --- a/x-pack/plugins/infra/scripts/combined_schema.ts +++ b/x-pack/plugins/infra/scripts/combined_schema.ts @@ -12,5 +12,5 @@ export const schemas = [...serverSchemas]; // this default export is used to feed the combined types to the gql-gen tool // which generates the corresponding typescript types -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line:no-default-export export default buildSchemaFromTypeDefinitions(schemas); diff --git a/x-pack/plugins/infra/server/graphql/types.ts b/x-pack/plugins/infra/server/graphql/types.ts index 19436a913e091c..5ca3bdf6e65046 100644 --- a/x-pack/plugins/infra/server/graphql/types.ts +++ b/x-pack/plugins/infra/server/graphql/types.ts @@ -1,4 +1,4 @@ -/* tslint:disable */ +/* eslint-disable */ import { InfraContext } from '../lib/infra_types'; import { GraphQLResolveInfo } from 'graphql'; diff --git a/x-pack/plugins/infra/types/rison_node.d.ts b/x-pack/plugins/infra/types/rison_node.d.ts index 5448c4bcd74a9d..54a67ce492396b 100644 --- a/x-pack/plugins/infra/types/rison_node.d.ts +++ b/x-pack/plugins/infra/types/rison_node.d.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -// tslint:disable:variable-name +// eslint-disable variable-name declare module 'rison-node' { export type RisonValue = null | boolean | number | string | RisonObject | RisonArray; diff --git a/x-pack/plugins/task_manager/task_store.ts b/x-pack/plugins/task_manager/task_store.ts index dede3c7848bb1c..21db96953e1033 100644 --- a/x-pack/plugins/task_manager/task_store.ts +++ b/x-pack/plugins/task_manager/task_store.ts @@ -81,7 +81,7 @@ export class TaskStore { public readonly index: string; private callCluster: ElasticJs; private supportedTypes: string[]; - private _isInitialized = false; // tslint:disable-line:variable-name + private _isInitialized = false; // eslint-disable-line:variable-name private logger: Logger; /** diff --git a/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts b/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts index 1a436fa1b538cf..59be6b52a0d4cd 100644 --- a/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts @@ -12,7 +12,7 @@ import { EsVersionPrecheck } from '../lib/es_version_precheck'; import { registerClusterCheckupRoutes } from './cluster_checkup'; // Need to require to get mock on named export to work. -// tslint:disable:no-var-requires +// eslint-disable no-var-requires const MigrationApis = require('../lib/es_migration_apis'); MigrationApis.getUpgradeAssistantStatus = jest.fn(); diff --git a/x-pack/plugins/uptime/common/graphql/types.ts b/x-pack/plugins/uptime/common/graphql/types.ts index 07b44eafb3d98c..2a444af022f89a 100644 --- a/x-pack/plugins/uptime/common/graphql/types.ts +++ b/x-pack/plugins/uptime/common/graphql/types.ts @@ -1,4 +1,4 @@ -/* tslint:disable */ +/* eslint-disable */ // ==================================================== // START: Typescript template diff --git a/x-pack/plugins/uptime/scripts/graphql_schemas.ts b/x-pack/plugins/uptime/scripts/graphql_schemas.ts index f36f2791717a46..e6a35d4993e645 100644 --- a/x-pack/plugins/uptime/scripts/graphql_schemas.ts +++ b/x-pack/plugins/uptime/scripts/graphql_schemas.ts @@ -11,5 +11,5 @@ export const schemas = [...typeDefs]; // this default export is used to feed the combined types to the gql-gen tool // which generates the corresponding typescript types -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line no-default-export export default buildSchemaFromTypeDefinitions(schemas); diff --git a/x-pack/test/api_integration/apis/infra/log_entries.ts b/x-pack/test/api_integration/apis/infra/log_entries.ts index c2e37e5e578d51..71aaa085ec1f6f 100644 --- a/x-pack/test/api_integration/apis/infra/log_entries.ts +++ b/x-pack/test/api_integration/apis/infra/log_entries.ts @@ -244,7 +244,7 @@ const logEntriesTests: KbnTestProvider = ({ getService }) => { }); }; -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default logEntriesTests; const isSorted = (comparator: (first: Value, second: Value) => number) => ( diff --git a/x-pack/test/api_integration/apis/infra/log_item.ts b/x-pack/test/api_integration/apis/infra/log_item.ts index bfdde32fa57ae7..11489425ef83a1 100644 --- a/x-pack/test/api_integration/apis/infra/log_item.ts +++ b/x-pack/test/api_integration/apis/infra/log_item.ts @@ -171,5 +171,5 @@ const logItemTests: KbnTestProvider = ({ getService }) => { }); }; -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default logItemTests; diff --git a/x-pack/test/api_integration/apis/infra/log_summary.ts b/x-pack/test/api_integration/apis/infra/log_summary.ts index 7530ec30307945..c669fae9bc2c00 100644 --- a/x-pack/test/api_integration/apis/infra/log_summary.ts +++ b/x-pack/test/api_integration/apis/infra/log_summary.ts @@ -82,5 +82,5 @@ const logSummaryTests: KbnTestProvider = ({ getService }) => { }); }; -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default logSummaryTests; diff --git a/x-pack/test/api_integration/apis/infra/logs_without_millis.ts b/x-pack/test/api_integration/apis/infra/logs_without_millis.ts index 94301c7f427896..eadc3ce1f215ab 100644 --- a/x-pack/test/api_integration/apis/infra/logs_without_millis.ts +++ b/x-pack/test/api_integration/apis/infra/logs_without_millis.ts @@ -98,7 +98,7 @@ const logsWithoutMillisTests: KbnTestProvider = ({ getService }) => { }); }; -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default logsWithoutMillisTests; const logEntriesAroundQuery = gql` diff --git a/x-pack/test/api_integration/apis/infra/metadata.ts b/x-pack/test/api_integration/apis/infra/metadata.ts index 749c31fe2b7a3e..781a024aa2201e 100644 --- a/x-pack/test/api_integration/apis/infra/metadata.ts +++ b/x-pack/test/api_integration/apis/infra/metadata.ts @@ -69,5 +69,5 @@ const metadataTests: KbnTestProvider = ({ getService }) => { }); }; -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default metadataTests; diff --git a/x-pack/test/api_integration/apis/infra/metrics.ts b/x-pack/test/api_integration/apis/infra/metrics.ts index 52d593789e8e2a..4a3c4b448bdb84 100644 --- a/x-pack/test/api_integration/apis/infra/metrics.ts +++ b/x-pack/test/api_integration/apis/infra/metrics.ts @@ -77,5 +77,5 @@ const metricTests: KbnTestProvider = ({ getService }) => { }); }; -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default metricTests; diff --git a/x-pack/test/api_integration/apis/infra/sources.ts b/x-pack/test/api_integration/apis/infra/sources.ts index d0002e73d98755..63bfa137653648 100644 --- a/x-pack/test/api_integration/apis/infra/sources.ts +++ b/x-pack/test/api_integration/apis/infra/sources.ts @@ -339,7 +339,7 @@ const sourcesTests: KbnTestProvider = ({ getService }) => { }); }; -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default sourcesTests; const createSourceMutation = gql` diff --git a/x-pack/test/api_integration/apis/infra/waffle.ts b/x-pack/test/api_integration/apis/infra/waffle.ts index 023bdd4f7bc7a0..1adc86ce3bd75c 100644 --- a/x-pack/test/api_integration/apis/infra/waffle.ts +++ b/x-pack/test/api_integration/apis/infra/waffle.ts @@ -179,5 +179,5 @@ const waffleTests: KbnTestProvider = ({ getService }) => { }); }; -// tslint:disable-next-line no-default-export +// eslint-disable-next-line no-default-export export default waffleTests; diff --git a/x-pack/test/functional/apps/infra/home_page.ts b/x-pack/test/functional/apps/infra/home_page.ts index a36c0bac62d54e..1cd157ee04255c 100644 --- a/x-pack/test/functional/apps/infra/home_page.ts +++ b/x-pack/test/functional/apps/infra/home_page.ts @@ -9,7 +9,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; const DATE_WITH_DATA = new Date(1539806283000); const DATE_WITHOUT_DATA = new Date(1539122400000); -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line:no-default-export export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProviders) => { const esArchiver = getService('esArchiver'); const pageObjects = getPageObjects(['common', 'infraHome']); diff --git a/x-pack/test/functional/apps/infra/index.ts b/x-pack/test/functional/apps/infra/index.ts index 322aea31e1263a..908b54eb7eb652 100644 --- a/x-pack/test/functional/apps/infra/index.ts +++ b/x-pack/test/functional/apps/infra/index.ts @@ -6,7 +6,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line no-default-export export default ({ loadTestFile }: KibanaFunctionalTestDefaultProviders) => { describe('InfraOps app', function() { this.tags('ciGroup7'); diff --git a/x-pack/test/functional/apps/spaces/index.ts b/x-pack/test/functional/apps/spaces/index.ts index 7882831473b3f1..1d8f40982dd302 100644 --- a/x-pack/test/functional/apps/spaces/index.ts +++ b/x-pack/test/functional/apps/spaces/index.ts @@ -5,7 +5,7 @@ */ import { TestInvoker } from './lib/types'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function spacesApp({ loadTestFile }: TestInvoker) { describe('Spaces app', function spacesAppTestSuite() { this.tags('ciGroup4'); diff --git a/x-pack/test/functional/apps/spaces/spaces_selection.ts b/x-pack/test/functional/apps/spaces/spaces_selection.ts index 463f3a73fbc55d..139dbc890e8e76 100644 --- a/x-pack/test/functional/apps/spaces/spaces_selection.ts +++ b/x-pack/test/functional/apps/spaces/spaces_selection.ts @@ -5,7 +5,7 @@ */ import { TestInvoker } from './lib/types'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function spaceSelectorFunctonalTests({ getService, getPageObjects }: TestInvoker) { const config = getService('config'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/functional/apps/status_page/index.ts b/x-pack/test/functional/apps/status_page/index.ts index 77439f79c00506..1b929c148c06d7 100644 --- a/x-pack/test/functional/apps/status_page/index.ts +++ b/x-pack/test/functional/apps/status_page/index.ts @@ -5,7 +5,7 @@ */ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function statusPage({ loadTestFile }: KibanaFunctionalTestDefaultProviders) { describe('Status page', function statusPageTestSuite() { this.tags('ciGroup4'); diff --git a/x-pack/test/functional/apps/status_page/status_page.ts b/x-pack/test/functional/apps/status_page/status_page.ts index d72d3b55522aca..779f7958df323a 100644 --- a/x-pack/test/functional/apps/status_page/status_page.ts +++ b/x-pack/test/functional/apps/status_page/status_page.ts @@ -5,7 +5,7 @@ */ import { TestInvoker } from './lib/types'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function statusPageFunctonalTests({ getService, getPageObjects }: TestInvoker) { const esArchiver = getService('esArchiver'); const PageObjects = getPageObjects(['security', 'statusPage', 'home']); diff --git a/x-pack/test/functional/apps/upgrade_assistant/index.ts b/x-pack/test/functional/apps/upgrade_assistant/index.ts index 1d099175782ded..e3dda37064b5b8 100644 --- a/x-pack/test/functional/apps/upgrade_assistant/index.ts +++ b/x-pack/test/functional/apps/upgrade_assistant/index.ts @@ -5,7 +5,7 @@ */ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function upgradeCheckup({ loadTestFile }: KibanaFunctionalTestDefaultProviders) { describe('Upgrade checkup ', function upgradeAssistantTestSuite() { this.tags('ciGroup4'); diff --git a/x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts b/x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts index 2cff4a1d463e1c..766f94e0e4b8b7 100644 --- a/x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts +++ b/x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts @@ -6,7 +6,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function upgradeAssistantFunctionalTests({ getService, getPageObjects, diff --git a/x-pack/test/functional/apps/uptime/index.ts b/x-pack/test/functional/apps/uptime/index.ts index 3b4e0700de19db..f2e9111533953b 100644 --- a/x-pack/test/functional/apps/uptime/index.ts +++ b/x-pack/test/functional/apps/uptime/index.ts @@ -8,7 +8,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; const ARCHIVE = 'uptime/full_heartbeat'; -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line:no-default-export export default ({ loadTestFile, getService }: KibanaFunctionalTestDefaultProviders) => { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); diff --git a/x-pack/test/functional/apps/uptime/monitor.ts b/x-pack/test/functional/apps/uptime/monitor.ts index 7e1cd40d417961..ce2c319a4bd0c7 100644 --- a/x-pack/test/functional/apps/uptime/monitor.ts +++ b/x-pack/test/functional/apps/uptime/monitor.ts @@ -6,7 +6,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line:no-default-export export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProviders) => { const esArchiver = getService('esArchiver'); const pageObjects = getPageObjects(['uptime']); diff --git a/x-pack/test/functional/apps/uptime/overview.ts b/x-pack/test/functional/apps/uptime/overview.ts index 5379dd9fd68da9..abfff54bf2b2db 100644 --- a/x-pack/test/functional/apps/uptime/overview.ts +++ b/x-pack/test/functional/apps/uptime/overview.ts @@ -6,7 +6,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// tslint:disable-next-line:no-default-export +// eslint-disable-next-line:no-default-export export default ({ getPageObjects }: KibanaFunctionalTestDefaultProviders) => { // TODO: add UI functional tests const pageObjects = getPageObjects(['uptime']); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_create.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_create.ts index 1a4321ded6bb24..6983d7386752bb 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_create.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { bulkCreateTestSuiteFactory } from '../../common/suites/bulk_create'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts index 9edcd461906aa1..dbf8532333fb07 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts index bc768a8b14c4d1..44f7ac0bd0282c 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const es = getService('es'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts index ca5c6fc0dfc91c..72d54b0521f982 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/export.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/export.ts index abf488d909c1e4..b7727e892c39ed 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/export.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/export.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { exportTestSuiteFactory } from '../../common/suites/export'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts index 909d840f250527..bf79fe8af48aa4 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { findTestSuiteFactory } from '../../common/suites/find'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts index 60ba570a30436b..e5902d278cbc21 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/import.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/import.ts index f21e6f92757173..3c6e5e26e178be 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/import.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/import.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { importTestSuiteFactory } from '../../common/suites/import'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts index 44eb9d96fc98c8..18f12b432b95e8 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts @@ -7,7 +7,7 @@ import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService, loadTestFile }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/resolve_import_errors.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/resolve_import_errors.ts index db4ee0ab2806a9..34ebcf0047eff8 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/resolve_import_errors.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/resolve_import_errors.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve_import_errors'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts index 46e6cbe600d203..544b73a682d30a 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/config.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/config.ts index 81cf9d85671d18..0a7dd4d1221f5d 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/config.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/config.ts @@ -6,5 +6,5 @@ import { createTestConfig } from '../common/config'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default createTestConfig('security_and_spaces', { license: 'trial' }); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/bulk_create.ts b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_create.ts index 99d0144cbf3359..8c6fd2ce288d82 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_create.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { bulkCreateTestSuiteFactory } from '../../common/suites/bulk_create'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts index f519d76ab66181..779b8de0f55caf 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/create.ts b/x-pack/test/saved_object_api_integration/security_only/apis/create.ts index 190d04d447c463..6919960141df80 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/create.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/create.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const es = getService('es'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts b/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts index b65c98341b8ba0..24a077a851354a 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/export.ts b/x-pack/test/saved_object_api_integration/security_only/apis/export.ts index 11906cba8960b6..9ffd5590529e72 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/export.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/export.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { exportTestSuiteFactory } from '../../common/suites/export'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/find.ts b/x-pack/test/saved_object_api_integration/security_only/apis/find.ts index d44bd83bdd6389..94455ad21a3e5f 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/find.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/find.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { findTestSuiteFactory } from '../../common/suites/find'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/get.ts b/x-pack/test/saved_object_api_integration/security_only/apis/get.ts index 7efe0578a8b72e..9a641adea6af8e 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/get.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/get.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/import.ts b/x-pack/test/saved_object_api_integration/security_only/apis/import.ts index c36a192ea0423a..9c909256fa100f 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/import.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/import.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { importTestSuiteFactory } from '../../common/suites/import'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts index 6b6a3045a3790e..b4e18895955638 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts @@ -7,7 +7,7 @@ import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService, loadTestFile }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/resolve_import_errors.ts b/x-pack/test/saved_object_api_integration/security_only/apis/resolve_import_errors.ts index 70bc7755d88b94..3683a22618e3c6 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/resolve_import_errors.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/resolve_import_errors.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve_import_errors'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/update.ts b/x-pack/test/saved_object_api_integration/security_only/apis/update.ts index 2efbfe3640372c..f27dcdbbb76041 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/update.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/update.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/config.ts b/x-pack/test/saved_object_api_integration/security_only/config.ts index f71cc9207b3cc7..80faad195ec3cc 100644 --- a/x-pack/test/saved_object_api_integration/security_only/config.ts +++ b/x-pack/test/saved_object_api_integration/security_only/config.ts @@ -6,5 +6,5 @@ import { createTestConfig } from '../common/config'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default createTestConfig('security_only', { disabledPlugins: ['spaces'], license: 'trial' }); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts index cf794079a42ead..7ec563b23b08d4 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts @@ -22,7 +22,7 @@ const expectNamespaceSpecifiedBadRequest = (resp: { [key: string]: any }) => { }); }; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts index cfb4b301bccfb3..02ec5563b234c7 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts index 129023130e7160..f76940f9989c04 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts @@ -21,7 +21,7 @@ const expectNamespaceSpecifiedBadRequest = (resp: { [key: string]: any }) => { }); }; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const es = getService('es'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts index 04db10af003888..8bc30eeac58d47 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/export.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/export.ts index f060b820ae6258..a33af6516ceb3f 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/export.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/export.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { exportTestSuiteFactory } from '../../common/suites/export'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts index 4f704b3d382197..7636970855176f 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { findTestSuiteFactory } from '../../common/suites/find'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts index 012df684920455..57db7a0ed3f67c 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/import.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/import.ts index d602fc51ddd714..7b73c752f10d92 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/import.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/import.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { importTestSuiteFactory } from '../../common/suites/import'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts index 04e60c9f3ea277..8eb0a485330e2a 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts @@ -6,7 +6,7 @@ import { TestInvoker } from '../../common/lib/types'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ loadTestFile }: TestInvoker) { describe('saved objects spaces only enabled', function() { this.tags('ciGroup5'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/resolve_import_errors.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/resolve_import_errors.ts index 440f397bab4b36..2ea3b5eece36fe 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/resolve_import_errors.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/resolve_import_errors.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve_import_errors'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts index 6779ed4733ec59..a05f4751676275 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/config.ts b/x-pack/test/saved_object_api_integration/spaces_only/config.ts index 38d65bab1b107b..eeaeeaac666da2 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/config.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/config.ts @@ -6,5 +6,5 @@ import { createTestConfig } from '../common/config'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default createTestConfig('spaces_only', { license: 'basic' }); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/create.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/create.ts index 68c41b06dccb30..1ec3a543b2209b 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/create.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/create.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function createSpacesOnlySuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/delete.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/delete.ts index e28414901803cf..c48bf67b389a56 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/delete.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/delete.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function deleteSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/get.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/get.ts index dbacbd95a9b69e..347ae961b3db31 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/get.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/get.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function getSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all.ts index 48bdcfd74367c2..b6e65c205389e2 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getAllTestSuiteFactory } from '../../common/suites/get_all'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function getAllSpacesTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts index 20457aeb842d9c..5154bc485b4d54 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts @@ -7,7 +7,7 @@ import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function({ loadTestFile, getService }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/select.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/select.ts index fa0506d8801c8d..38c212fa078015 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/select.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/select.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { selectTestSuiteFactory } from '../../common/suites/select'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function selectSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/update.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/update.ts index 373a2e7be0c570..c026f6f85e03d9 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/update.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/update.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function updateSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/config.ts b/x-pack/test/spaces_api_integration/security_and_spaces/config.ts index 81cf9d85671d18..0a7dd4d1221f5d 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/config.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/config.ts @@ -6,5 +6,5 @@ import { createTestConfig } from '../common/config'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default createTestConfig('security_and_spaces', { license: 'trial' }); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/create.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/create.ts index fb01fd18527c21..bf6b82ff3e301e 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/create.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/create.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function createSpacesOnlySuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/delete.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/delete.ts index 29045a21060e78..45866e670eaaaf 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/delete.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/delete.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function deleteSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/get.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/get.ts index 8017e3c62eec8a..bebf7339a0157d 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/get.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/get.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function getSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/get_all.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/get_all.ts index 4380df0d196f9a..c3cd1729ac818a 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/get_all.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/get_all.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getAllTestSuiteFactory } from '../../common/suites/get_all'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function getAllSpacesTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/index.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/index.ts index ead6f4e7f9eac4..96b99f47d8a991 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/index.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/index.ts @@ -6,7 +6,7 @@ import { TestInvoker } from '../../common/lib/types'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function spacesOnlyTestSuite({ loadTestFile }: TestInvoker) { describe('spaces api without security', function() { this.tags('ciGroup5'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/select.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/select.ts index d7f6562c6e715b..b598567bff9219 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/select.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/select.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { selectTestSuiteFactory } from '../../common/suites/select'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function selectSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/update.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/update.ts index 649fb07c8cbdb6..37d6360d61a9f1 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/update.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/update.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default function updateSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/config.ts b/x-pack/test/spaces_api_integration/spaces_only/config.ts index 49e31da77dd741..9bef9c858ed278 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/config.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/config.ts @@ -5,5 +5,5 @@ */ import { createTestConfig } from '../common/config'; -// tslint:disable:no-default-export +// eslint-disable no-default-export export default createTestConfig('spaces_only', { license: 'basic' }); diff --git a/x-pack/test/types/mocha_decorations.d.ts b/x-pack/test/types/mocha_decorations.d.ts index 5f359c119ebb21..41a3e6bcebe3ac 100644 --- a/x-pack/test/types/mocha_decorations.d.ts +++ b/x-pack/test/types/mocha_decorations.d.ts @@ -6,7 +6,7 @@ import { Suite } from 'mocha'; -// tslint:disable-next-line:no-namespace We need to use the namespace here to match the Mocha definition +// eslint-disable-next-line:no-namespace We need to use the namespace here to match the Mocha definition declare module 'mocha' { interface Suite { /** diff --git a/x-pack/tslint.yaml b/x-pack/tslint.yaml deleted file mode 100644 index 4e41203ae9e809..00000000000000 --- a/x-pack/tslint.yaml +++ /dev/null @@ -1,32 +0,0 @@ -extends: ../tslint.yaml - -rules: - require-license-header: - - true - - |- - /* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - disallow-license-header: - - true - - |- - /* - * 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. - */ From 46b6214ca636b788e8037cdc16a2475e203aa03b Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 21 Mar 2019 21:48:33 +0000 Subject: [PATCH 09/36] chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export --- packages/kbn-test/types/expect.js.d.ts | 2 +- src/legacy/ui/public/chrome/index.d.ts | 1 + src/legacy/ui/public/routes/index.d.ts | 1 + src/legacy/ui/public/routes/route_manager.d.ts | 1 + src/legacy/ui/public/utils/ipv4_address.ts | 1 - 5 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/kbn-test/types/expect.js.d.ts b/packages/kbn-test/types/expect.js.d.ts index e584f1aa723ca5..b46b4a6988fe89 100644 --- a/packages/kbn-test/types/expect.js.d.ts +++ b/packages/kbn-test/types/expect.js.d.ts @@ -1,4 +1,4 @@ -// eslint-disable +/* eslint-disable */ // Type definitions for expect.js 0.3.1 // Project: https://github.com/Automattic/expect.js diff --git a/src/legacy/ui/public/chrome/index.d.ts b/src/legacy/ui/public/chrome/index.d.ts index e088ac0a41755b..923e78d2865508 100644 --- a/src/legacy/ui/public/chrome/index.d.ts +++ b/src/legacy/ui/public/chrome/index.d.ts @@ -49,6 +49,7 @@ declare interface Chrome extends ChromeNavLinks { declare const chrome: Chrome; +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default chrome; export { Breadcrumb } from './api/breadcrumbs'; export { NavLink } from './api/nav'; diff --git a/src/legacy/ui/public/routes/index.d.ts b/src/legacy/ui/public/routes/index.d.ts index 9e1a3bbd534eea..cae9a44676f0d5 100644 --- a/src/legacy/ui/public/routes/index.d.ts +++ b/src/legacy/ui/public/routes/index.d.ts @@ -19,5 +19,6 @@ import { uiRoutes, UIRoutes } from 'ui/routes/routes'; +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default uiRoutes; export { UIRoutes }; diff --git a/src/legacy/ui/public/routes/route_manager.d.ts b/src/legacy/ui/public/routes/route_manager.d.ts index 3b2e634226c7f2..8410932946d79b 100644 --- a/src/legacy/ui/public/routes/route_manager.d.ts +++ b/src/legacy/ui/public/routes/route_manager.d.ts @@ -38,4 +38,5 @@ interface RouteManager { defaults(path: string | RegExp, defaults: RouteConfiguration): RouteManager; } +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default RouteManager; diff --git a/src/legacy/ui/public/utils/ipv4_address.ts b/src/legacy/ui/public/utils/ipv4_address.ts index bef008d45b30f1..a58a9d8a17b85c 100644 --- a/src/legacy/ui/public/utils/ipv4_address.ts +++ b/src/legacy/ui/public/utils/ipv4_address.ts @@ -31,7 +31,6 @@ function isIntegerInRange(integer: number, min: number, max: number) { } // eslint-disable-next-line @elastic/kibana-custom/no-default-export -// eslint-disable no-default-export export default class Ipv4Address { private value: number; From e08bb56d65a4b30da63ad4017143f9d0dd0ed54f Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 21 Mar 2019 22:03:06 +0000 Subject: [PATCH 10/36] chore(NA): fixed multiple eslint typescript rule failures. --- typings/lodash.topath/index.d.ts | 3 +-- .../canvas/public/components/workpad_page/index.js | 1 + .../canvas/public/lib/aeroelastic/layout_functions.js | 1 + .../containers/logs/log_summary/log_summary.test.tsx | 2 +- .../lib/helper/__test__/get_filter_from_must.test.ts | 4 ---- .../plugins/task_manager/package.json | 10 +++++++++- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/typings/lodash.topath/index.d.ts b/typings/lodash.topath/index.d.ts index 9bd4b895251d77..3630a13f72c284 100644 --- a/typings/lodash.topath/index.d.ts +++ b/typings/lodash.topath/index.d.ts @@ -17,8 +17,7 @@ * under the License. */ - declare module 'lodash/internal/toPath' { - function toPath(value: string | string[]): string[] + function toPath(value: string | string[]): string[]; export = toPath; } diff --git a/x-pack/plugins/canvas/public/components/workpad_page/index.js b/x-pack/plugins/canvas/public/components/workpad_page/index.js index 599854f7a62814..3ddfa657c1136b 100644 --- a/x-pack/plugins/canvas/public/components/workpad_page/index.js +++ b/x-pack/plugins/canvas/public/components/workpad_page/index.js @@ -41,6 +41,7 @@ const mapDispatchToProps = dispatch => { }; }; +// eslint-disable-next-line const getRootElementId = (lookup, id) => { if (!lookup.has(id)) { return null; diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js index 6e93f9eb5fb4b6..d62fbe21fa0f04 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js +++ b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js @@ -436,6 +436,7 @@ export const applyLocalTransforms = (shapes, transformIntents) => { return shapes.map(shapeApplyLocalTransforms(transformIntents)); }; +// eslint-disable-next-line const getUpstreamTransforms = (shapes, shape) => shape.parent ? getUpstreamTransforms(shapes, shapes.find(s => s.id === shape.parent)).concat([ diff --git a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx index 8fd6155ef14b10..b65bf011422d26 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_summary/log_summary.test.tsx @@ -90,7 +90,7 @@ describe('useLogSummary hook', () => { * test case above once `act` is capable of dealing with it. */ - it('queries for new summary buckets when the source id changes', () => { + it('queries for new summary buckets when the source id changes - workaround', () => { const firstMockResponse = createMockResponse([{ start: 99000, end: 101000, entriesCount: 1 }]); const secondMockResponse = createMockResponse([{ start: 99000, end: 101000, entriesCount: 2 }]); const mockApolloClient = { diff --git a/x-pack/plugins/uptime/server/lib/helper/__test__/get_filter_from_must.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/get_filter_from_must.test.ts index 40af4634bbb912..b67fa6b2f068bd 100644 --- a/x-pack/plugins/uptime/server/lib/helper/__test__/get_filter_from_must.test.ts +++ b/x-pack/plugins/uptime/server/lib/helper/__test__/get_filter_from_must.test.ts @@ -7,10 +7,6 @@ import { getFilterFromMust } from '../get_filter_from_must'; describe('getFilterFromMust', () => { - it('applies date range only for undefined filter string', () => { - const result = getFilterFromMust('start range', 'end range'); - expect(result).toMatchSnapshot(); - }); it('applies date range only for undefined filter string', () => { const result = getFilterFromMust('start range', 'end range'); expect(result).toMatchSnapshot(); diff --git a/x-pack/test/plugin_api_integration/plugins/task_manager/package.json b/x-pack/test/plugin_api_integration/plugins/task_manager/package.json index ede03a08a2721d..ec63c512e9cd79 100644 --- a/x-pack/test/plugin_api_integration/plugins/task_manager/package.json +++ b/x-pack/test/plugin_api_integration/plugins/task_manager/package.json @@ -1,4 +1,12 @@ { "name": "sample_task_plugin", - "version": "kibana" + "version": "1.0.0", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "Apache-2.0", + "dependencies": { + "joi": "^13.5.2" + } } From d2dcd14a2ac576d42e5c3a6ccb9dfa6d059a0f97 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 21 Mar 2019 22:10:45 +0000 Subject: [PATCH 11/36] chore(NA): add tarfet folder to the eslint ignore. --- .eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintignore b/.eslintignore index f1448bf91ba032..1b375a62c4c2e1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,6 +2,7 @@ node_modules bower_components /data /build +/target /.es /plugins /optimize From 00a0d3445d14733edd3603725b6570febeeb3fbb Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 21 Mar 2019 22:12:11 +0000 Subject: [PATCH 12/36] chore(NA): apply prettier rule to ts type file. --- src/legacy/utils/streams/index.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/legacy/utils/streams/index.d.ts b/src/legacy/utils/streams/index.d.ts index c306000306c32c..b8d4c67050b2da 100644 --- a/src/legacy/utils/streams/index.d.ts +++ b/src/legacy/utils/streams/index.d.ts @@ -19,12 +19,17 @@ import { Readable, Transform, Writable, TransformOptions } from 'stream'; -export function concatStreamProviders(sourceProviders: Readable[], options: TransformOptions): Transform; +export function concatStreamProviders( + sourceProviders: Readable[], + options: TransformOptions +): Transform; export function createIntersperseStream(intersperseChunk: string | Buffer): Transform; export function createSplitStream(splitChunk: T): Transform; export function createListStream(items: any[]): Readable; export function createReduceStream(reducer: (value: any, chunk: T, enc: string) => T): Transform; -export function createPromiseFromStreams([first, ...rest]: [Readable, ...Writable[]]): Promise; +export function createPromiseFromStreams([first, ...rest]: [Readable, ...Writable[]]): Promise< + T +>; export function createConcatStream(initial: any): Transform; export function createMapStream(fn: (value: T, i: number) => void): Transform; export function createReplaceStream(toReplace: string, replacement: string | Buffer): Transform; From aa5a04f79e39cd153d45693f714a38052eca3822 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 21 Mar 2019 22:15:48 +0000 Subject: [PATCH 13/36] chore(NA): remove last mentions to tslint --- packages/eslint-config-kibana/typescript.js | 1 + tasks/config/run.js | 2 +- x-pack/plugins/infra/public/utils/url_state.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index c6dcb83e0190e9..bb22c4e8fb7c61 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -12,6 +12,7 @@ const semver = require('semver'); const PKG = require('../../package.json'); +// TODO: Apply old typescript rules // const typescriptEslintRecommendedRules = require('@typescript-eslint/eslint-plugin').configs.recommended.rules; const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules; diff --git a/tasks/config/run.js b/tasks/config/run.js index 4f5bb18de95ad6..85f23e257fce97 100644 --- a/tasks/config/run.js +++ b/tasks/config/run.js @@ -91,7 +91,7 @@ module.exports = function (grunt) { }, // used by the test and jenkins:unit tasks - // runs the tslint script to check for Typescript linting errors + // runs the typecheck script to check for Typescript type errors typeCheck: { cmd: process.execPath, args: [ diff --git a/x-pack/plugins/infra/public/utils/url_state.tsx b/x-pack/plugins/infra/public/utils/url_state.tsx index e9fa1f782b2a37..cb089a1dd081d1 100644 --- a/x-pack/plugins/infra/public/utils/url_state.tsx +++ b/x-pack/plugins/infra/public/utils/url_state.tsx @@ -53,7 +53,7 @@ class UrlStateContainerLifecycle extends React.Component< this.handleInitialize(location); } - // eslint-disable-next-line:member-ordering this is really a method despite what tslint thinks + // eslint-disable-next-line:member-ordering this is really a method despite what eslint thinks private replaceStateInLocation = throttle(1000, (urlState: UrlState | undefined) => { const { history, location, urlStateKey } = this.props; From 570b0f032e76437b94cc806df2c32fd3a702b5cb Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sun, 24 Mar 2019 04:38:38 +0000 Subject: [PATCH 14/36] chore(NA): add old defined rules --- package.json | 2 + packages/eslint-config-kibana/package.json | 2 + packages/eslint-config-kibana/typescript.js | 114 +++++++++++++++++++- yarn.lock | 14 ++- 4 files changed, 127 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ac3daf434e6ef9..f0799d2cda29ef 100644 --- a/package.json +++ b/package.json @@ -339,11 +339,13 @@ "eslint": "^5.15.3", "eslint-config-prettier": "^4.1.0", "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-ban": "^1.2.0", "eslint-plugin-import": "^2.16.0", "eslint-plugin-jest": "^22.4.1", "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", + "eslint-plugin-prefer-arrow": "^1.1.5", "eslint-plugin-prefer-object-spread": "^1.2.1", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.12.4", diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index 9f466d60f431cf..e973f20507e0a1 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -20,11 +20,13 @@ "babel-eslint": "^9.0.0", "eslint": "^5.6.0", "eslint-plugin-babel": "^5.2.0", + "eslint-plugin-ban": "^1.2.0", "eslint-plugin-jsx-a11y": "^6.1.2", "eslint-plugin-import": "^2.14.0", "eslint-plugin-jest": "^21.22.1", "eslint-plugin-mocha": "^5.2.0", "eslint-plugin-no-unsanitized": "^3.0.2", + "eslint-plugin-prefer-arrow": "^1.1.5", "eslint-plugin-prefer-object-spread": "^1.2.1", "eslint-plugin-react": "^7.11.1" } diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index bb22c4e8fb7c61..265f9c2c0d9296 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -12,8 +12,6 @@ const semver = require('semver'); const PKG = require('../../package.json'); -// TODO: Apply old typescript rules -// const typescriptEslintRecommendedRules = require('@typescript-eslint/eslint-plugin').configs.recommended.rules; const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules; module.exports = { @@ -24,8 +22,10 @@ module.exports = { plugins: [ '@typescript-eslint', - 'prefer-object-spread', + 'ban', 'jsx-a11y', + 'prefer-arrow', + 'prefer-object-spread', ], settings: { @@ -59,7 +59,113 @@ module.exports = { // For now we are using an workaround to create // those extended rules arrays rules: Object.assign( - {}, + { + // Old recommended tslint rules + '@typescript-eslint/adjacent-overload-signatures': 'error', + '@typescript-eslint/array-type': ['error', 'array-simple'], + '@typescript-eslint/ban-types': 'error', + 'camelcase': 'off', + '@typescript-eslint/camelcase': 'error', + '@typescript-eslint/class-name-casing': 'error', + '@typescript-eslint/explicit-member-accessibility': 'error', + 'indent': 'off', + '@typescript-eslint/indent': [ 'error', 2, { SwitchCase: 1 } ], + '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-interface': 'error', + '@typescript-eslint/member-ordering': 'error', + '@typescript-eslint/no-angle-bracket-type-assertion': '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/no-var-requires': 'error', + '@typescript-eslint/type-annotation-spacing': 'error', + '@typescript-eslint/unified-signatures': 'error', + 'arrow-body-style': 'error', + 'arrow-parens': 'error', + 'curly': 'error', + 'constructor-super': 'error', + 'comma-dangle': ['error', 'always-multiline'], + 'dot-notation': 'error', + 'eol-last': 'error', + 'eqeqeq': ['error', 'always', {'null': 'ignore'}], + 'guard-for-in': 'error', + 'import/order': 'error', + 'max-classes-per-file': ['error', 1], + 'max-len': [ 'error', { code: 120, ignoreComments: true, ignoreUrls: true } ], + 'new-parens': 'error', + 'no-caller': 'error', + 'no-bitwise': 'error', + 'no-cond-assign': 'error', + 'no-multiple-empty-lines': 'error', + 'no-console': 'error', + 'no-new-wrappers': 'error', + 'no-debugger': 'error', + 'no-unused-labels ': 'error', + 'no-empty': 'error', + 'no-eval': 'error', + 'no-shadow': 'error', + 'no-throw-literal': 'error', + 'no-trailing-spaces': 'error', + 'no-undef-init': 'error', + 'no-unsafe-finally': 'error', + 'no-unused-expression': 'error', + 'no-var': 'error', + 'object-curly-spacing': 'error', + 'object-shorthand': 'error', + 'one-var': 'error', + 'prefer-arrow/prefer-arrow-functions': 'error', + 'prefer-const': 'error', + 'quote-props': ['error', 'consistent-as-needed'], + 'quotes': ['error', 'double', { 'avoidEscape': true }], + 'radix': 'error', + 'semicolon': 'error', + 'space-before-function-paren': ['error', { + 'anonymous': 'never', + 'named': 'never', + 'asyncArrow': 'always' + }], + 'spaced-comment': 'error', + 'sort-keys': 'error', + 'use-isnan': 'error', + + // Old tslint yml override or defined rules + 'ban/ban': [ + 2, + {'name': ['describe', 'only'], 'message': 'No exclusive suites.'}, + {'name': ['it', 'only'], 'message': 'No exclusive tests.'}, + {'name': ['test', 'only'], 'message': 'No exclusive tests.'}, + + ], + 'jsx-a11y/accessible-emoji': 'error', + 'jsx-a11y/alt-text': 'error', + 'jsx-a11y/anchor-has-content': 'error', + 'jsx-a11y/aria-activedescendant-has-tabindex': 'error', + 'jsx-a11y/aria-props': 'error', + 'jsx-a11y/aria-proptypes': 'error', + 'jsx-a11y/aria-role': 'error', + 'jsx-a11y/aria-unsupported-elements': 'error', + 'jsx-a11y/click-events-have-key-events': 'error', + 'jsx-a11y/heading-has-content': 'error', + 'jsx-a11y/html-has-lang': 'error', + 'jsx-a11y/iframe-has-title': 'error', + 'jsx-a11y/interactive-supports-focus': 'error', + 'jsx-a11y/media-has-caption': 'error', + 'jsx-a11y/mouse-events-have-key-events': 'error', + 'jsx-a11y/no-access-key': 'error', + 'jsx-a11y/no-distracting-elements': 'error', + 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error', + 'jsx-a11y/no-noninteractive-element-interactions': 'error', + 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error', + 'jsx-a11y/no-onchange': 'error', + 'jsx-a11y/no-redundant-roles': 'error', + 'jsx-a11y/role-has-required-aria-props': 'error', + 'jsx-a11y/role-supports-aria-props': 'error', + 'jsx-a11y/scope': 'error', + 'jsx-a11y/tabindex-no-positive': 'error', + 'jsx-a11y/label-has-associated-control': 'error', + 'kibana-custom/no-default-export': 'error', + }, eslintConfigPrettierTypescriptEslintRules, ) }, diff --git a/yarn.lock b/yarn.lock index 00f356d8be4884..bab159b8d6f919 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9219,6 +9219,13 @@ eslint-plugin-babel@^5.3.0: dependencies: eslint-rule-composer "^0.3.0" +eslint-plugin-ban@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-ban/-/eslint-plugin-ban-1.2.0.tgz#d65867ffcca542465004ad07d51d1c635a8514dc" + integrity sha512-UKdGRnKnaTo8dFnLYEgErBBmcDW1p/OtqFDdYz4a1QBduJpJFSNllz06psu53YMBShVK5bLGg798/E9LGf1bog== + dependencies: + requireindex "~1.2.0" + eslint-plugin-import@^2.16.0: version "2.16.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f" @@ -9266,6 +9273,11 @@ eslint-plugin-no-unsanitized@^3.0.2: resolved "https://registry.yarnpkg.com/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-3.0.2.tgz#83c6fcf8e34715112757e03dd4ee436dce29ed45" integrity sha512-JnwpoH8Sv4QOjrTDutENBHzSnyYtspdjtglYtqUtAHe6f6LLKqykJle+UwFPg23GGwt5hI3amS9CRDezW8GAww== +eslint-plugin-prefer-arrow@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.1.5.tgz#ad2b91b126eb208547da7af9e9719b3598a5a063" + integrity sha512-vjwd/I3R0jjMbzjMxaekzHz5/ohTLparvxtW5f/7tAXvM8h4/z/C4HR6l7qv5e0JnYRSTfyzad0OiJxlnI1bBw== + eslint-plugin-prefer-object-spread@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-object-spread/-/eslint-plugin-prefer-object-spread-1.2.1.tgz#27fb91853690cceb3ae6101d9c8aecc6a67a402c" @@ -20387,7 +20399,7 @@ requirefresh@^2.0.0: dependencies: editions "^1.1.1" -requireindex@^1.2.0: +requireindex@^1.2.0, requireindex@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== From 72c00c9340a589b109ed6e91171e9b6c5caa74f4 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sun, 24 Mar 2019 04:39:41 +0000 Subject: [PATCH 15/36] chore(NA): missing port rules website --- packages/eslint-config-kibana/typescript.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 265f9c2c0d9296..c97d3c4c805d59 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -60,6 +60,9 @@ module.exports = { // those extended rules arrays rules: Object.assign( { + // Most of the ports were done according + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/ROADMAP.md + // // Old recommended tslint rules '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/array-type': ['error', 'array-simple'], From ecaba30f4abcfac3eeb19844c44177fd8f09e44f Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sun, 24 Mar 2019 04:43:25 +0000 Subject: [PATCH 16/36] chore(na): ordered rules --- packages/eslint-config-kibana/typescript.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index c97d3c4c805d59..4768d810ec6109 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -86,9 +86,9 @@ module.exports = { '@typescript-eslint/unified-signatures': 'error', 'arrow-body-style': 'error', 'arrow-parens': 'error', - 'curly': 'error', - 'constructor-super': 'error', 'comma-dangle': ['error', 'always-multiline'], + 'constructor-super': 'error', + 'curly': 'error', 'dot-notation': 'error', 'eol-last': 'error', 'eqeqeq': ['error', 'always', {'null': 'ignore'}], @@ -97,39 +97,39 @@ module.exports = { 'max-classes-per-file': ['error', 1], 'max-len': [ 'error', { code: 120, ignoreComments: true, ignoreUrls: true } ], 'new-parens': 'error', - 'no-caller': 'error', 'no-bitwise': 'error', + 'no-caller': 'error', 'no-cond-assign': 'error', - 'no-multiple-empty-lines': 'error', 'no-console': 'error', - 'no-new-wrappers': 'error', 'no-debugger': 'error', - 'no-unused-labels ': 'error', 'no-empty': 'error', 'no-eval': 'error', + 'no-multiple-empty-lines': 'error', + 'no-new-wrappers': 'error', 'no-shadow': 'error', 'no-throw-literal': 'error', 'no-trailing-spaces': 'error', 'no-undef-init': 'error', 'no-unsafe-finally': 'error', 'no-unused-expression': 'error', + 'no-unused-labels ': 'error', 'no-var': 'error', 'object-curly-spacing': 'error', 'object-shorthand': 'error', 'one-var': 'error', 'prefer-arrow/prefer-arrow-functions': 'error', 'prefer-const': 'error', - 'quote-props': ['error', 'consistent-as-needed'], 'quotes': ['error', 'double', { 'avoidEscape': true }], + 'quote-props': ['error', 'consistent-as-needed'], 'radix': 'error', 'semicolon': 'error', + 'sort-keys': 'error', 'space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }], 'spaced-comment': 'error', - 'sort-keys': 'error', 'use-isnan': 'error', // Old tslint yml override or defined rules From adcc2000937128179ec33e38c33d87931e6f164f Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 25 Mar 2019 20:43:51 +0000 Subject: [PATCH 17/36] chore(NA): solved eslint typescript problems. --- kibana.d.ts | 2 +- package.json | 4 +-- packages/elastic-datemath/src/index.d.ts | 1 + packages/eslint-config-kibana/package.json | 18 +++++----- packages/eslint-config-kibana/typescript.js | 34 ++++++++++--------- packages/kbn-i18n/src/core/helper.test.ts | 2 +- packages/kbn-pm/src/utils/log.ts | 2 +- packages/kbn-test-subj-selector/index.d.ts | 1 + src/core/server/bootstrap.ts | 2 +- .../server/http/https_redirect_server.test.ts | 1 + src/core/server/http/ssl_config.ts | 3 +- .../appenders/console/console_appender.ts | 2 +- .../core_plugins/elasticsearch/index.d.ts | 4 +-- .../panel_options_menu_container.ts | 1 + src/legacy/server/kbn_server.d.ts | 1 + .../core/migration_coordinator.test.ts | 1 + .../ui/public/ajax_stream/ajax_stream.test.ts | 2 +- .../public/query_bar/components/query_bar.tsx | 2 +- .../typeahead/suggestion_component.tsx | 1 + src/legacy/ui/public/timefilter/get_time.ts | 3 +- src/legacy/ui/public/utils/cidr_mask.ts | 2 +- src/legacy/ui/public/utils/memoize.ts | 2 +- .../public/utils/subscribe_with_scope.test.ts | 1 + test/functional/apps/console/_console.ts | 2 +- test/functional/apps/visualize/_tsvb_chart.ts | 2 +- .../apps/visualize/_tsvb_markdown.ts | 2 +- test/functional/apps/visualize/index.ts | 2 +- test/types/mocha_decorations.d.ts | 3 +- typings/index.d.ts | 1 + x-pack/plugins/apm/typings/global_types.d.ts | 1 + x-pack/plugins/apm/typings/numeral.d.ts | 1 + .../framework/kibana_framework_adapter.ts | 2 +- .../__tests__/beats_assignments.test.ts | 4 +-- .../beats_management/types/formsy.d.ts | 1 + .../log_text_stream/loading_item_view.tsx | 3 +- .../scrollable_log_text_stream_view.tsx | 2 +- .../framework/kibana_framework_adapter.ts | 3 +- .../infra/public/utils/memoize_last.ts | 2 +- .../plugins/infra/public/utils/url_state.tsx | 2 +- .../plugins/infra/scripts/combined_schema.ts | 2 +- .../plugins/infra/types/graphql_fields.d.ts | 1 + .../basic_login_form.test.tsx | 1 + .../components/login_page/login_page.test.tsx | 1 + x-pack/plugins/task_manager/task_store.ts | 2 +- .../server/lib/reindexing/reindex_service.ts | 2 +- .../plugins/uptime/scripts/graphql_schemas.ts | 2 +- .../api_integration/apis/infra/log_entries.ts | 2 +- .../api_integration/apis/infra/log_item.ts | 2 +- .../api_integration/apis/infra/log_summary.ts | 2 +- .../apis/infra/logs_without_millis.ts | 2 +- .../api_integration/apis/infra/metadata.ts | 2 +- .../api_integration/apis/infra/metrics.ts | 2 +- .../api_integration/apis/infra/sources.ts | 2 +- .../test/api_integration/apis/infra/waffle.ts | 2 +- .../test/functional/apps/infra/home_page.ts | 2 +- x-pack/test/functional/apps/infra/index.ts | 2 +- x-pack/test/functional/apps/spaces/index.ts | 2 +- .../apps/spaces/spaces_selection.ts | 2 +- .../test/functional/apps/status_page/index.ts | 2 +- .../apps/status_page/status_page.ts | 2 +- .../apps/upgrade_assistant/index.ts | 2 +- .../upgrade_assistant/upgrade_assistant.ts | 2 +- x-pack/test/functional/apps/uptime/index.ts | 2 +- x-pack/test/functional/apps/uptime/monitor.ts | 2 +- .../test/functional/apps/uptime/overview.ts | 2 +- .../security_and_spaces/apis/bulk_create.ts | 2 +- .../security_and_spaces/apis/bulk_get.ts | 2 +- .../security_and_spaces/apis/create.ts | 2 +- .../security_and_spaces/apis/delete.ts | 2 +- .../security_and_spaces/apis/export.ts | 3 +- .../security_and_spaces/apis/find.ts | 2 +- .../security_and_spaces/apis/get.ts | 2 +- .../security_and_spaces/apis/import.ts | 2 +- .../security_and_spaces/apis/index.ts | 2 +- .../apis/resolve_import_errors.ts | 2 +- .../security_and_spaces/apis/update.ts | 2 +- .../security_and_spaces/config.ts | 2 +- .../security_only/apis/bulk_create.ts | 2 +- .../security_only/apis/bulk_get.ts | 2 +- .../security_only/apis/create.ts | 2 +- .../security_only/apis/delete.ts | 2 +- .../security_only/apis/export.ts | 2 +- .../security_only/apis/find.ts | 2 +- .../security_only/apis/get.ts | 2 +- .../security_only/apis/import.ts | 2 +- .../security_only/apis/index.ts | 2 +- .../apis/resolve_import_errors.ts | 2 +- .../security_only/apis/update.ts | 2 +- .../security_only/config.ts | 2 +- .../spaces_only/apis/bulk_create.ts | 2 +- .../spaces_only/apis/bulk_get.ts | 2 +- .../spaces_only/apis/create.ts | 2 +- .../spaces_only/apis/delete.ts | 2 +- .../spaces_only/apis/export.ts | 2 +- .../spaces_only/apis/find.ts | 2 +- .../spaces_only/apis/get.ts | 2 +- .../spaces_only/apis/import.ts | 2 +- .../spaces_only/apis/index.ts | 2 +- .../spaces_only/apis/resolve_import_errors.ts | 2 +- .../spaces_only/apis/update.ts | 2 +- .../spaces_only/config.ts | 2 +- .../security_and_spaces/apis/create.ts | 2 +- .../security_and_spaces/apis/delete.ts | 2 +- .../security_and_spaces/apis/get.ts | 2 +- .../security_and_spaces/apis/get_all.ts | 2 +- .../security_and_spaces/apis/index.ts | 2 +- .../security_and_spaces/apis/select.ts | 2 +- .../security_and_spaces/apis/update.ts | 2 +- .../security_and_spaces/config.ts | 2 +- .../spaces_only/apis/create.ts | 2 +- .../spaces_only/apis/delete.ts | 2 +- .../spaces_only/apis/get.ts | 2 +- .../spaces_only/apis/get_all.ts | 2 +- .../spaces_only/apis/index.ts | 2 +- .../spaces_only/apis/select.ts | 2 +- .../spaces_only/apis/update.ts | 2 +- .../spaces_only/config.ts | 2 +- x-pack/test/types/mocha_decorations.d.ts | 2 +- x-pack/typings/index.d.ts | 1 + yarn.lock | 30 ++++++++-------- 120 files changed, 164 insertions(+), 148 deletions(-) diff --git a/kibana.d.ts b/kibana.d.ts index 889429e4449f92..7a39e1524cda98 100644 --- a/kibana.d.ts +++ b/kibana.d.ts @@ -31,7 +31,7 @@ import * as LegacyKibanaServer from './src/legacy/server/kbn_server'; /** * Re-export legacy types under a namespace. */ -// eslint-disable @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 f0799d2cda29ef..836cbb6e30690f 100644 --- a/package.json +++ b/package.json @@ -317,8 +317,8 @@ "@types/type-detect": "^4.0.1", "@types/uuid": "^3.4.4", "@types/zen-observable": "^0.8.0", - "@typescript-eslint/eslint-plugin": "^1.4.2", - "@typescript-eslint/parser": "^1.4.2", + "@typescript-eslint/eslint-plugin": "^1.5.0", + "@typescript-eslint/parser": "^1.5.0", "angular-mocks": "1.4.7", "archiver": "^3.0.0", "babel-eslint": "^9.0.0", diff --git a/packages/elastic-datemath/src/index.d.ts b/packages/elastic-datemath/src/index.d.ts index 528b1620bc1a45..66a137e46f4ca9 100644 --- a/packages/elastic-datemath/src/index.d.ts +++ b/packages/elastic-datemath/src/index.d.ts @@ -47,4 +47,5 @@ declare const datemath: { ): moment.Moment | undefined; }; +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default datemath; diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index e973f20507e0a1..bac0d900bd323e 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.4.2", - "@typescript-eslint/parser": "^1.4.2", + "@typescript-eslint/eslint-plugin": "^1.5.0", + "@typescript-eslint/parser": "^1.5.0", "babel-eslint": "^9.0.0", - "eslint": "^5.6.0", - "eslint-plugin-babel": "^5.2.0", + "eslint": "^5.15.3", + "eslint-plugin-babel": "^5.3.0", "eslint-plugin-ban": "^1.2.0", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jest": "^21.22.1", - "eslint-plugin-mocha": "^5.2.0", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-import": "^2.16.0", + "eslint-plugin-jest": "^22.4.1", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-arrow": "^1.1.5", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-react": "^7.11.1" + "eslint-plugin-react": "^7.12.4" } } diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 4768d810ec6109..b61b6b0c552e50 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -23,9 +23,11 @@ module.exports = { plugins: [ '@typescript-eslint', 'ban', + 'import', 'jsx-a11y', 'prefer-arrow', 'prefer-object-spread', + '@elastic/kibana-custom' ], settings: { @@ -68,22 +70,22 @@ module.exports = { '@typescript-eslint/array-type': ['error', 'array-simple'], '@typescript-eslint/ban-types': 'error', 'camelcase': 'off', - '@typescript-eslint/camelcase': 'error', + // '@typescript-eslint/camelcase': 'error', '@typescript-eslint/class-name-casing': 'error', - '@typescript-eslint/explicit-member-accessibility': 'error', + // '@typescript-eslint/explicit-member-accessibility': 'error', 'indent': 'off', '@typescript-eslint/indent': [ 'error', 2, { SwitchCase: 1 } ], - '@typescript-eslint/prefer-function-type': 'error', + // '@typescript-eslint/prefer-function-type': 'error', '@typescript-eslint/prefer-interface': 'error', - '@typescript-eslint/member-ordering': 'error', + // '@typescript-eslint/member-ordering': 'error', '@typescript-eslint/no-angle-bracket-type-assertion': 'error', - '@typescript-eslint/no-empty-interface': '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/no-var-requires': 'error', + // '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/type-annotation-spacing': 'error', - '@typescript-eslint/unified-signatures': 'error', + // '@typescript-eslint/unified-signatures': 'error', 'arrow-body-style': 'error', 'arrow-parens': 'error', 'comma-dangle': ['error', 'always-multiline'], @@ -93,7 +95,7 @@ module.exports = { 'eol-last': 'error', 'eqeqeq': ['error', 'always', {'null': 'ignore'}], 'guard-for-in': 'error', - 'import/order': 'error', + // 'import/order': 'error', 'max-classes-per-file': ['error', 1], 'max-len': [ 'error', { code: 120, ignoreComments: true, ignoreUrls: true } ], 'new-parens': 'error', @@ -111,25 +113,25 @@ module.exports = { 'no-trailing-spaces': 'error', 'no-undef-init': 'error', 'no-unsafe-finally': 'error', - 'no-unused-expression': 'error', - 'no-unused-labels ': 'error', + 'no-unused-expressions': 'error', + 'no-unused-labels': 'error', 'no-var': 'error', 'object-curly-spacing': 'error', 'object-shorthand': 'error', - 'one-var': 'error', - 'prefer-arrow/prefer-arrow-functions': 'error', + // 'one-var': 'error', + // 'prefer-arrow/prefer-arrow-functions': 'error', 'prefer-const': 'error', 'quotes': ['error', 'double', { 'avoidEscape': true }], 'quote-props': ['error', 'consistent-as-needed'], 'radix': 'error', - 'semicolon': 'error', - 'sort-keys': 'error', + 'semi': 'error', + // 'sort-keys': 'error', 'space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }], - 'spaced-comment': 'error', + // 'spaced-comment': 'error', 'use-isnan': 'error', // Old tslint yml override or defined rules @@ -167,7 +169,7 @@ module.exports = { 'jsx-a11y/scope': 'error', 'jsx-a11y/tabindex-no-positive': 'error', 'jsx-a11y/label-has-associated-control': 'error', - 'kibana-custom/no-default-export': 'error', + '@elastic/kibana-custom/no-default-export': 'error', }, eslintConfigPrettierTypescriptEslintRules, ) diff --git a/packages/kbn-i18n/src/core/helper.test.ts b/packages/kbn-i18n/src/core/helper.test.ts index cddd1f194c02b1..6031a3d9914ad9 100644 --- a/packages/kbn-i18n/src/core/helper.test.ts +++ b/packages/kbn-i18n/src/core/helper.test.ts @@ -26,7 +26,7 @@ describe('I18n helper', () => { }); test('should return false for string object', () => { - // eslint-disable-next-line no-construct + // eslint-disable-next-line no-new-wrappers expect(isString(new String('test'))).toBe(false); }); diff --git a/packages/kbn-pm/src/utils/log.ts b/packages/kbn-pm/src/utils/log.ts index ed0fc9b0bbecbf..45ad08b8a24a06 100644 --- a/packages/kbn-pm/src/utils/log.ts +++ b/packages/kbn-pm/src/utils/log.ts @@ -24,7 +24,7 @@ export const log = { * @param ...args */ write(...args: any[]) { - // eslint-disable no-console + // eslint-disable-next-line no-console console.log(...args); }, }; diff --git a/packages/kbn-test-subj-selector/index.d.ts b/packages/kbn-test-subj-selector/index.d.ts index 91eda37f1e8445..7df2f633ac904e 100644 --- a/packages/kbn-test-subj-selector/index.d.ts +++ b/packages/kbn-test-subj-selector/index.d.ts @@ -17,4 +17,5 @@ * under the License. */ +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function(selector: string): string; diff --git a/src/core/server/bootstrap.ts b/src/core/server/bootstrap.ts index eaad0544ef40de..24bfd38530e8cc 100644 --- a/src/core/server/bootstrap.ts +++ b/src/core/server/bootstrap.ts @@ -111,7 +111,7 @@ function onRootShutdown(reason?: any) { // There is a chance that logger wasn't configured properly and error that // that forced root to shut down could go unnoticed. To prevent this we always // mirror such fatal errors in standard output with `console.error`. - // eslint-disable no-console + // eslint-disable-next-line console.error(`\n${chalk.white.bgRed(' FATAL ')} ${reason}\n`); } diff --git a/src/core/server/http/https_redirect_server.test.ts b/src/core/server/http/https_redirect_server.test.ts index dc11d5212d93e0..e7cd653bb9eec7 100644 --- a/src/core/server/http/https_redirect_server.test.ts +++ b/src/core/server/http/https_redirect_server.test.ts @@ -80,6 +80,7 @@ test('throws if [redirectHttpFromPort] is not specified', async () => { test('throws if [redirectHttpFromPort] is in use', async () => { const mockListen = jest.spyOn(Server.prototype, 'listen').mockImplementation(() => { + // eslint-disable-next-line no-throw-literal throw { code: 'EADDRINUSE' }; }); diff --git a/src/core/server/http/ssl_config.ts b/src/core/server/http/ssl_config.ts index 1aeb6599d49146..7db0a95ca77601 100644 --- a/src/core/server/http/ssl_config.ts +++ b/src/core/server/http/ssl_config.ts @@ -105,10 +105,9 @@ export class SslConfig { return Array.from(protocolMap).reduce((secureOptions, [protocolAlias, secureOption]) => { // `secureOption` is the option that turns *off* support for a particular protocol, // so if protocol is supported, we should not enable this option. - // eslint-disable no-bitwise return supportedProtocols.includes(protocolAlias) ? secureOptions - : secureOptions | secureOption; + : secureOptions | secureOption; // eslint-disable-line no-bitwise }, 0); } diff --git a/src/core/server/logging/appenders/console/console_appender.ts b/src/core/server/logging/appenders/console/console_appender.ts index cc9dfa2c9f1aef..b4420c12a23cab 100644 --- a/src/core/server/logging/appenders/console/console_appender.ts +++ b/src/core/server/logging/appenders/console/console_appender.ts @@ -46,7 +46,7 @@ export class ConsoleAppender implements DisposableAppender { * @param record `LogRecord` instance to be logged. */ public append(record: LogRecord) { - // eslint-disable no-console + // eslint-disable-next-line no-console console.log(this.layout.format(record)); } diff --git a/src/legacy/core_plugins/elasticsearch/index.d.ts b/src/legacy/core_plugins/elasticsearch/index.d.ts index b212278804bc64..e5d68651512dd7 100644 --- a/src/legacy/core_plugins/elasticsearch/index.d.ts +++ b/src/legacy/core_plugins/elasticsearch/index.d.ts @@ -345,7 +345,6 @@ export interface CallClusterWithRequest { (request: Request, endpoint: 'tasks.cancel', params: TasksCancelParams, options?: CallClusterOptions): ReturnType; (request: Request, endpoint: 'tasks.get', params: TasksGetParams, options?: CallClusterOptions): ReturnType; (request: Request, endpoint: 'tasks.list', params: TasksListParams, options?: CallClusterOptions): ReturnType; - /* eslint-enable */ // other APIs accessed via transport.request ( @@ -368,6 +367,7 @@ export interface CallClusterWithRequest { clientParams: any, options?: CallClusterOptions ): Promise; + /* eslint-enable */ } export interface CallCluster { @@ -507,7 +507,6 @@ export interface CallCluster { (endpoint: 'tasks.cancel', params: TasksCancelParams, options?: CallClusterOptions): ReturnType; (endpoint: 'tasks.get', params: TasksGetParams, options?: CallClusterOptions): ReturnType; (endpoint: 'tasks.list', params: TasksListParams, options?: CallClusterOptions): ReturnType; - /* eslint-enable */ // other APIs accessed via transport.request (endpoint: 'transport.request', clientParams: AssistantAPIClientParams, options?: {}): Promise< @@ -519,6 +518,7 @@ export interface CallCluster { // Catch-all definition (endpoint: string, clientParams: any, options?: CallClusterOptions): Promise; + /* eslint-enable */ } export interface ElasticsearchPlugin { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts b/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts index 478c59847fe3a4..7c4951ae4bd0ba 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts @@ -158,6 +158,7 @@ const mergeProps = ( }; const toggleExpandedPanel = () => { + // eslint-disable-next-line no-unused-expressions isExpanded ? onMinimizePanel() : onMaximizePanel(); closeMyContextMenuPanel(); }; diff --git a/src/legacy/server/kbn_server.d.ts b/src/legacy/server/kbn_server.d.ts index b1ee34cd3378ec..11ff09b4dc17f7 100644 --- a/src/legacy/server/kbn_server.d.ts +++ b/src/legacy/server/kbn_server.d.ts @@ -60,6 +60,7 @@ declare module 'hapi' { type KbnMixinFunc = (kbnServer: KbnServer, server: Server, config: any) => Promise | void; type Unpromise = T extends Promise ? U : T; +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default class KbnServer { public readonly newPlatform: { start: { diff --git a/src/legacy/server/saved_objects/migrations/core/migration_coordinator.test.ts b/src/legacy/server/saved_objects/migrations/core/migration_coordinator.test.ts index 906a7311a0f643..818ca73b371892 100644 --- a/src/legacy/server/saved_objects/migrations/core/migration_coordinator.test.ts +++ b/src/legacy/server/saved_objects/migrations/core/migration_coordinator.test.ts @@ -30,6 +30,7 @@ describe('coordinateMigration', () => { test('waits for isMigrated, if there is an index conflict', async () => { const pollInterval = 1; const runMigration = jest.fn(() => { + // eslint-disable-next-line no-throw-literal throw { body: { error: { index: '.foo', type: 'resource_already_exists_exception' } } }; }); const isMigrated = jest.fn(); diff --git a/src/legacy/ui/public/ajax_stream/ajax_stream.test.ts b/src/legacy/ui/public/ajax_stream/ajax_stream.test.ts index 5dcd322779c7e5..243c766206d2de 100644 --- a/src/legacy/ui/public/ajax_stream/ajax_stream.test.ts +++ b/src/legacy/ui/public/ajax_stream/ajax_stream.test.ts @@ -19,7 +19,7 @@ import { ajaxStream, XMLHttpRequestLike } from './ajax_stream'; -// eslint-disable-next-line:no-empty +// eslint-disable-next-line no-empty function noop() {} describe('ajaxStream', () => { diff --git a/src/legacy/ui/public/query_bar/components/query_bar.tsx b/src/legacy/ui/public/query_bar/components/query_bar.tsx index 1f8a66cba723db..2d0233c5867247 100644 --- a/src/legacy/ui/public/query_bar/components/query_bar.tsx +++ b/src/legacy/ui/public/query_bar/components/query_bar.tsx @@ -571,7 +571,7 @@ export class QueryBarUI extends Component { aria-owns="kbnTypeahead__items" aria-controls="kbnTypeahead__items" > -
+
= props => { return ( + // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus
field.name === indexPattern.timeFieldName ); @@ -69,7 +68,7 @@ export function getTime( if (!bounds) { return; } - filter = { range: { [timefield.name]: { format: 'strict_date_optional_time' } } }; + const filter: Filter = { range: { [timefield.name]: { format: 'strict_date_optional_time' } } }; if (bounds.min) { filter.range[timefield.name].gte = bounds.min.toISOString(); diff --git a/src/legacy/ui/public/utils/cidr_mask.ts b/src/legacy/ui/public/utils/cidr_mask.ts index c392378abd882c..8dee0ab4e0c128 100644 --- a/src/legacy/ui/public/utils/cidr_mask.ts +++ b/src/legacy/ui/public/utils/cidr_mask.ts @@ -42,7 +42,7 @@ export class CidrMask { public getRange() { const variableBits = NUM_BITS - this.prefixLength; - // eslint-disable-next-line:no-bitwise + // eslint-disable-next-line no-bitwise const fromAddress = ((this.initialAddress.valueOf() >> variableBits) << variableBits) >>> 0; // >>> 0 coerces to unsigned const numAddresses = Math.pow(2, variableBits); return { diff --git a/src/legacy/ui/public/utils/memoize.ts b/src/legacy/ui/public/utils/memoize.ts index 795879b578a8e9..2ca665775a0a0e 100644 --- a/src/legacy/ui/public/utils/memoize.ts +++ b/src/legacy/ui/public/utils/memoize.ts @@ -35,7 +35,7 @@ function memoizeLast any>(func: T): T { let prevCall: MemoizedCall | NeverCalled = neverCalled; // We need to use a `function` here for proper this passing. - // eslint-disable-next-line:only-arrow-functions + // eslint-disable-next-line prefer-arrow/prefer-arrow-functions const memoizedFunction = function(this: any, ...args: any[]) { if ( prevCall !== neverCalled && diff --git a/src/legacy/ui/public/utils/subscribe_with_scope.test.ts b/src/legacy/ui/public/utils/subscribe_with_scope.test.ts index a5a3312bad4bfb..280e2b255c7015 100644 --- a/src/legacy/ui/public/utils/subscribe_with_scope.test.ts +++ b/src/legacy/ui/public/utils/subscribe_with_scope.test.ts @@ -25,6 +25,7 @@ jest.mock('ui/notify/fatal_error', () => ({ import * as Rx from 'rxjs'; import { subscribeWithScope } from './subscribe_with_scope'; +// eslint-disable-next-line prefer-const let $rootScope: Scope; class Scope { diff --git a/test/functional/apps/console/_console.ts b/test/functional/apps/console/_console.ts index 15c562522074a8..eb6560705e91d7 100644 --- a/test/functional/apps/console/_console.ts +++ b/test/functional/apps/console/_console.ts @@ -31,7 +31,7 @@ GET _search `.trim(); -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); const log = getService('log'); diff --git a/test/functional/apps/visualize/_tsvb_chart.ts b/test/functional/apps/visualize/_tsvb_chart.ts index be274ea995d8a6..7e781938d9dcc7 100644 --- a/test/functional/apps/visualize/_tsvb_chart.ts +++ b/test/functional/apps/visualize/_tsvb_chart.ts @@ -20,7 +20,7 @@ import expect from 'expect.js'; import { FtrProviderContext } from '../../ftr_provider_context'; -// eslint-disable-next-line:no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const log = getService('log'); diff --git a/test/functional/apps/visualize/_tsvb_markdown.ts b/test/functional/apps/visualize/_tsvb_markdown.ts index 43dea816beca82..9f25c0f07870a3 100644 --- a/test/functional/apps/visualize/_tsvb_markdown.ts +++ b/test/functional/apps/visualize/_tsvb_markdown.ts @@ -20,7 +20,7 @@ import expect from 'expect.js'; import { FtrProviderContext } from '../../ftr_provider_context'; -// eslint-disable-next-line:no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getPageObjects }: FtrProviderContext) { const { visualBuilder, timePicker } = getPageObjects([ 'visualBuilder', diff --git a/test/functional/apps/visualize/index.ts b/test/functional/apps/visualize/index.ts index 21f120c9a51d00..4e04eb1a4828fc 100644 --- a/test/functional/apps/visualize/index.ts +++ b/test/functional/apps/visualize/index.ts @@ -19,7 +19,7 @@ import { FtrProviderContext } from '../../ftr_provider_context.d'; -// eslint-disable-next-line: no-default-export +// eslint-disable-next-line @typescript-eslint/no-namespace, @elastic/kibana-custom/no-default-export export default function({ getService, loadTestFile }: FtrProviderContext) { const browser = getService('browser'); const log = getService('log'); diff --git a/test/types/mocha_decorations.d.ts b/test/types/mocha_decorations.d.ts index c9f3b98a886cba..4645faf3d5fe84 100644 --- a/test/types/mocha_decorations.d.ts +++ b/test/types/mocha_decorations.d.ts @@ -33,7 +33,8 @@ type Tags = | 'ciGroup11' | 'ciGroup12'; -// eslint-disable-next-line:no-namespace We need to use the namespace here to match the Mocha definition +// We need to use the namespace here to match the Mocha definition +// eslint-disable-next-line @typescript-eslint/no-namespace declare module 'mocha' { interface Suite { /** diff --git a/typings/index.d.ts b/typings/index.d.ts index f4ccecec011180..1cd33be33c2e63 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -19,6 +19,7 @@ declare module '*.html' { const template: string; + // eslint-disable-next-line @elastic/kibana-custom/no-default-export export default template; } diff --git a/x-pack/plugins/apm/typings/global_types.d.ts b/x-pack/plugins/apm/typings/global_types.d.ts index ba1e9e998727fc..3e32d726c121f2 100644 --- a/x-pack/plugins/apm/typings/global_types.d.ts +++ b/x-pack/plugins/apm/typings/global_types.d.ts @@ -9,5 +9,6 @@ // and: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#arbitrary-expressions-are-forbidden-in-export-assignments-in-ambient-contexts declare module '*.json' { const json: any; + // eslint-disable-next-line @elastic/kibana-custom/no-default-export export default json; } diff --git a/x-pack/plugins/apm/typings/numeral.d.ts b/x-pack/plugins/apm/typings/numeral.d.ts index da2d84662a09fa..a8ac5081ed28db 100644 --- a/x-pack/plugins/apm/typings/numeral.d.ts +++ b/x-pack/plugins/apm/typings/numeral.d.ts @@ -10,6 +10,7 @@ interface Numeral { unformat: (pattern: string) => number; } +// eslint-disable-next-line no-var declare var numeral: Numeral; declare module '@elastic/numeral' { diff --git a/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts index 9500e9af4e6b06..e2e00a4dea8192 100644 --- a/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +/* eslint-disable max-classes-per-file */ import { IScope } from 'angular'; import { PathReporter } from 'io-ts/lib/PathReporter'; import * as React from 'react'; @@ -220,7 +221,6 @@ export class KibanaFrameworkAdapter implements FrameworkAdapter { } } -// eslint-disable-next-line max-classes-per-file class KibanaAdapterServiceProvider { public serviceRefs: KibanaAdapterServiceRefs | null = null; public bufferedCalls: Array> = []; diff --git a/x-pack/plugins/beats_management/server/rest_api/__tests__/beats_assignments.test.ts b/x-pack/plugins/beats_management/server/rest_api/__tests__/beats_assignments.test.ts index e427c9b0b11151..60551870fca3f6 100644 --- a/x-pack/plugins/beats_management/server/rest_api/__tests__/beats_assignments.test.ts +++ b/x-pack/plugins/beats_management/server/rest_api/__tests__/beats_assignments.test.ts @@ -54,9 +54,7 @@ describe('assign_tags_to_beats', () => { expect(result.assignments).toEqual([{ status: 200, result: 'updated' }]); - let beat; - - beat = await serverLibs.beats.getById( + const beat = await serverLibs.beats.getById( { kind: 'internal', }, diff --git a/x-pack/plugins/beats_management/types/formsy.d.ts b/x-pack/plugins/beats_management/types/formsy.d.ts index f153e80d13e53a..46f311c2f84647 100644 --- a/x-pack/plugins/beats_management/types/formsy.d.ts +++ b/x-pack/plugins/beats_management/types/formsy.d.ts @@ -24,6 +24,7 @@ declare module 'formsy-react' { showRequired(): boolean; } + // eslint-disable-next-line @elastic/kibana-custom/no-default-export export default Formsy; export type FormData = { [fieldName in keyof FormShape]: string }; export type FieldValue = string | null | undefined; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx index 27cee9e5730d91..00af7392e30e4d 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +/* eslint-disable max-classes-per-file */ + import { EuiButtonEmpty, EuiIcon, EuiProgress, EuiText } from '@elastic/eui'; import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react'; import * as React from 'react'; @@ -111,7 +113,6 @@ interface ProgressEntryProps { isLoading: boolean; } -// eslint-disable-next-line:max-classes-per-file class ProgressEntry extends React.PureComponent { public render() { const { alignment, children, className, color, isLoading } = this.props; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx index de8efdc3f614bf..201518dc225090 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx @@ -209,7 +209,7 @@ class ScrollableLogTextStreamViewClass extends React.PureComponent< }; // this is actually a method but not recognized as such - // eslint-disable-next-line:member-ordering + // eslint-disable-next-line @typescript-eslint/member-ordering private handleVisibleChildrenChange = callWithoutRepeats( ({ topChild, diff --git a/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts index 7d80aaf74d5907..71dea6344855f4 100644 --- a/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/infra/public/lib/adapters/framework/kibana_framework_adapter.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +/* eslint-disable max-classes-per-file */ + import { IModule, IScope } from 'angular'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; @@ -151,7 +153,6 @@ export class InfraKibanaFrameworkAdapter implements InfraFrameworkAdapter { }; } -// eslint-disable-next-line: max-classes-per-file class KibanaAdapterServiceProvider { public serviceRefs: InfraKibanaAdapterServiceRefs | null = null; public bufferedCalls: Array> = []; diff --git a/x-pack/plugins/infra/public/utils/memoize_last.ts b/x-pack/plugins/infra/public/utils/memoize_last.ts index 2352ffe251c5de..aa33839af9f2ac 100644 --- a/x-pack/plugins/infra/public/utils/memoize_last.ts +++ b/x-pack/plugins/infra/public/utils/memoize_last.ts @@ -22,7 +22,7 @@ function memoizeLast any>(func: T): T { let prevCall: MemoizedCall | NeverCalled = neverCalled; // We need to use a `function` here for proper this passing. - // eslint-disable-next-line:only-arrow-functions + // eslint-disable-next-line prefer-arrow/prefer-arrow-functions const memoizedFunction = function(this: any, ...args: any[]) { if ( prevCall !== neverCalled && diff --git a/x-pack/plugins/infra/public/utils/url_state.tsx b/x-pack/plugins/infra/public/utils/url_state.tsx index cb089a1dd081d1..43a803c81230bc 100644 --- a/x-pack/plugins/infra/public/utils/url_state.tsx +++ b/x-pack/plugins/infra/public/utils/url_state.tsx @@ -53,7 +53,7 @@ class UrlStateContainerLifecycle extends React.Component< this.handleInitialize(location); } - // eslint-disable-next-line:member-ordering this is really a method despite what eslint thinks + // eslint-disable-next-line @typescript-eslint/member-ordering this is really a method despite what eslint thinks private replaceStateInLocation = throttle(1000, (urlState: UrlState | undefined) => { const { history, location, urlStateKey } = this.props; diff --git a/x-pack/plugins/infra/scripts/combined_schema.ts b/x-pack/plugins/infra/scripts/combined_schema.ts index ed898743d17e38..3565ac823dd16f 100644 --- a/x-pack/plugins/infra/scripts/combined_schema.ts +++ b/x-pack/plugins/infra/scripts/combined_schema.ts @@ -12,5 +12,5 @@ export const schemas = [...serverSchemas]; // this default export is used to feed the combined types to the gql-gen tool // which generates the corresponding typescript types -// eslint-disable-next-line:no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default buildSchemaFromTypeDefinitions(schemas); diff --git a/x-pack/plugins/infra/types/graphql_fields.d.ts b/x-pack/plugins/infra/types/graphql_fields.d.ts index 11d26e913015c0..d4155b9267ebd4 100644 --- a/x-pack/plugins/infra/types/graphql_fields.d.ts +++ b/x-pack/plugins/infra/types/graphql_fields.d.ts @@ -6,5 +6,6 @@ declare module 'graphql-fields' { function graphqlFields(info: any, obj?: any): any; + // eslint-disable-next-line @elastic/kibana-custom/no-default-export export default graphqlFields; } diff --git a/x-pack/plugins/security/public/views/login/components/basic_login_form/basic_login_form.test.tsx b/x-pack/plugins/security/public/views/login/components/basic_login_form/basic_login_form.test.tsx index 7bdd272c6c8afb..21c1dacb06d422 100644 --- a/x-pack/plugins/security/public/views/login/components/basic_login_form/basic_login_form.test.tsx +++ b/x-pack/plugins/security/public/views/login/components/basic_login_form/basic_login_form.test.tsx @@ -14,6 +14,7 @@ const createMockHttp = ({ simulateError = false } = {}) => { return { post: jest.fn(async () => { if (simulateError) { + // eslint-disable-next-line no-throw-literal throw { data: { statusCode: 401, diff --git a/x-pack/plugins/security/public/views/login/components/login_page/login_page.test.tsx b/x-pack/plugins/security/public/views/login/components/login_page/login_page.test.tsx index 342511c6902d3d..8d7bd0e10352a4 100644 --- a/x-pack/plugins/security/public/views/login/components/login_page/login_page.test.tsx +++ b/x-pack/plugins/security/public/views/login/components/login_page/login_page.test.tsx @@ -13,6 +13,7 @@ const createMockHttp = ({ simulateError = false } = {}) => { return { post: jest.fn(async () => { if (simulateError) { + // eslint-disable-next-line no-throw-literal throw { data: { statusCode: 401, diff --git a/x-pack/plugins/task_manager/task_store.ts b/x-pack/plugins/task_manager/task_store.ts index 21db96953e1033..d650f3125dc1b7 100644 --- a/x-pack/plugins/task_manager/task_store.ts +++ b/x-pack/plugins/task_manager/task_store.ts @@ -81,7 +81,7 @@ export class TaskStore { public readonly index: string; private callCluster: ElasticJs; private supportedTypes: string[]; - private _isInitialized = false; // eslint-disable-line:variable-name + private _isInitialized = false; // eslint-disable-line @typescript-eslint/camelcase private logger: Logger; /** diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts index f101f30e64afd0..002ecf8e82bb02 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts @@ -582,7 +582,7 @@ export const reindexServiceFactory = ( }); // Cleanup any changes, ignoring any errors. - lockedReindexOp = await cleanupChanges(lockedReindexOp).catch(e => lockedReindexOp); + lockedReindexOp = await cleanupChanges(lockedReindexOp).catch(err => lockedReindexOp); } return lockedReindexOp; diff --git a/x-pack/plugins/uptime/scripts/graphql_schemas.ts b/x-pack/plugins/uptime/scripts/graphql_schemas.ts index e6a35d4993e645..e62470195cc5ee 100644 --- a/x-pack/plugins/uptime/scripts/graphql_schemas.ts +++ b/x-pack/plugins/uptime/scripts/graphql_schemas.ts @@ -11,5 +11,5 @@ export const schemas = [...typeDefs]; // this default export is used to feed the combined types to the gql-gen tool // which generates the corresponding typescript types -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default buildSchemaFromTypeDefinitions(schemas); diff --git a/x-pack/test/api_integration/apis/infra/log_entries.ts b/x-pack/test/api_integration/apis/infra/log_entries.ts index 71aaa085ec1f6f..4c775dff654189 100644 --- a/x-pack/test/api_integration/apis/infra/log_entries.ts +++ b/x-pack/test/api_integration/apis/infra/log_entries.ts @@ -244,7 +244,7 @@ const logEntriesTests: KbnTestProvider = ({ getService }) => { }); }; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default logEntriesTests; const isSorted = (comparator: (first: Value, second: Value) => number) => ( diff --git a/x-pack/test/api_integration/apis/infra/log_item.ts b/x-pack/test/api_integration/apis/infra/log_item.ts index 11489425ef83a1..718902f47c8be9 100644 --- a/x-pack/test/api_integration/apis/infra/log_item.ts +++ b/x-pack/test/api_integration/apis/infra/log_item.ts @@ -171,5 +171,5 @@ const logItemTests: KbnTestProvider = ({ getService }) => { }); }; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default logItemTests; diff --git a/x-pack/test/api_integration/apis/infra/log_summary.ts b/x-pack/test/api_integration/apis/infra/log_summary.ts index c669fae9bc2c00..e018b962bfcdb5 100644 --- a/x-pack/test/api_integration/apis/infra/log_summary.ts +++ b/x-pack/test/api_integration/apis/infra/log_summary.ts @@ -82,5 +82,5 @@ const logSummaryTests: KbnTestProvider = ({ getService }) => { }); }; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default logSummaryTests; diff --git a/x-pack/test/api_integration/apis/infra/logs_without_millis.ts b/x-pack/test/api_integration/apis/infra/logs_without_millis.ts index eadc3ce1f215ab..13db068d51611a 100644 --- a/x-pack/test/api_integration/apis/infra/logs_without_millis.ts +++ b/x-pack/test/api_integration/apis/infra/logs_without_millis.ts @@ -98,7 +98,7 @@ const logsWithoutMillisTests: KbnTestProvider = ({ getService }) => { }); }; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default logsWithoutMillisTests; const logEntriesAroundQuery = gql` diff --git a/x-pack/test/api_integration/apis/infra/metadata.ts b/x-pack/test/api_integration/apis/infra/metadata.ts index 781a024aa2201e..6f4358c96bcd0d 100644 --- a/x-pack/test/api_integration/apis/infra/metadata.ts +++ b/x-pack/test/api_integration/apis/infra/metadata.ts @@ -69,5 +69,5 @@ const metadataTests: KbnTestProvider = ({ getService }) => { }); }; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default metadataTests; diff --git a/x-pack/test/api_integration/apis/infra/metrics.ts b/x-pack/test/api_integration/apis/infra/metrics.ts index 4a3c4b448bdb84..f5f57dac9519b1 100644 --- a/x-pack/test/api_integration/apis/infra/metrics.ts +++ b/x-pack/test/api_integration/apis/infra/metrics.ts @@ -77,5 +77,5 @@ const metricTests: KbnTestProvider = ({ getService }) => { }); }; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default metricTests; diff --git a/x-pack/test/api_integration/apis/infra/sources.ts b/x-pack/test/api_integration/apis/infra/sources.ts index 63bfa137653648..67f46dbc86a01a 100644 --- a/x-pack/test/api_integration/apis/infra/sources.ts +++ b/x-pack/test/api_integration/apis/infra/sources.ts @@ -339,7 +339,7 @@ const sourcesTests: KbnTestProvider = ({ getService }) => { }); }; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default sourcesTests; const createSourceMutation = gql` diff --git a/x-pack/test/api_integration/apis/infra/waffle.ts b/x-pack/test/api_integration/apis/infra/waffle.ts index 1adc86ce3bd75c..aef634f86430fe 100644 --- a/x-pack/test/api_integration/apis/infra/waffle.ts +++ b/x-pack/test/api_integration/apis/infra/waffle.ts @@ -179,5 +179,5 @@ const waffleTests: KbnTestProvider = ({ getService }) => { }); }; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default waffleTests; diff --git a/x-pack/test/functional/apps/infra/home_page.ts b/x-pack/test/functional/apps/infra/home_page.ts index 1cd157ee04255c..6f5eaeedf5116f 100644 --- a/x-pack/test/functional/apps/infra/home_page.ts +++ b/x-pack/test/functional/apps/infra/home_page.ts @@ -9,7 +9,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; const DATE_WITH_DATA = new Date(1539806283000); const DATE_WITHOUT_DATA = new Date(1539122400000); -// eslint-disable-next-line:no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProviders) => { const esArchiver = getService('esArchiver'); const pageObjects = getPageObjects(['common', 'infraHome']); diff --git a/x-pack/test/functional/apps/infra/index.ts b/x-pack/test/functional/apps/infra/index.ts index 908b54eb7eb652..3d3b3a24ba3455 100644 --- a/x-pack/test/functional/apps/infra/index.ts +++ b/x-pack/test/functional/apps/infra/index.ts @@ -6,7 +6,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// eslint-disable-next-line no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default ({ loadTestFile }: KibanaFunctionalTestDefaultProviders) => { describe('InfraOps app', function() { this.tags('ciGroup7'); diff --git a/x-pack/test/functional/apps/spaces/index.ts b/x-pack/test/functional/apps/spaces/index.ts index 1d8f40982dd302..c880294f86ec5b 100644 --- a/x-pack/test/functional/apps/spaces/index.ts +++ b/x-pack/test/functional/apps/spaces/index.ts @@ -5,7 +5,7 @@ */ import { TestInvoker } from './lib/types'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function spacesApp({ loadTestFile }: TestInvoker) { describe('Spaces app', function spacesAppTestSuite() { this.tags('ciGroup4'); diff --git a/x-pack/test/functional/apps/spaces/spaces_selection.ts b/x-pack/test/functional/apps/spaces/spaces_selection.ts index 139dbc890e8e76..58eb79b0711f93 100644 --- a/x-pack/test/functional/apps/spaces/spaces_selection.ts +++ b/x-pack/test/functional/apps/spaces/spaces_selection.ts @@ -5,7 +5,7 @@ */ import { TestInvoker } from './lib/types'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function spaceSelectorFunctonalTests({ getService, getPageObjects }: TestInvoker) { const config = getService('config'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/functional/apps/status_page/index.ts b/x-pack/test/functional/apps/status_page/index.ts index 1b929c148c06d7..8de6016844058f 100644 --- a/x-pack/test/functional/apps/status_page/index.ts +++ b/x-pack/test/functional/apps/status_page/index.ts @@ -5,7 +5,7 @@ */ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function statusPage({ loadTestFile }: KibanaFunctionalTestDefaultProviders) { describe('Status page', function statusPageTestSuite() { this.tags('ciGroup4'); diff --git a/x-pack/test/functional/apps/status_page/status_page.ts b/x-pack/test/functional/apps/status_page/status_page.ts index 779f7958df323a..92f9a93e56c3d6 100644 --- a/x-pack/test/functional/apps/status_page/status_page.ts +++ b/x-pack/test/functional/apps/status_page/status_page.ts @@ -5,7 +5,7 @@ */ import { TestInvoker } from './lib/types'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function statusPageFunctonalTests({ getService, getPageObjects }: TestInvoker) { const esArchiver = getService('esArchiver'); const PageObjects = getPageObjects(['security', 'statusPage', 'home']); diff --git a/x-pack/test/functional/apps/upgrade_assistant/index.ts b/x-pack/test/functional/apps/upgrade_assistant/index.ts index e3dda37064b5b8..2453fc30b08c6b 100644 --- a/x-pack/test/functional/apps/upgrade_assistant/index.ts +++ b/x-pack/test/functional/apps/upgrade_assistant/index.ts @@ -5,7 +5,7 @@ */ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function upgradeCheckup({ loadTestFile }: KibanaFunctionalTestDefaultProviders) { describe('Upgrade checkup ', function upgradeAssistantTestSuite() { this.tags('ciGroup4'); diff --git a/x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts b/x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts index 766f94e0e4b8b7..00c1223b62fcbb 100644 --- a/x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts +++ b/x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts @@ -6,7 +6,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function upgradeAssistantFunctionalTests({ getService, getPageObjects, diff --git a/x-pack/test/functional/apps/uptime/index.ts b/x-pack/test/functional/apps/uptime/index.ts index f2e9111533953b..34b896191e793f 100644 --- a/x-pack/test/functional/apps/uptime/index.ts +++ b/x-pack/test/functional/apps/uptime/index.ts @@ -8,7 +8,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; const ARCHIVE = 'uptime/full_heartbeat'; -// eslint-disable-next-line:no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default ({ loadTestFile, getService }: KibanaFunctionalTestDefaultProviders) => { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); diff --git a/x-pack/test/functional/apps/uptime/monitor.ts b/x-pack/test/functional/apps/uptime/monitor.ts index ce2c319a4bd0c7..61c3314ee7dddb 100644 --- a/x-pack/test/functional/apps/uptime/monitor.ts +++ b/x-pack/test/functional/apps/uptime/monitor.ts @@ -6,7 +6,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// eslint-disable-next-line:no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProviders) => { const esArchiver = getService('esArchiver'); const pageObjects = getPageObjects(['uptime']); diff --git a/x-pack/test/functional/apps/uptime/overview.ts b/x-pack/test/functional/apps/uptime/overview.ts index abfff54bf2b2db..3df536f1463acb 100644 --- a/x-pack/test/functional/apps/uptime/overview.ts +++ b/x-pack/test/functional/apps/uptime/overview.ts @@ -6,7 +6,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; -// eslint-disable-next-line:no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default ({ getPageObjects }: KibanaFunctionalTestDefaultProviders) => { // TODO: add UI functional tests const pageObjects = getPageObjects(['uptime']); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_create.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_create.ts index 6983d7386752bb..ad5275fca694a6 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_create.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { bulkCreateTestSuiteFactory } from '../../common/suites/bulk_create'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts index dbf8532333fb07..a6d738aee52f7a 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/bulk_get.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts index 44f7ac0bd0282c..32a37dab9e7920 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/create.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const es = getService('es'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts index 72d54b0521f982..5b330d509faefd 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/delete.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/export.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/export.ts index b7727e892c39ed..3c0787ceab2453 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/export.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/export.ts @@ -9,8 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { exportTestSuiteFactory } from '../../common/suites/export'; -// eslint-disable no-default-export - +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts index bf79fe8af48aa4..1ae865aebd30d6 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { findTestSuiteFactory } from '../../common/suites/find'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts index e5902d278cbc21..c163a67cf68ed6 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/get.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/import.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/import.ts index 3c6e5e26e178be..34e44c9cef99e7 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/import.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/import.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { importTestSuiteFactory } from '../../common/suites/import'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts index 18f12b432b95e8..f082baa0a3151e 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/index.ts @@ -7,7 +7,7 @@ import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService, loadTestFile }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/resolve_import_errors.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/resolve_import_errors.ts index 34ebcf0047eff8..443854bb945417 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/resolve_import_errors.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/resolve_import_errors.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve_import_errors'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts index 544b73a682d30a..fc7a88b7dae18f 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/apis/update.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_and_spaces/config.ts b/x-pack/test/saved_object_api_integration/security_and_spaces/config.ts index 0a7dd4d1221f5d..c462b752b7fd1b 100644 --- a/x-pack/test/saved_object_api_integration/security_and_spaces/config.ts +++ b/x-pack/test/saved_object_api_integration/security_and_spaces/config.ts @@ -6,5 +6,5 @@ import { createTestConfig } from '../common/config'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default createTestConfig('security_and_spaces', { license: 'trial' }); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/bulk_create.ts b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_create.ts index 8c6fd2ce288d82..2d1b047db9de3a 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_create.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { bulkCreateTestSuiteFactory } from '../../common/suites/bulk_create'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts index 779b8de0f55caf..b262f4df9145d1 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/bulk_get.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/create.ts b/x-pack/test/saved_object_api_integration/security_only/apis/create.ts index 6919960141df80..6b4d19e918ec80 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/create.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/create.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const es = getService('es'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts b/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts index 24a077a851354a..347a9c7c6ce8eb 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/delete.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/export.ts b/x-pack/test/saved_object_api_integration/security_only/apis/export.ts index 9ffd5590529e72..a26362b4574413 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/export.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/export.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { exportTestSuiteFactory } from '../../common/suites/export'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/find.ts b/x-pack/test/saved_object_api_integration/security_only/apis/find.ts index 94455ad21a3e5f..d8c6ae08ef464c 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/find.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/find.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { findTestSuiteFactory } from '../../common/suites/find'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/get.ts b/x-pack/test/saved_object_api_integration/security_only/apis/get.ts index 9a641adea6af8e..6a2edb0176b553 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/get.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/get.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/import.ts b/x-pack/test/saved_object_api_integration/security_only/apis/import.ts index 9c909256fa100f..e04dfee911cb24 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/import.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/import.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { importTestSuiteFactory } from '../../common/suites/import'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts index b4e18895955638..786f1536d4ea8e 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts @@ -7,7 +7,7 @@ import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService, loadTestFile }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/resolve_import_errors.ts b/x-pack/test/saved_object_api_integration/security_only/apis/resolve_import_errors.ts index 3683a22618e3c6..5d8ddd156ef7c7 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/resolve_import_errors.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/resolve_import_errors.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve_import_errors'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/update.ts b/x-pack/test/saved_object_api_integration/security_only/apis/update.ts index f27dcdbbb76041..040b87813de049 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/update.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/update.ts @@ -8,7 +8,7 @@ import { AUTHENTICATION } from '../../common/lib/authentication'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/security_only/config.ts b/x-pack/test/saved_object_api_integration/security_only/config.ts index 80faad195ec3cc..00ca6264c097de 100644 --- a/x-pack/test/saved_object_api_integration/security_only/config.ts +++ b/x-pack/test/saved_object_api_integration/security_only/config.ts @@ -6,5 +6,5 @@ import { createTestConfig } from '../common/config'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default createTestConfig('security_only', { disabledPlugins: ['spaces'], license: 'trial' }); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts index 7ec563b23b08d4..60f65983e028a5 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_create.ts @@ -22,7 +22,7 @@ const expectNamespaceSpecifiedBadRequest = (resp: { [key: string]: any }) => { }); }; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts index 02ec5563b234c7..fb6fd4e9e3fa8f 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/bulk_get.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { bulkGetTestSuiteFactory } from '../../common/suites/bulk_get'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts index f76940f9989c04..20fc226dab764d 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/create.ts @@ -21,7 +21,7 @@ const expectNamespaceSpecifiedBadRequest = (resp: { [key: string]: any }) => { }); }; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const es = getService('es'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts index 8bc30eeac58d47..d129957cd13c0a 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/delete.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/export.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/export.ts index a33af6516ceb3f..c57b11d103eb6e 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/export.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/export.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { exportTestSuiteFactory } from '../../common/suites/export'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts index 7636970855176f..94c55e21a699f4 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/find.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { findTestSuiteFactory } from '../../common/suites/find'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts index 57db7a0ed3f67c..692af6022f22e5 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/get.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/import.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/import.ts index 7b73c752f10d92..9256122e2ab2df 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/import.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/import.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { importTestSuiteFactory } from '../../common/suites/import'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts index 8eb0a485330e2a..67fb97011a31a1 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/index.ts @@ -6,7 +6,7 @@ import { TestInvoker } from '../../common/lib/types'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ loadTestFile }: TestInvoker) { describe('saved objects spaces only enabled', function() { this.tags('ciGroup5'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/resolve_import_errors.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/resolve_import_errors.ts index 2ea3b5eece36fe..9fc3ddfe3e521b 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/resolve_import_errors.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/resolve_import_errors.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { resolveImportErrorsTestSuiteFactory } from '../../common/suites/resolve_import_errors'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts b/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts index a05f4751676275..d9a8c819642e22 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/apis/update.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ getService }: TestInvoker) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/saved_object_api_integration/spaces_only/config.ts b/x-pack/test/saved_object_api_integration/spaces_only/config.ts index eeaeeaac666da2..e43e4f74b34cf1 100644 --- a/x-pack/test/saved_object_api_integration/spaces_only/config.ts +++ b/x-pack/test/saved_object_api_integration/spaces_only/config.ts @@ -6,5 +6,5 @@ import { createTestConfig } from '../common/config'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default createTestConfig('spaces_only', { license: 'basic' }); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/create.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/create.ts index 1ec3a543b2209b..9d7d75fadcbfc7 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/create.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/create.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function createSpacesOnlySuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/delete.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/delete.ts index c48bf67b389a56..a1016fd159aa6c 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/delete.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/delete.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function deleteSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/get.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/get.ts index 347ae961b3db31..8802b0f7ce7492 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/get.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/get.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function getSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all.ts index b6e65c205389e2..4cdcaa0a6b82c4 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getAllTestSuiteFactory } from '../../common/suites/get_all'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function getAllSpacesTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts index 5154bc485b4d54..c0d1c13e3de148 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts @@ -7,7 +7,7 @@ import { createUsersAndRoles } from '../../common/lib/create_users_and_roles'; import { TestInvoker } from '../../common/lib/types'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function({ loadTestFile, getService }: TestInvoker) { const es = getService('es'); const supertest = getService('supertest'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/select.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/select.ts index 38c212fa078015..eb89d4d6c3ef46 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/select.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/select.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { selectTestSuiteFactory } from '../../common/suites/select'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function selectSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/update.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/update.ts index c026f6f85e03d9..141926265ad1ba 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/update.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/update.ts @@ -9,7 +9,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function updateSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/config.ts b/x-pack/test/spaces_api_integration/security_and_spaces/config.ts index 0a7dd4d1221f5d..c462b752b7fd1b 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/config.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/config.ts @@ -6,5 +6,5 @@ import { createTestConfig } from '../common/config'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default createTestConfig('security_and_spaces', { license: 'trial' }); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/create.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/create.ts index bf6b82ff3e301e..b00230fd07e103 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/create.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/create.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { createTestSuiteFactory } from '../../common/suites/create'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function createSpacesOnlySuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/delete.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/delete.ts index 45866e670eaaaf..2150aea40d96b4 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/delete.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/delete.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { deleteTestSuiteFactory } from '../../common/suites/delete'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function deleteSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/get.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/get.ts index bebf7339a0157d..e83b35920d7f41 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/get.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/get.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getTestSuiteFactory } from '../../common/suites/get'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function getSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/get_all.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/get_all.ts index c3cd1729ac818a..58ca7e1e8ced8c 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/get_all.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/get_all.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { getAllTestSuiteFactory } from '../../common/suites/get_all'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function getAllSpacesTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/index.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/index.ts index 96b99f47d8a991..9b54e09e2f48e8 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/index.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/index.ts @@ -6,7 +6,7 @@ import { TestInvoker } from '../../common/lib/types'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function spacesOnlyTestSuite({ loadTestFile }: TestInvoker) { describe('spaces api without security', function() { this.tags('ciGroup5'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/select.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/select.ts index b598567bff9219..5fb273f3ea4c22 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/select.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/select.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { selectTestSuiteFactory } from '../../common/suites/select'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function selectSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/apis/update.ts b/x-pack/test/spaces_api_integration/spaces_only/apis/update.ts index 37d6360d61a9f1..8578ae1dee0abb 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/apis/update.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/apis/update.ts @@ -8,7 +8,7 @@ import { SPACES } from '../../common/lib/spaces'; import { TestInvoker } from '../../common/lib/types'; import { updateTestSuiteFactory } from '../../common/suites/update'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default function updateSpaceTestSuite({ getService }: TestInvoker) { const supertestWithoutAuth = getService('supertestWithoutAuth'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/config.ts b/x-pack/test/spaces_api_integration/spaces_only/config.ts index 9bef9c858ed278..36f62d3f8638fe 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/config.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/config.ts @@ -5,5 +5,5 @@ */ import { createTestConfig } from '../common/config'; -// eslint-disable no-default-export +// eslint-disable-next-line @elastic/kibana-custom/no-default-export export default createTestConfig('spaces_only', { license: 'basic' }); diff --git a/x-pack/test/types/mocha_decorations.d.ts b/x-pack/test/types/mocha_decorations.d.ts index 41a3e6bcebe3ac..fa7cc66581f2db 100644 --- a/x-pack/test/types/mocha_decorations.d.ts +++ b/x-pack/test/types/mocha_decorations.d.ts @@ -6,7 +6,7 @@ import { Suite } from 'mocha'; -// eslint-disable-next-line:no-namespace We need to use the namespace here to match the Mocha definition +// eslint-disable-next-line @typescript-eslint/no-namespace We need to use the namespace here to match the Mocha definition declare module 'mocha' { interface Suite { /** diff --git a/x-pack/typings/index.d.ts b/x-pack/typings/index.d.ts index 38dbf632e578cf..d4e590ee41dea3 100644 --- a/x-pack/typings/index.d.ts +++ b/x-pack/typings/index.d.ts @@ -6,5 +6,6 @@ declare module '*.html' { const template: string; + // eslint-disable-next-line @elastic/kibana-custom/no-default-export export default template; } diff --git a/yarn.lock b/yarn.lock index bab159b8d6f919..d05d9504214b28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2381,29 +2381,29 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d" integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg== -"@typescript-eslint/eslint-plugin@^1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.4.2.tgz#370bc32022d1cc884a5dcf62624ef2024182769d" - integrity sha512-6WInypy/cK4rM1dirKbD5p7iFW28DbSRKT/+PGn+DYzBWEvHq5KnZAqQ5cX25JBc0qMkFxJNxNfBbFXJyyzVcw== +"@typescript-eslint/eslint-plugin@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.5.0.tgz#85c509bcfc2eb35f37958fa677379c80b7a8f66f" + integrity sha512-TZ5HRDFz6CswqBUviPX8EfS+iOoGbclYroZKT3GWGYiGScX0qo6QjHc5uuM7JN920voP2zgCkHgF5SDEVlCtjQ== dependencies: - "@typescript-eslint/parser" "1.4.2" - "@typescript-eslint/typescript-estree" "1.4.2" + "@typescript-eslint/parser" "1.5.0" + "@typescript-eslint/typescript-estree" "1.5.0" requireindex "^1.2.0" tsutils "^3.7.0" -"@typescript-eslint/parser@1.4.2", "@typescript-eslint/parser@^1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.4.2.tgz#acfdee2019958a41d308d768e53ded975ef90ce8" - integrity sha512-OqLkY9295DXXaWToItUv3olO2//rmzh6Th6Sc7YjFFEpEuennsm5zhygLLvHZjPxPlzrQgE8UDaOPurDylaUuw== +"@typescript-eslint/parser@1.5.0", "@typescript-eslint/parser@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.5.0.tgz#a96114d195dff2a49534e4c4850fb676f905a072" + integrity sha512-pRWTnJrnxuT0ragdY26hZL+bxqDd4liMlftpH2CBlMPryOIOb1J+MdZuw6R4tIu6bWVdwbHKPTs+Q34LuGvfGw== dependencies: - "@typescript-eslint/typescript-estree" "1.4.2" + "@typescript-eslint/typescript-estree" "1.5.0" eslint-scope "^4.0.0" eslint-visitor-keys "^1.0.0" -"@typescript-eslint/typescript-estree@1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.4.2.tgz#b16bc36c9a4748a7fca92cba4c2d73c5325c8a85" - integrity sha512-wKgi/w6k1v3R4b6oDc20cRWro2gBzp0wn6CAeYC8ExJMfvXMfiaXzw2tT9ilxdONaVWMCk7B9fMdjos7bF/CWw== +"@typescript-eslint/typescript-estree@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.5.0.tgz#986b356ecdf5a0c3bc9889d221802149cf5dbd4e" + integrity sha512-XqR14d4BcYgxcrpxIwcee7UEjncl9emKc/MgkeUfIk2u85KlsGYyaxC7Zxjmb17JtWERk/NaO+KnBsqgpIXzwA== dependencies: lodash.unescape "4.0.1" semver "5.5.0" From 2be48ad7749e6b564c3fbff49610afca3f96167e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Mon, 25 Mar 2019 21:29:19 +0000 Subject: [PATCH 18/36] chore(NA): fix spaced comment problems. --- packages/eslint-config-kibana/typescript.js | 5 ++++- src/legacy/core_plugins/interpreter/init.ts | 2 +- src/legacy/ui/public/utils/decode_geo_hash.ts | 2 +- .../public/components/logging/log_minimap/log_minimap.tsx | 4 ++-- .../infra/public/containers/logs/with_stream_items.ts | 4 ++-- .../public/views/management/edit_role/lib/constants.ts | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index b61b6b0c552e50..1e0e8cf61b072f 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -119,6 +119,7 @@ module.exports = { 'object-curly-spacing': 'error', 'object-shorthand': 'error', // 'one-var': 'error', + 'one-var': ['error', { 'initialized': 'always', 'uninitialized': 'never' }], // 'prefer-arrow/prefer-arrow-functions': 'error', 'prefer-const': 'error', 'quotes': ['error', 'double', { 'avoidEscape': true }], @@ -131,7 +132,9 @@ module.exports = { 'named': 'never', 'asyncArrow': 'always' }], - // 'spaced-comment': 'error', + 'spaced-comment': ["error", "always", { + "exceptions": ["/"] + }], 'use-isnan': 'error', // Old tslint yml override or defined rules diff --git a/src/legacy/core_plugins/interpreter/init.ts b/src/legacy/core_plugins/interpreter/init.ts index 0cb3f590d37c7f..74f003774cb28a 100644 --- a/src/legacy/core_plugins/interpreter/init.ts +++ b/src/legacy/core_plugins/interpreter/init.ts @@ -37,7 +37,7 @@ export const registries = { serverFunctions: new FunctionsRegistry(), }; -export async function init(server: Legacy.Server /*options*/) { +export async function init(server: Legacy.Server /* options */) { server.injectUiAppVars('canvas', () => { register(registries, { types, diff --git a/src/legacy/ui/public/utils/decode_geo_hash.ts b/src/legacy/ui/public/utils/decode_geo_hash.ts index ed20b4814e404d..9d7585384c82a8 100644 --- a/src/legacy/ui/public/utils/decode_geo_hash.ts +++ b/src/legacy/ui/public/utils/decode_geo_hash.ts @@ -75,7 +75,7 @@ function refine_interval(interval: number[], cd: number, mask: number) { function geohashCells(precision: number, axis: number) { let cells = 1; for (let i = 1; i <= precision; i += 1) { - /*On odd precisions, rows divide by 4 and columns by 8. Vice-versa on even precisions */ + /* On odd precisions, rows divide by 4 and columns by 8. Vice-versa on even precisions */ cells *= i % 2 === axis ? 4 : 8; } return cells; diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx b/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx index 52fce179c3f668..ae3c26bb646212 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx @@ -101,7 +101,7 @@ export class LogMinimap extends React.Component { width={width} /> ) : null} - {/* + {/* { height={height} jumpToTarget={jumpToTarget} /> - */} + */} ); } diff --git a/x-pack/plugins/infra/public/containers/logs/with_stream_items.ts b/x-pack/plugins/infra/public/containers/logs/with_stream_items.ts index f51dcc3b820f69..33db095b7e0104 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_stream_items.ts +++ b/x-pack/plugins/infra/public/containers/logs/with_stream_items.ts @@ -34,11 +34,11 @@ const selectItems = createSelector( logEntriesSelectors.selectIsReloadingEntries, logPositionSelectors.selectIsAutoReloading, // searchResultsSelectors.selectSearchResultsById, - (logEntries, isReloading, isAutoReloading /*, searchResults*/) => + (logEntries, isReloading, isAutoReloading /* , searchResults */) => isReloading && !isAutoReloading ? [] : logEntries.map(logEntry => - createLogEntryStreamItem(logEntry /*, searchResults[logEntry.gid] || null*/) + createLogEntryStreamItem(logEntry /* , searchResults[logEntry.gid] || null */) ) ); diff --git a/x-pack/plugins/security/public/views/management/edit_role/lib/constants.ts b/x-pack/plugins/security/public/views/management/edit_role/lib/constants.ts index 7378251fc84ac5..eb44251b08ee20 100644 --- a/x-pack/plugins/security/public/views/management/edit_role/lib/constants.ts +++ b/x-pack/plugins/security/public/views/management/edit_role/lib/constants.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -/*../../../../../common/model/kibana_privilege +/* ../../../../../common/model/kibana_privilege * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. From 7c5be413c9ccfc9b0a93dc49184515a128ab55de Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 26 Mar 2019 01:05:34 +0000 Subject: [PATCH 19/36] chore(NA): fix some more eslint typescript rules: import/order no-empty-interface --- packages/eslint-config-kibana/typescript.js | 22 ++++++++++++------- packages/kbn-pm/src/utils/projects_tree.ts | 2 ++ .../kbn-system-loader/src/system_types.ts | 7 +++--- .../public/injected_metadata/deep_freeze.ts | 1 + .../ui_settings/ui_settings_service.test.ts | 2 +- .../public/dashboard/actions/embeddables.ts | 2 ++ .../public/dashboard/actions/metadata.ts | 2 ++ .../kibana/public/dashboard/actions/panels.ts | 2 ++ .../kibana/public/dashboard/actions/view.ts | 2 ++ src/legacy/ui/public/registry/_registry.d.ts | 1 + x-pack/plugins/apm/common/idx.ts | 1 + .../lib/adapters/framework/adapter_types.ts | 3 +++ .../beats_management/public/lib/types.ts | 4 +--- .../lib/adapters/framework/adapter_types.ts | 3 +++ .../canvas/public/lib/aeroelastic/index.d.ts | 2 ++ x-pack/plugins/infra/common/typed_json.ts | 1 + x-pack/plugins/infra/common/utility_types.ts | 1 + x-pack/plugins/infra/public/lib/lib.ts | 7 +++--- .../plugins/infra/server/lib/sources/types.ts | 2 ++ x-pack/plugins/infra/types/rison_node.d.ts | 2 +- x-pack/plugins/ml/common/types/annotations.ts | 1 + x-pack/plugins/ml/common/types/jobs.ts | 1 + 22 files changed, 52 insertions(+), 19 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 1e0e8cf61b072f..3486d0b12c1ff9 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -75,15 +75,17 @@ module.exports = { // '@typescript-eslint/explicit-member-accessibility': 'error', 'indent': 'off', '@typescript-eslint/indent': [ 'error', 2, { SwitchCase: 1 } ], - // '@typescript-eslint/prefer-function-type': 'error', + '@typescript-eslint/prefer-function-type': 'error', '@typescript-eslint/prefer-interface': 'error', - // '@typescript-eslint/member-ordering': 'error', + '@typescript-eslint/member-ordering': ['error', { + 'default': ['public-static-field', 'static-field', 'instance-field'] + }], '@typescript-eslint/no-angle-bracket-type-assertion': 'error', - // '@typescript-eslint/no-empty-interface': '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/no-var-requires': 'error', + // '@typescript-eslint/no-var-requires': 'error', // can't reproduce tslint behaviour '@typescript-eslint/type-annotation-spacing': 'error', // '@typescript-eslint/unified-signatures': 'error', 'arrow-body-style': 'error', @@ -95,7 +97,12 @@ module.exports = { 'eol-last': 'error', 'eqeqeq': ['error', 'always', {'null': 'ignore'}], 'guard-for-in': 'error', - // 'import/order': 'error', + 'import/order': ['error', { + 'groups': [ + ['external', 'builtin'], + 'internal', + ] + }], 'max-classes-per-file': ['error', 1], 'max-len': [ 'error', { code: 120, ignoreComments: true, ignoreUrls: true } ], 'new-parens': 'error', @@ -118,9 +125,8 @@ module.exports = { 'no-var': 'error', 'object-curly-spacing': 'error', 'object-shorthand': 'error', - // 'one-var': 'error', - 'one-var': ['error', { 'initialized': 'always', 'uninitialized': 'never' }], - // 'prefer-arrow/prefer-arrow-functions': 'error', + // 'one-var': 'error', // can't reproduce tslint behaviour + // 'prefer-arrow/prefer-arrow-functions': [ 'error', { "singleReturnOnly": true } ], // can't reproduce tslint behaviour 'prefer-const': 'error', 'quotes': ['error', 'double', { 'avoidEscape': true }], 'quote-props': ['error', 'consistent-as-needed'], diff --git a/packages/kbn-pm/src/utils/projects_tree.ts b/packages/kbn-pm/src/utils/projects_tree.ts index 61e997d021a17e..c7a13ce2de3480 100644 --- a/packages/kbn-pm/src/utils/projects_tree.ts +++ b/packages/kbn-pm/src/utils/projects_tree.ts @@ -33,10 +33,12 @@ interface ITree { name?: string; children?: ITreeChildren; } +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface ITreeChildren extends Array {} type DirOrProjectName = string | typeof projectKey; +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface IProjectsTree extends Map {} function treeToString(tree: ITree) { diff --git a/packages/kbn-system-loader/src/system_types.ts b/packages/kbn-system-loader/src/system_types.ts index 3d42c12aac5247..338e57e1b5b15a 100644 --- a/packages/kbn-system-loader/src/system_types.ts +++ b/packages/kbn-system-loader/src/system_types.ts @@ -46,6 +46,7 @@ export abstract class KibanaSystem { * * See https://www.typescriptlang.org/docs/handbook/interfaces.html#difference-between-the-static-and-instance-sides-of-classes */ -export interface KibanaSystemClassStatic { - new (kibana: C, deps: D): KibanaSystem; -} +export type KibanaSystemClassStatic = new ( + kibana: C, + deps: D +) => KibanaSystem; diff --git a/src/core/public/injected_metadata/deep_freeze.ts b/src/core/public/injected_metadata/deep_freeze.ts index f172c5de6a9aab..60aa60440e379b 100644 --- a/src/core/public/injected_metadata/deep_freeze.ts +++ b/src/core/public/injected_metadata/deep_freeze.ts @@ -20,6 +20,7 @@ type Freezable = { [k: string]: any } | any[]; // if we define this inside RecursiveReadonly TypeScript complains +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface RecursiveReadonlyArray extends Array> {} type RecursiveReadonly = T extends any[] diff --git a/src/core/public/ui_settings/ui_settings_service.test.ts b/src/core/public/ui_settings/ui_settings_service.test.ts index 0100ceb611ffac..642887b5e42f2a 100644 --- a/src/core/public/ui_settings/ui_settings_service.test.ts +++ b/src/core/public/ui_settings/ui_settings_service.test.ts @@ -19,7 +19,7 @@ function mockClass( module: string, - Class: { new (...args: any[]): T }, + Class: new (...args: any[]) => T, setup: (instance: any, args: any[]) => void ) { const MockClass = jest.fn(function(this: any, ...args: any[]) { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/actions/embeddables.ts b/src/legacy/core_plugins/kibana/public/dashboard/actions/embeddables.ts index 02fc2e8b32f9b2..11e4e542d90d0e 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/actions/embeddables.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/actions/embeddables.ts @@ -17,6 +17,8 @@ * under the License. */ +/* eslint-disable @typescript-eslint/no-empty-interface */ + import _ from 'lodash'; import { createAction } from 'redux-actions'; import { getEmbeddableCustomization, getPanel } from '../../selectors'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/actions/metadata.ts b/src/legacy/core_plugins/kibana/public/dashboard/actions/metadata.ts index 05466c9b8a0818..6b2236ea04dca5 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/actions/metadata.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/actions/metadata.ts @@ -17,6 +17,8 @@ * under the License. */ +/* eslint-disable @typescript-eslint/no-empty-interface */ + import { createAction } from 'redux-actions'; import { KibanaAction } from '../../selectors/types'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/actions/panels.ts b/src/legacy/core_plugins/kibana/public/dashboard/actions/panels.ts index 51069bcfd3ff3f..4919c78200399e 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/actions/panels.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/actions/panels.ts @@ -17,6 +17,8 @@ * under the License. */ +/* eslint-disable @typescript-eslint/no-empty-interface */ + import { createAction } from 'redux-actions'; import { KibanaAction } from '../../selectors/types'; import { PanelId, PanelState, PanelStateMap } from '../selectors'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts b/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts index 1b84df22f8df13..219aa9634a1ad4 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts @@ -17,6 +17,8 @@ * under the License. */ +/* eslint-disable @typescript-eslint/no-empty-interface */ + import { createAction } from 'redux-actions'; import { Filters, Query, RefreshConfig, TimeRange } from 'ui/embeddable'; import { KibanaAction } from '../../selectors/types'; diff --git a/src/legacy/ui/public/registry/_registry.d.ts b/src/legacy/ui/public/registry/_registry.d.ts index 9b95a2e02ee901..42f1bb521763ca 100644 --- a/src/legacy/ui/public/registry/_registry.d.ts +++ b/src/legacy/ui/public/registry/_registry.d.ts @@ -19,6 +19,7 @@ import { IndexedArray, IndexedArrayConfig } from '../indexed_array'; +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface UIRegistry extends IndexedArray {} interface UIRegistrySpec extends IndexedArrayConfig { diff --git a/x-pack/plugins/apm/common/idx.ts b/x-pack/plugins/apm/common/idx.ts index 6513f5f86f1dfc..19c4ccf2ddf03a 100644 --- a/x-pack/plugins/apm/common/idx.ts +++ b/x-pack/plugins/apm/common/idx.ts @@ -8,6 +8,7 @@ * DeepRequiredArray * Nested array condition handler */ +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface DeepRequiredArray extends Array> {} /** diff --git a/x-pack/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts index 0d2d21e42507ba..baadb812614827 100644 --- a/x-pack/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts @@ -3,6 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + +/* eslint-disable @typescript-eslint/no-empty-interface */ + import * as t from 'io-ts'; import { LICENSES } from './../../../../common/constants/security'; diff --git a/x-pack/plugins/beats_management/public/lib/types.ts b/x-pack/plugins/beats_management/public/lib/types.ts index 7887d7eadc3db2..bef611733720ae 100644 --- a/x-pack/plugins/beats_management/public/lib/types.ts +++ b/x-pack/plugins/beats_management/public/lib/types.ts @@ -22,9 +22,7 @@ export interface FrontendLibs { configBlocks: ConfigBlocksLib; } -export interface FramworkAdapterConstructable { - new (uiModule: IModule): FrameworkAdapter; -} +export type FramworkAdapterConstructable = new (uiModule: IModule) => FrameworkAdapter; // FIXME: replace AxiosRequestConfig with something more defined export type RequestConfig = AxiosRequestConfig; diff --git a/x-pack/plugins/beats_management/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/beats_management/server/lib/adapters/framework/adapter_types.ts index b031878e9181bb..095c54344f5b17 100644 --- a/x-pack/plugins/beats_management/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/beats_management/server/lib/adapters/framework/adapter_types.ts @@ -3,6 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + +/* eslint-disable @typescript-eslint/no-empty-interface */ + import { Lifecycle, ResponseToolkit } from 'hapi'; import * as t from 'io-ts'; import { LicenseType } from '../../../../common/constants/security'; diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/index.d.ts b/x-pack/plugins/canvas/public/lib/aeroelastic/index.d.ts index 07c812b5bf648c..65ff3d1eec236c 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic/index.d.ts +++ b/x-pack/plugins/canvas/public/lib/aeroelastic/index.d.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +/* eslint-disable @typescript-eslint/no-empty-interface */ + // linear algebra type f64 = number; // eventual AssemblyScript compatibility; doesn't hurt with vanilla TS either type f = f64; // shorthand diff --git a/x-pack/plugins/infra/common/typed_json.ts b/x-pack/plugins/infra/common/typed_json.ts index ca32bf0b462508..98b5456fe44b84 100644 --- a/x-pack/plugins/infra/common/typed_json.ts +++ b/x-pack/plugins/infra/common/typed_json.ts @@ -6,6 +6,7 @@ export type JsonValue = null | boolean | number | string | JsonObject | JsonArray; +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface JsonArray extends Array {} export interface JsonObject { diff --git a/x-pack/plugins/infra/common/utility_types.ts b/x-pack/plugins/infra/common/utility_types.ts index 8acee0e6f4f7b8..6bcef43d760166 100644 --- a/x-pack/plugins/infra/common/utility_types.ts +++ b/x-pack/plugins/infra/common/utility_types.ts @@ -34,6 +34,7 @@ export type DeepPartial = T extends any[] ? DeepPartialObject : T; +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface DeepPartialArray extends Array> {} type DeepPartialObject = { [P in keyof T]+?: DeepPartial }; diff --git a/x-pack/plugins/infra/public/lib/lib.ts b/x-pack/plugins/infra/public/lib/lib.ts index b235c9c4f70289..759863ce878736 100644 --- a/x-pack/plugins/infra/public/lib/lib.ts +++ b/x-pack/plugins/infra/public/lib/lib.ts @@ -45,9 +45,10 @@ export interface InfraFrameworkAdapter { renderBreadcrumbs(component: React.ReactElement): void; } -export interface InfraFramworkAdapterConstructable { - new (uiModule: IModule, timezoneProvider: InfraTimezoneProvider): InfraFrameworkAdapter; -} +export type InfraFramworkAdapterConstructable = new ( + uiModule: IModule, + timezoneProvider: InfraTimezoneProvider +) => InfraFrameworkAdapter; // TODO: replace AxiosRequestConfig with something more defined export type InfraRequestConfig = AxiosRequestConfig; diff --git a/x-pack/plugins/infra/server/lib/sources/types.ts b/x-pack/plugins/infra/server/lib/sources/types.ts index b3dcfde1858740..e7a8d04c33dfcb 100644 --- a/x-pack/plugins/infra/server/lib/sources/types.ts +++ b/x-pack/plugins/infra/server/lib/sources/types.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +/* eslint-disable @typescript-eslint/no-empty-interface */ + import * as runtimeTypes from 'io-ts'; import moment from 'moment'; diff --git a/x-pack/plugins/infra/types/rison_node.d.ts b/x-pack/plugins/infra/types/rison_node.d.ts index 54a67ce492396b..0fd99b2f0c2217 100644 --- a/x-pack/plugins/infra/types/rison_node.d.ts +++ b/x-pack/plugins/infra/types/rison_node.d.ts @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -// eslint-disable variable-name declare module 'rison-node' { export type RisonValue = null | boolean | number | string | RisonObject | RisonArray; + // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface RisonArray extends Array {} export interface RisonObject { diff --git a/x-pack/plugins/ml/common/types/annotations.ts b/x-pack/plugins/ml/common/types/annotations.ts index 443f69604d448f..f2f6fe111f5cc5 100644 --- a/x-pack/plugins/ml/common/types/annotations.ts +++ b/x-pack/plugins/ml/common/types/annotations.ts @@ -84,6 +84,7 @@ export function isAnnotation(arg: any): arg is Annotation { ); } +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Annotations extends Array {} export function isAnnotations(arg: any): arg is Annotations { diff --git a/x-pack/plugins/ml/common/types/jobs.ts b/x-pack/plugins/ml/common/types/jobs.ts index 5484a288308212..7b18ebccd5244b 100644 --- a/x-pack/plugins/ml/common/types/jobs.ts +++ b/x-pack/plugins/ml/common/types/jobs.ts @@ -43,6 +43,7 @@ export function isMlJob(arg: any): arg is MlJob { return typeof arg.job_id === 'string'; } +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface MlJobs extends Array {} export function isMlJobs(arg: any): arg is MlJobs { From 2aa3526293bd3fd61a2c6839851257bdd1a8e19c Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 26 Mar 2019 02:28:43 +0000 Subject: [PATCH 20/36] chore(NA): fix last rules and comment out what are the ones still failing. --- packages/eslint-config-kibana/typescript.js | 40 ++++++++++++++----- packages/kbn-es-query/src/kuery/ast/ast.d.ts | 1 + .../migrations/core/call_cluster.ts | 2 + .../lib/adapters/framework/adapter_types.ts | 2 + 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 3486d0b12c1ff9..48e863cf8ff22f 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -70,8 +70,18 @@ module.exports = { '@typescript-eslint/array-type': ['error', 'array-simple'], '@typescript-eslint/ban-types': 'error', 'camelcase': 'off', - // '@typescript-eslint/camelcase': 'error', + // TODO: still failing in ~8 different files and it doesn't offer + // the configuration we need in order to get it working there. + // Im thinking about disabling the rule on those files with + // in-file comments. + '@typescript-eslint/camelcase': ['error', { + 'properties': 'never', + 'ignoreDestructuring': true + }], '@typescript-eslint/class-name-casing': 'error', + // TODO: disable this rule until a PR with more options to configure + // get merged and we can then reproduce the old behaviour + // https://github.com/typescript-eslint/typescript-eslint/pull/322 // '@typescript-eslint/explicit-member-accessibility': 'error', 'indent': 'off', '@typescript-eslint/indent': [ 'error', 2, { SwitchCase: 1 } ], @@ -85,9 +95,10 @@ module.exports = { '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-namespace': 'error', '@typescript-eslint/no-triple-slash-reference': 'error', - // '@typescript-eslint/no-var-requires': 'error', // can't reproduce tslint behaviour + // TODO: I'm thinking about not including this one + // '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/type-annotation-spacing': 'error', - // '@typescript-eslint/unified-signatures': 'error', + '@typescript-eslint/unified-signatures': 'error', 'arrow-body-style': 'error', 'arrow-parens': 'error', 'comma-dangle': ['error', 'always-multiline'], @@ -97,12 +108,14 @@ module.exports = { 'eol-last': 'error', 'eqeqeq': ['error', 'always', {'null': 'ignore'}], 'guard-for-in': 'error', - 'import/order': ['error', { - 'groups': [ - ['external', 'builtin'], - 'internal', - ] - }], + // TODO: this should be replaced by a custom rule as this plugin + // don't identify individual groups + // 'import/order': ['error', { + // 'groups': [ + // ['external', 'builtin'], + // 'internal' + // ], + // }], 'max-classes-per-file': ['error', 1], 'max-len': [ 'error', { code: 120, ignoreComments: true, ignoreUrls: true } ], 'new-parens': 'error', @@ -125,6 +138,9 @@ module.exports = { 'no-var': 'error', 'object-curly-spacing': 'error', 'object-shorthand': 'error', + // TODO: Those 2 rules are not working. The first one reports a lot of errors + // in a bunch of a different files. The second one still output errors in a lot + // of cases too. I'm thinking about removing them. // 'one-var': 'error', // can't reproduce tslint behaviour // 'prefer-arrow/prefer-arrow-functions': [ 'error', { "singleReturnOnly": true } ], // can't reproduce tslint behaviour 'prefer-const': 'error', @@ -132,7 +148,11 @@ module.exports = { 'quote-props': ['error', 'consistent-as-needed'], 'radix': 'error', 'semi': 'error', - // 'sort-keys': 'error', + // TODO: It is not working at all, I'm just thinking about disabling it at all + // 'sort-keys': ['error', 'asc', { + // 'caseSensitive': false, + // 'natural': true + // }], 'space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', diff --git a/packages/kbn-es-query/src/kuery/ast/ast.d.ts b/packages/kbn-es-query/src/kuery/ast/ast.d.ts index df81c8651c4cb6..484abac809bcd3 100644 --- a/packages/kbn-es-query/src/kuery/ast/ast.d.ts +++ b/packages/kbn-es-query/src/kuery/ast/ast.d.ts @@ -38,6 +38,7 @@ interface JsonObject { [key: string]: JsonValue; } +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface JsonArray extends Array {} export function fromKueryExpression( diff --git a/src/legacy/server/saved_objects/migrations/core/call_cluster.ts b/src/legacy/server/saved_objects/migrations/core/call_cluster.ts index 8ce9ace5f0b1cb..961961597855a8 100644 --- a/src/legacy/server/saved_objects/migrations/core/call_cluster.ts +++ b/src/legacy/server/saved_objects/migrations/core/call_cluster.ts @@ -25,6 +25,7 @@ import { IndexMapping } from '../../../mappings'; +/* eslint-disable @typescript-eslint/unified-signatures */ export interface CallCluster { (path: 'bulk', opts: { body: object[] }): Promise; (path: 'count', opts: CountOpts): Promise<{ count: number; _shards: ShardsInfo }>; @@ -48,6 +49,7 @@ export interface CallCluster { error?: ErrorResponse; }>; } +/* eslint-enable @typescript-eslint/unified-signatures */ /////////////////////////////////////////////////////////////////// // callCluster argument type definitions diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts index 65af9b5a7a3dde..0fca1f35dc4dbd 100644 --- a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts @@ -14,6 +14,7 @@ import { InfraMetricModel } from '../metrics/adapter_types'; export const internalInfraFrameworkRequest = Symbol('internalInfraFrameworkRequest'); +/* eslint-disable @typescript-eslint/unified-signatures */ export interface InfraBackendFrameworkAdapter { version: string; exposeStaticDir(urlPath: string, dir: string): void; @@ -60,6 +61,7 @@ export interface InfraBackendFrameworkAdapter { filters: JsonObject[] ): Promise; } +/* eslint-enable @typescript-eslint/unified-signatures */ export interface InfraFrameworkRequest< InternalRequest extends InfraWrappableRequest = InfraWrappableRequest From dd6f7d09592997e640a0e10c6d72cf59b35313a9 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 26 Mar 2019 02:31:54 +0000 Subject: [PATCH 21/36] chore(NA): comment out camelcase rule. --- packages/eslint-config-kibana/typescript.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 48e863cf8ff22f..3ddd3f86194d57 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -74,10 +74,10 @@ module.exports = { // the configuration we need in order to get it working there. // Im thinking about disabling the rule on those files with // in-file comments. - '@typescript-eslint/camelcase': ['error', { - 'properties': 'never', - 'ignoreDestructuring': true - }], + // '@typescript-eslint/camelcase': ['error', { + // 'properties': 'never', + // 'ignoreDestructuring': true + // }], '@typescript-eslint/class-name-casing': 'error', // TODO: disable this rule until a PR with more options to configure // get merged and we can then reproduce the old behaviour From e6425e70434bccf7da95faf35fcee34ece87af55 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 26 Mar 2019 03:58:38 +0000 Subject: [PATCH 22/36] chore(NA): regenerate kbn pm dist. --- packages/kbn-pm/dist/index.js | 1040 ++++++++++++------------ packages/kbn-ui-framework/package.json | 4 +- 2 files changed, 522 insertions(+), 522 deletions(-) diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index b2091b194b6082..54aec910d71ece 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -1655,158 +1655,158 @@ convert.rgb.gray = function (rgb) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; /***/ }), @@ -4212,7 +4212,7 @@ const log = exports.log = { * @param ...args */ write(...args) { - // eslint-disable no-console + // eslint-disable-next-line no-console console.log(...args); } }; @@ -20185,192 +20185,192 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed 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 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __exportStar(m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} /***/ }), @@ -40460,169 +40460,169 @@ module.exports.namespace = namespace; /* 428 */ /***/ (function(module, exports, __webpack_require__) { - -/** - * Expose `Emitter`. - */ - -if (true) { - module.exports = Emitter; -} - -/** - * Initialize a new `Emitter`. - * - * @api public - */ - -function Emitter(obj) { - if (obj) return mixin(obj); -}; - -/** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; -} - -/** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.on = -Emitter.prototype.addEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - (this._callbacks['$' + event] = this._callbacks['$' + event] || []) - .push(fn); - return this; -}; - -/** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.once = function(event, fn){ - function on() { - this.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; -}; - -/** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.off = -Emitter.prototype.removeListener = -Emitter.prototype.removeAllListeners = -Emitter.prototype.removeEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - - // all - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - - // specific event - var callbacks = this._callbacks['$' + event]; - if (!callbacks) return this; - - // remove all handlers - if (1 == arguments.length) { - delete this._callbacks['$' + event]; - return this; - } - - // remove specific handler - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - return this; -}; - -/** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} - */ - -Emitter.prototype.emit = function(event){ - this._callbacks = this._callbacks || {}; - var args = [].slice.call(arguments, 1) - , callbacks = this._callbacks['$' + event]; - - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - - return this; -}; - -/** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public - */ - -Emitter.prototype.listeners = function(event){ - this._callbacks = this._callbacks || {}; - return this._callbacks['$' + event] || []; -}; - -/** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public - */ - -Emitter.prototype.hasListeners = function(event){ - return !! this.listeners(event).length; -}; + +/** + * Expose `Emitter`. + */ + +if (true) { + module.exports = Emitter; +} + +/** + * Initialize a new `Emitter`. + * + * @api public + */ + +function Emitter(obj) { + if (obj) return mixin(obj); +}; + +/** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; +} + +/** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.on = +Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []) + .push(fn); + return this; +}; + +/** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.once = function(event, fn){ + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; +}; + +/** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.off = +Emitter.prototype.removeListener = +Emitter.prototype.removeAllListeners = +Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + // specific event + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + return this; +}; + +/** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + +Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + var args = [].slice.call(arguments, 1) + , callbacks = this._callbacks['$' + event]; + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; +}; + +/** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + +Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; +}; + +/** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + +Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; +}; /***/ }), @@ -47072,23 +47072,23 @@ module.exports = function (encodedURI) { /* 482 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var path = __webpack_require__(16) - -"use strict" - -function urix(aPath) { - if (path.sep === "\\") { - return aPath - .replace(/\\/g, "/") - .replace(/^[a-z]:\/?/i, "/") - } - return aPath -} - -module.exports = urix +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var path = __webpack_require__(16) + +"use strict" + +function urix(aPath) { + if (path.sep === "\\") { + return aPath + .replace(/\\/g, "/") + .replace(/^[a-z]:\/?/i, "/") + } + return aPath +} + +module.exports = urix /***/ }), @@ -55290,4 +55290,4 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a const isKibanaDep = depVersion => depVersion.includes('../../kibana/'); /***/ }) -/******/ ]); +/******/ ]); \ No newline at end of file diff --git a/packages/kbn-ui-framework/package.json b/packages/kbn-ui-framework/package.json index 87e586e90ec2f5..3d146ce5052f94 100644 --- a/packages/kbn-ui-framework/package.json +++ b/packages/kbn-ui-framework/package.json @@ -26,8 +26,8 @@ "uuid": "3.0.1" }, "peerDependencies": { - "enzyme": "3.2.0", - "enzyme-adapter-react-16": "^1.1.1" + "enzyme": "^3.7.0", + "enzyme-adapter-react-16": "^1.9.0" }, "devDependencies": { "@elastic/eui": "0.0.23", From 8a67fbb1286ff613c13833134b2005dc9dce1f50 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 26 Mar 2019 04:31:28 +0000 Subject: [PATCH 23/36] chore(NA): updated snapshots. --- .../get_filter_from_must.test.ts.snap | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_from_must.test.ts.snap b/x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_from_must.test.ts.snap index fba2335c8f8ac2..e21284be5c17a0 100644 --- a/x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_from_must.test.ts.snap +++ b/x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_from_must.test.ts.snap @@ -17,23 +17,6 @@ Object { } `; -exports[`getFilterFromMust applies date range only for undefined filter string 2`] = ` -Object { - "bool": Object { - "filter": Array [ - Object { - "range": Object { - "@timestamp": Object { - "gte": "start range", - "lte": "end range", - }, - }, - }, - ], - }, -} -`; - exports[`getFilterFromMust applies filter clauses to output object 1`] = ` Object { "bool": Object { From 77b6509bbbdfc8ffbc030b671a3301e37af1c017 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 26 Mar 2019 04:35:12 +0000 Subject: [PATCH 24/36] chore(NA): updated snapshots. --- .../query_bar/components/__snapshots__/query_bar.test.tsx.snap | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/legacy/ui/public/query_bar/components/__snapshots__/query_bar.test.tsx.snap b/src/legacy/ui/public/query_bar/components/__snapshots__/query_bar.test.tsx.snap index 0cec54001643b3..24806a9dbae27c 100644 --- a/src/legacy/ui/public/query_bar/components/__snapshots__/query_bar.test.tsx.snap +++ b/src/legacy/ui/public/query_bar/components/__snapshots__/query_bar.test.tsx.snap @@ -24,7 +24,6 @@ exports[`QueryBar Should disable autoFocus on EuiFieldText when disableAutoFocus >
Date: Wed, 27 Mar 2019 02:56:33 +0000 Subject: [PATCH 25/36] chore(NA): disabled sort-keys rule. --- packages/eslint-config-kibana/typescript.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 3fea4d8f220763..ad2c469826d3cd 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -147,11 +147,6 @@ module.exports = { 'quote-props': ['error', 'consistent-as-needed'], 'radix': 'error', 'semi': 'error', - // TODO: It is not working at all, I'm just thinking about disabling it at all - // 'sort-keys': ['error', 'asc', { - // 'caseSensitive': false, - // 'natural': true - // }], 'space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', From 9486813aa2f05502b97930a4c4196de167126f96 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 27 Mar 2019 03:03:08 +0000 Subject: [PATCH 26/36] chore(NA): remove rule prefer-arrow/prefer-arrow-functions. --- package.json | 1 - packages/eslint-config-kibana/package.json | 1 - packages/eslint-config-kibana/typescript.js | 2 -- src/legacy/ui/public/utils/memoize.ts | 1 - x-pack/plugins/infra/public/utils/memoize_last.ts | 1 - yarn.lock | 5 ----- 6 files changed, 11 deletions(-) diff --git a/package.json b/package.json index 18da354d6a4932..0774b40792bc4a 100644 --- a/package.json +++ b/package.json @@ -346,7 +346,6 @@ "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", - "eslint-plugin-prefer-arrow": "^1.1.5", "eslint-plugin-prefer-object-spread": "^1.2.1", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.12.4", diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index bac0d900bd323e..d7e915a7c17598 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -26,7 +26,6 @@ "eslint-plugin-jest": "^22.4.1", "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-no-unsanitized": "^3.0.2", - "eslint-plugin-prefer-arrow": "^1.1.5", "eslint-plugin-prefer-object-spread": "^1.2.1", "eslint-plugin-react": "^7.12.4" } diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index ad2c469826d3cd..9989a56b21113d 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -25,7 +25,6 @@ module.exports = { 'ban', 'import', 'jsx-a11y', - 'prefer-arrow', 'prefer-object-spread', ], @@ -141,7 +140,6 @@ module.exports = { // in a bunch of a different files. The second one still output errors in a lot // of cases too. I'm thinking about removing them. // 'one-var': 'error', // can't reproduce tslint behaviour - // 'prefer-arrow/prefer-arrow-functions': [ 'error', { "singleReturnOnly": true } ], // can't reproduce tslint behaviour 'prefer-const': 'error', 'quotes': ['error', 'double', { 'avoidEscape': true }], 'quote-props': ['error', 'consistent-as-needed'], diff --git a/src/legacy/ui/public/utils/memoize.ts b/src/legacy/ui/public/utils/memoize.ts index 2ca665775a0a0e..fea1b892620810 100644 --- a/src/legacy/ui/public/utils/memoize.ts +++ b/src/legacy/ui/public/utils/memoize.ts @@ -35,7 +35,6 @@ function memoizeLast any>(func: T): T { let prevCall: MemoizedCall | NeverCalled = neverCalled; // We need to use a `function` here for proper this passing. - // eslint-disable-next-line prefer-arrow/prefer-arrow-functions const memoizedFunction = function(this: any, ...args: any[]) { if ( prevCall !== neverCalled && diff --git a/x-pack/plugins/infra/public/utils/memoize_last.ts b/x-pack/plugins/infra/public/utils/memoize_last.ts index aa33839af9f2ac..2f24f5bb7f6f24 100644 --- a/x-pack/plugins/infra/public/utils/memoize_last.ts +++ b/x-pack/plugins/infra/public/utils/memoize_last.ts @@ -22,7 +22,6 @@ function memoizeLast any>(func: T): T { let prevCall: MemoizedCall | NeverCalled = neverCalled; // We need to use a `function` here for proper this passing. - // eslint-disable-next-line prefer-arrow/prefer-arrow-functions const memoizedFunction = function(this: any, ...args: any[]) { if ( prevCall !== neverCalled && diff --git a/yarn.lock b/yarn.lock index 7537e3faf4a6a0..b99d2472e0ce66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9306,11 +9306,6 @@ eslint-plugin-no-unsanitized@^3.0.2: resolved "https://registry.yarnpkg.com/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-3.0.2.tgz#83c6fcf8e34715112757e03dd4ee436dce29ed45" integrity sha512-JnwpoH8Sv4QOjrTDutENBHzSnyYtspdjtglYtqUtAHe6f6LLKqykJle+UwFPg23GGwt5hI3amS9CRDezW8GAww== -eslint-plugin-prefer-arrow@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.1.5.tgz#ad2b91b126eb208547da7af9e9719b3598a5a063" - integrity sha512-vjwd/I3R0jjMbzjMxaekzHz5/ohTLparvxtW5f/7tAXvM8h4/z/C4HR6l7qv5e0JnYRSTfyzad0OiJxlnI1bBw== - eslint-plugin-prefer-object-spread@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-object-spread/-/eslint-plugin-prefer-object-spread-1.2.1.tgz#27fb91853690cceb3ae6101d9c8aecc6a67a402c" From 8c7d7df717656214e075b6518a73328926bb3aca Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 27 Mar 2019 04:46:16 +0000 Subject: [PATCH 27/36] chore(NA): fix for @typescript-eslint/no-var-requires rule. --- packages/eslint-config-kibana/typescript.js | 20 ++++++------------- packages/kbn-i18n/src/core/i18n.test.ts | 2 ++ .../utils/link_project_executables.test.ts | 2 ++ src/core/server/config/env.ts | 2 +- src/core/server/legacy/legacy_service.ts | 1 + .../logging/appenders/appenders.test.ts | 1 + .../console/console_appender.test.ts | 1 + .../appenders/file/file_appender.test.ts | 1 + src/core/server/plugins/plugin.ts | 1 + .../kibana/public/dashboard/actions/panels.ts | 12 +++++------ .../kibana/public/dashboard/actions/view.ts | 6 +++--- .../public/dashboard/panel/panel_utils.ts | 2 ++ .../public/dashboard/reducers/panels.ts | 4 ++-- .../kibana/public/dashboard/reducers/view.ts | 2 +- .../server/routes/cluster_checkup.test.ts | 2 +- 15 files changed, 31 insertions(+), 28 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 9989a56b21113d..0ea61debf3ed1f 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -68,14 +68,11 @@ module.exports = { '@typescript-eslint/array-type': ['error', 'array-simple'], '@typescript-eslint/ban-types': 'error', 'camelcase': 'off', - // TODO: still failing in ~8 different files and it doesn't offer - // the configuration we need in order to get it working there. - // Im thinking about disabling the rule on those files with - // in-file comments. - // '@typescript-eslint/camelcase': ['error', { - // 'properties': 'never', - // 'ignoreDestructuring': true - // }], + '@typescript-eslint/camelcase': ['error', { + 'properties': 'never', + 'ignoreDestructuring': true, + 'allow': ['^[A-Z0-9_]+$'] + }], '@typescript-eslint/class-name-casing': 'error', // TODO: disable this rule until a PR with more options to configure // get merged and we can then reproduce the old behaviour @@ -93,8 +90,7 @@ module.exports = { '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-namespace': 'error', '@typescript-eslint/no-triple-slash-reference': 'error', - // TODO: I'm thinking about not including this one - // '@typescript-eslint/no-var-requires': 'error', + '@typescript-eslint/no-var-requires': 'error', '@typescript-eslint/type-annotation-spacing': 'error', '@typescript-eslint/unified-signatures': 'error', 'arrow-body-style': 'error', @@ -136,10 +132,6 @@ module.exports = { 'no-var': 'error', 'object-curly-spacing': 'error', 'object-shorthand': 'error', - // TODO: Those 2 rules are not working. The first one reports a lot of errors - // in a bunch of a different files. The second one still output errors in a lot - // of cases too. I'm thinking about removing them. - // 'one-var': 'error', // can't reproduce tslint behaviour 'prefer-const': 'error', 'quotes': ['error', 'double', { 'avoidEscape': true }], 'quote-props': ['error', 'consistent-as-needed'], diff --git a/packages/kbn-i18n/src/core/i18n.test.ts b/packages/kbn-i18n/src/core/i18n.test.ts index ffdf9f8e2bcaf0..0f79b23d63c509 100644 --- a/packages/kbn-i18n/src/core/i18n.test.ts +++ b/packages/kbn-i18n/src/core/i18n.test.ts @@ -17,6 +17,8 @@ * under the License. */ +/* eslint-disable @typescript-eslint/no-var-requires */ + import * as i18nModule from './i18n'; describe('I18n engine', () => { diff --git a/packages/kbn-pm/src/utils/link_project_executables.test.ts b/packages/kbn-pm/src/utils/link_project_executables.test.ts index ac0b69d01f798e..a6334ec850860e 100644 --- a/packages/kbn-pm/src/utils/link_project_executables.test.ts +++ b/packages/kbn-pm/src/utils/link_project_executables.test.ts @@ -17,6 +17,8 @@ * under the License. */ +/* eslint-disable @typescript-eslint/no-var-requires */ + jest.mock('./fs'); import { resolve } from 'path'; diff --git a/src/core/server/config/env.ts b/src/core/server/config/env.ts index 430fb84e04f73e..d67880171a69f0 100644 --- a/src/core/server/config/env.ts +++ b/src/core/server/config/env.ts @@ -21,7 +21,7 @@ import { resolve } from 'path'; import process from 'process'; // `require` is necessary for this to work inside x-pack code as well -// eslint-disable no-var-requires +// eslint-disable-next-line @typescript-eslint/no-var-requires const pkg = require('../../../../package.json'); export interface PackageInfo { diff --git a/src/core/server/legacy/legacy_service.ts b/src/core/server/legacy/legacy_service.ts index 8d85516f29aa74..3a24ef03ccf6a8 100644 --- a/src/core/server/legacy/legacy_service.ts +++ b/src/core/server/legacy/legacy_service.ts @@ -132,6 +132,7 @@ export class LegacyService implements CoreService { } private async createKbnServer(config: Config, { elasticsearch, http, plugins }: SetupDeps) { + // eslint-disable-next-line @typescript-eslint/no-var-requires const KbnServer = require('../../../legacy/server/kbn_server'); const kbnServer: LegacyKbnServer = new KbnServer(getLegacyRawConfig(config), { // If core HTTP service is run we'll receive internal server reference and diff --git a/src/core/server/logging/appenders/appenders.test.ts b/src/core/server/logging/appenders/appenders.test.ts index df528f4c58cd5a..9702184d08238e 100644 --- a/src/core/server/logging/appenders/appenders.test.ts +++ b/src/core/server/logging/appenders/appenders.test.ts @@ -19,6 +19,7 @@ const mockCreateLayout = jest.fn(); jest.mock('../layouts/layouts', () => { + // eslint-disable-next-line @typescript-eslint/no-var-requires const { schema } = require('@kbn/config-schema'); return { Layouts: { diff --git a/src/core/server/logging/appenders/console/console_appender.test.ts b/src/core/server/logging/appenders/console/console_appender.test.ts index 2ae83be7461628..364f0be7fadc34 100644 --- a/src/core/server/logging/appenders/console/console_appender.test.ts +++ b/src/core/server/logging/appenders/console/console_appender.test.ts @@ -18,6 +18,7 @@ */ jest.mock('../../layouts/layouts', () => { + // eslint-disable-next-line @typescript-eslint/no-var-requires const { schema } = require('@kbn/config-schema'); return { Layouts: { diff --git a/src/core/server/logging/appenders/file/file_appender.test.ts b/src/core/server/logging/appenders/file/file_appender.test.ts index 1d9ef33995955a..bc6aafb571c19b 100644 --- a/src/core/server/logging/appenders/file/file_appender.test.ts +++ b/src/core/server/logging/appenders/file/file_appender.test.ts @@ -18,6 +18,7 @@ */ jest.mock('../../layouts/layouts', () => { + // eslint-disable-next-line @typescript-eslint/no-var-requires const { schema } = require('@kbn/config-schema'); return { Layouts: { diff --git a/src/core/server/plugins/plugin.ts b/src/core/server/plugins/plugin.ts index fc2e63d0f07163..b66de9b9f31c8c 100644 --- a/src/core/server/plugins/plugin.ts +++ b/src/core/server/plugins/plugin.ts @@ -201,6 +201,7 @@ export class Plugin< private createPluginInstance() { this.log.debug('Initializing plugin'); + // eslint-disable-next-line @typescript-eslint/no-var-requires const pluginDefinition = require(join(this.path, 'server')); if (!('plugin' in pluginDefinition)) { throw new Error(`Plugin "${this.name}" does not export "plugin" definition (${this.path}).`); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/actions/panels.ts b/src/legacy/core_plugins/kibana/public/dashboard/actions/panels.ts index 4919c78200399e..d29e8da9e2eca6 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/actions/panels.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/actions/panels.ts @@ -26,8 +26,8 @@ import { PanelId, PanelState, PanelStateMap } from '../selectors'; export enum PanelActionTypeKeys { DELETE_PANEL = 'DELETE_PANEL', UPDATE_PANEL = 'UPDATE_PANEL', - RESET_PANEl_TITLE = 'RESET_PANEl_TITLE', - SET_PANEl_TITLE = 'SET_PANEl_TITLE', + RESET_PANEL_TITLE = 'RESET_PANEL_TITLE', + SET_PANEL_TITLE = 'SET_PANEL_TITLE', UPDATE_PANELS = 'UPDATE_PANELS', SET_PANELS = 'SET_PANELS', } @@ -42,7 +42,7 @@ export interface UpdatePanelsAction extends KibanaAction {} export interface ResetPanelTitleAction - extends KibanaAction {} + extends KibanaAction {} export interface SetPanelTitleActionPayload { panelId: PanelId; @@ -50,7 +50,7 @@ export interface SetPanelTitleActionPayload { } export interface SetPanelTitleAction - extends KibanaAction {} + extends KibanaAction {} export interface SetPanelsAction extends KibanaAction {} @@ -65,9 +65,9 @@ export type PanelActions = export const deletePanel = createAction(PanelActionTypeKeys.DELETE_PANEL); export const updatePanel = createAction(PanelActionTypeKeys.UPDATE_PANEL); -export const resetPanelTitle = createAction(PanelActionTypeKeys.RESET_PANEl_TITLE); +export const resetPanelTitle = createAction(PanelActionTypeKeys.RESET_PANEL_TITLE); export const setPanelTitle = createAction( - PanelActionTypeKeys.SET_PANEl_TITLE + PanelActionTypeKeys.SET_PANEL_TITLE ); export const updatePanels = createAction(PanelActionTypeKeys.UPDATE_PANELS); export const setPanels = createAction(PanelActionTypeKeys.SET_PANELS); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts b/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts index 219aa9634a1ad4..6b2bbc5fefaadc 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/actions/view.ts @@ -28,7 +28,7 @@ import { PanelId } from '../selectors'; export enum ViewActionTypeKeys { UPDATE_VIEW_MODE = 'UPDATE_VIEW_MODE', SET_VISIBLE_CONTEXT_MENU_PANEL_ID = 'SET_VISIBLE_CONTEXT_MENU_PANEL_ID', - MAXIMIZE_PANEl = 'MAXIMIZE_PANEl', + MAXIMIZE_PANEL = 'MAXIMIZE_PANEL', MINIMIZE_PANEL = 'MINIMIZE_PANEL', UPDATE_IS_FULL_SCREEN_MODE = 'UPDATE_IS_FULL_SCREEN_MODE', UPDATE_USE_MARGINS = 'UPDATE_USE_MARGINS', @@ -50,7 +50,7 @@ export interface CloseContextMenuAction extends KibanaAction {} export interface MaximizePanelAction - extends KibanaAction {} + extends KibanaAction {} export interface MinimizePanelAction extends KibanaAction {} @@ -94,7 +94,7 @@ export const closeContextMenu = createAction(ViewActionTypeKeys.CLOSE_CONTEXT_ME export const setVisibleContextMenuPanelId = createAction( ViewActionTypeKeys.SET_VISIBLE_CONTEXT_MENU_PANEL_ID ); -export const maximizePanel = createAction(ViewActionTypeKeys.MAXIMIZE_PANEl); +export const maximizePanel = createAction(ViewActionTypeKeys.MAXIMIZE_PANEL); export const minimizePanel = createAction(ViewActionTypeKeys.MINIMIZE_PANEL); export const updateIsFullScreenMode = createAction( ViewActionTypeKeys.UPDATE_IS_FULL_SCREEN_MODE diff --git a/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_utils.ts b/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_utils.ts index c4ea15eac5374f..b74fbe68f00a09 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_utils.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_utils.ts @@ -35,6 +35,7 @@ export interface SemanticVersion { export class PanelUtils { // 6.1 switched from gridster to react grid. React grid uses different variables for tracking layout + // eslint-disable-next-line @typescript-eslint/camelcase public static convertPanelDataPre_6_1(panel: any): PanelState { ['col', 'row'].forEach(key => { if (!_.has(panel, key)) { @@ -69,6 +70,7 @@ export class PanelUtils { // 1) decrease column height from 100 to 20. // 2) increase rows from 12 to 48 // Need to scale pre 6.3 panels so they maintain the same layout + // eslint-disable-next-line @typescript-eslint/camelcase public static convertPanelDataPre_6_3( panel: { gridData: GridData; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/reducers/panels.ts b/src/legacy/core_plugins/kibana/public/dashboard/reducers/panels.ts index f4961a61c01b80..b9db8f6bc22b44 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/reducers/panels.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/reducers/panels.ts @@ -67,9 +67,9 @@ export const panelsReducer: Reducer = (panels = {}, action): Pane return updatePanel(panels, action.payload); case PanelActionTypeKeys.UPDATE_PANELS: return updatePanels(panels, action.payload); - case PanelActionTypeKeys.RESET_PANEl_TITLE: + case PanelActionTypeKeys.RESET_PANEL_TITLE: return resetPanelTitle(panels, action.payload); - case PanelActionTypeKeys.SET_PANEl_TITLE: + case PanelActionTypeKeys.SET_PANEL_TITLE: return setPanelTitle(panels, action.payload); case PanelActionTypeKeys.SET_PANELS: return setPanels(panels, action.payload); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts b/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts index 3792203bcb2312..4eb8c6ffd670b4 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts @@ -102,7 +102,7 @@ export const viewReducer: Reducer = ( switch ((action as ViewActions).type) { case ViewActionTypeKeys.MINIMIZE_PANEL: return minimizePanel(view); - case ViewActionTypeKeys.MAXIMIZE_PANEl: + case ViewActionTypeKeys.MAXIMIZE_PANEL: return maximizePanel(view, action.payload); case ViewActionTypeKeys.SET_VISIBLE_CONTEXT_MENU_PANEL_ID: return setVisibleContextMenuPanelId(view, action.payload); diff --git a/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts b/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts index 59be6b52a0d4cd..04a05dc2b0e9cb 100644 --- a/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/routes/cluster_checkup.test.ts @@ -12,7 +12,7 @@ import { EsVersionPrecheck } from '../lib/es_version_precheck'; import { registerClusterCheckupRoutes } from './cluster_checkup'; // Need to require to get mock on named export to work. -// eslint-disable no-var-requires +// eslint-disable-next-line @typescript-eslint/no-var-requires const MigrationApis = require('../lib/es_migration_apis'); MigrationApis.getUpgradeAssistantStatus = jest.fn(); From 62226f105b5a419a44a267025e6e5a1f4944aa79 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 27 Mar 2019 04:52:40 +0000 Subject: [PATCH 28/36] chore(NA): fixes for @typescript-eslint/camelcase rule. --- src/legacy/server/saved_objects/serialization/index.ts | 2 ++ src/legacy/ui/public/utils/decode_geo_hash.ts | 6 +++--- .../beats_management/public/components/tag/tag_edit.tsx | 2 +- x-pack/plugins/beats_management/server/lib/beats.ts | 1 + x-pack/plugins/infra/common/errors/metrics.ts | 1 + .../infra/public/containers/with_state_from_location.tsx | 1 + .../infra/server/lib/adapters/metrics/adapter_types.ts | 6 +++--- x-pack/plugins/infra/types/rison_node.d.ts | 2 ++ 8 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/legacy/server/saved_objects/serialization/index.ts b/src/legacy/server/saved_objects/serialization/index.ts index 00a9e81e5c1c36..997c5d38b69db2 100644 --- a/src/legacy/server/saved_objects/serialization/index.ts +++ b/src/legacy/server/saved_objects/serialization/index.ts @@ -22,6 +22,8 @@ * the raw document format as stored in ElasticSearch. */ +/* eslint-disable @typescript-eslint/camelcase */ + import uuid from 'uuid'; import { SavedObjectsSchema } from '../schema'; import { decodeVersion, encodeVersion } from '../version'; diff --git a/src/legacy/ui/public/utils/decode_geo_hash.ts b/src/legacy/ui/public/utils/decode_geo_hash.ts index 9d7585384c82a8..e6ab7121038a15 100644 --- a/src/legacy/ui/public/utils/decode_geo_hash.ts +++ b/src/legacy/ui/public/utils/decode_geo_hash.ts @@ -41,10 +41,10 @@ export function decodeGeoHash(geohash: number[]): Coordinates { const mask: number = BITS[j]; if (isEven) { lonErr = lonErr /= 2; - refine_interval(lon, cd, mask); + refineInterval(lon, cd, mask); } else { latErr = latErr /= 2; - refine_interval(lat, cd, mask); + refineInterval(lat, cd, mask); } isEven = !isEven; } @@ -57,7 +57,7 @@ export function decodeGeoHash(geohash: number[]): Coordinates { } as Coordinates; } -function refine_interval(interval: number[], cd: number, mask: number) { +function refineInterval(interval: number[], cd: number, mask: number) { if (cd & mask) { /* eslint-disable-line */ interval[0] = (interval[0] + interval[1]) / 2; } else { diff --git a/x-pack/plugins/beats_management/public/components/tag/tag_edit.tsx b/x-pack/plugins/beats_management/public/components/tag/tag_edit.tsx index 3a82b2bee23701..61e5cb9bea7a5c 100644 --- a/x-pack/plugins/beats_management/public/components/tag/tag_edit.tsx +++ b/x-pack/plugins/beats_management/public/components/tag/tag_edit.tsx @@ -147,7 +147,7 @@ export class TagEdit extends React.PureComponent {
{ if (action === 'delete') { this.props.onConfigRemoved(block); diff --git a/x-pack/plugins/beats_management/server/lib/beats.ts b/x-pack/plugins/beats_management/server/lib/beats.ts index 195117a6a85f22..f5a87d0f8d9caf 100644 --- a/x-pack/plugins/beats_management/server/lib/beats.ts +++ b/x-pack/plugins/beats_management/server/lib/beats.ts @@ -96,6 +96,7 @@ export class CMBeatsDomain { beat: Partial ): Promise<{ status: string; accessToken?: string }> { const { token, expires_on } = await this.tokens.getEnrollmentToken(enrollmentToken); + // eslint-disable-next-line @typescript-eslint/camelcase if (expires_on && moment(expires_on).isBefore(moment())) { return { status: BeatEnrollmentStatus.ExpiredEnrollmentToken }; } diff --git a/x-pack/plugins/infra/common/errors/metrics.ts b/x-pack/plugins/infra/common/errors/metrics.ts index 08d58a7db326ea..2acf2b741cec9d 100644 --- a/x-pack/plugins/infra/common/errors/metrics.ts +++ b/x-pack/plugins/infra/common/errors/metrics.ts @@ -5,5 +5,6 @@ */ export enum InfraMetricsErrorCodes { + // eslint-disable-next-line @typescript-eslint/camelcase invalid_node = 'METRICS_INVALID_NODE', } diff --git a/x-pack/plugins/infra/public/containers/with_state_from_location.tsx b/x-pack/plugins/infra/public/containers/with_state_from_location.tsx index d11c9c3b0c5110..4ed70eda5e5690 100644 --- a/x-pack/plugins/infra/public/containers/with_state_from_location.tsx +++ b/x-pack/plugins/infra/public/containers/with_state_from_location.tsx @@ -9,6 +9,7 @@ import omit from 'lodash/fp/omit'; import { parse as parseQueryString, stringify as stringifyQueryString } from 'querystring'; import React from 'react'; import { RouteComponentProps, withRouter } from 'react-router'; +// eslint-disable-next-line @typescript-eslint/camelcase import { decode_object, encode_object } from 'rison-node'; import { Omit } from '../lib/lib'; diff --git a/x-pack/plugins/infra/server/lib/adapters/metrics/adapter_types.ts b/x-pack/plugins/infra/server/lib/adapters/metrics/adapter_types.ts index bce552b7f4fccc..2729777367b7d8 100644 --- a/x-pack/plugins/infra/server/lib/adapters/metrics/adapter_types.ts +++ b/x-pack/plugins/infra/server/lib/adapters/metrics/adapter_types.ts @@ -35,8 +35,8 @@ export enum InfraMetricModelMetricType { min = 'min', calculation = 'calculation', cardinality = 'cardinality', - series_agg = 'series_agg', - positive_only = 'positive_only', + series_agg = 'series_agg', // eslint-disable-line @typescript-eslint/camelcase + positive_only = 'positive_only', // eslint-disable-line @typescript-eslint/camelcase derivative = 'derivative', count = 'count', } @@ -71,7 +71,7 @@ export interface InfraMetricModelBasicMetric { export interface InfraMetricModelSeriesAgg { id: string; function: string; - type: InfraMetricModelMetricType.series_agg; + type: InfraMetricModelMetricType.series_agg; // eslint-disable-line @typescript-eslint/camelcase } export interface InfraMetricModelDerivative { diff --git a/x-pack/plugins/infra/types/rison_node.d.ts b/x-pack/plugins/infra/types/rison_node.d.ts index 0fd99b2f0c2217..ec8e5c1f407adc 100644 --- a/x-pack/plugins/infra/types/rison_node.d.ts +++ b/x-pack/plugins/infra/types/rison_node.d.ts @@ -16,9 +16,11 @@ declare module 'rison-node' { export const decode: (input: string) => RisonValue; + // eslint-disable-next-line @typescript-eslint/camelcase export const decode_object: (input: string) => RisonObject; export const encode: (input: Input) => string; + // eslint-disable-next-line @typescript-eslint/camelcase export const encode_object: (input: Input) => string; } From e6d1fb85dbb25ae7e7894b77a0381bd10437c971 Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 28 Mar 2019 12:58:55 +0000 Subject: [PATCH 29/36] chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic --- packages/eslint-config-kibana/typescript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 0ea61debf3ed1f..de5f2f78681336 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -6,7 +6,7 @@ // As a matter of example in IntelliJ IDEA this would be fixed on 2019.1 release to be launched soon. // In order to have it working for now, we should add the extensions `ts,tsx` to the option // `eslint.additional.file.extensions` that can be found on Help > Find Action > Registry -// To read bore about it please visit +// To read more about it please visit // https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000225170-ESLint-and-ts-Typescript-files const semver = require('semver'); From 2363cbfea3a3222dad5fa09569c9711bfaf681bc Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 29 Mar 2019 17:12:55 +0000 Subject: [PATCH 30/36] chore(NA): remove legacy note after the intellij upgrade to 2019.1 --- packages/eslint-config-kibana/typescript.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 0ea61debf3ed1f..10356e7872977a 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -2,12 +2,6 @@ // in order to lint typescript files with eslint. // Some IDEs could not be running eslint with the correct extensions yet // as this package was moved from typescript-eslint-parser to @typescript-eslint/parser -// -// As a matter of example in IntelliJ IDEA this would be fixed on 2019.1 release to be launched soon. -// In order to have it working for now, we should add the extensions `ts,tsx` to the option -// `eslint.additional.file.extensions` that can be found on Help > Find Action > Registry -// To read bore about it please visit -// https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000225170-ESLint-and-ts-Typescript-files const semver = require('semver'); const PKG = require('../../package.json'); From 4f2da6530e96bba046b0c33409a52ad43af3bc57 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Wed, 3 Apr 2019 22:07:00 +0100 Subject: [PATCH 31/36] fix(NA): import order plugin. --- packages/eslint-config-kibana/jest.js | 1 + packages/eslint-config-kibana/typescript.js | 15 +++++------ .../public/ui_settings/ui_settings_service.ts | 3 +-- .../public/dashboard/actions/embeddables.ts | 2 +- .../panel_options_menu_container.ts | 2 +- .../kibana/public/dashboard/reducers/view.ts | 2 +- .../visualize_embeddable_factory.ts | 2 +- .../public/visualize/wizard/new_vis_modal.tsx | 5 ++-- .../wizard/type_selection/type_selection.tsx | 5 ++-- .../header_global_nav/components/header.tsx | 7 +++-- .../components/header_help_menu.tsx | 5 ++-- .../public/query_bar/components/query_bar.tsx | 26 +++++++++---------- .../share/components/url_panel_content.tsx | 3 +-- .../public/share/show_share_context_menu.tsx | 6 ++--- .../loader/embedded_visualize_handler.ts | 5 ++-- .../visualize/loader/visualize_data_loader.ts | 3 +-- .../Waterfall/SpanFlyout/HttpContext.tsx | 10 +++---- .../public/lib/compose/kibana_compose.ts | 10 +++---- .../annotations/annotation_flyout/index.tsx | 9 +++---- .../public/components/report_listing.tsx | 13 +++++----- 20 files changed, 59 insertions(+), 75 deletions(-) diff --git a/packages/eslint-config-kibana/jest.js b/packages/eslint-config-kibana/jest.js index a590fca735a496..93393cf542b549 100644 --- a/packages/eslint-config-kibana/jest.js +++ b/packages/eslint-config-kibana/jest.js @@ -15,6 +15,7 @@ module.exports = { rules: { 'jest/no-focused-tests': 'error', 'jest/no-identical-title': 'error', + 'import/order': 'off' }, } ] diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 10356e7872977a..9943928133a864 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -96,14 +96,13 @@ module.exports = { 'eol-last': 'error', 'eqeqeq': ['error', 'always', {'null': 'ignore'}], 'guard-for-in': 'error', - // TODO: this should be replaced by a custom rule as this plugin - // don't identify individual groups - // 'import/order': ['error', { - // 'groups': [ - // ['external', 'builtin'], - // 'internal' - // ], - // }], + 'import/order': ['error', { + 'groups': [ + ['external', 'builtin'], + 'internal', + ['parent', 'sibling', 'index'], + ], + }], 'max-classes-per-file': ['error', 1], 'max-len': [ 'error', { code: 120, ignoreComments: true, ignoreUrls: true } ], 'new-parens': 'error', diff --git a/src/core/public/ui_settings/ui_settings_service.ts b/src/core/public/ui_settings/ui_settings_service.ts index b7b7b64c06c8d3..fde3486fe1ca05 100644 --- a/src/core/public/ui_settings/ui_settings_service.ts +++ b/src/core/public/ui_settings/ui_settings_service.ts @@ -17,6 +17,7 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; import { BasePathSetup } from '../base_path'; import { HttpSetup } from '../http'; import { InjectedMetadataSetup } from '../injected_metadata'; @@ -25,8 +26,6 @@ import { NotificationsSetup } from '../notifications'; import { UiSettingsApi } from './ui_settings_api'; import { UiSettingsClient } from './ui_settings_client'; -import { i18n } from '@kbn/i18n'; - interface Deps { notifications: NotificationsSetup; http: HttpSetup; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/actions/embeddables.ts b/src/legacy/core_plugins/kibana/public/dashboard/actions/embeddables.ts index 11e4e542d90d0e..21fd2baee21b7b 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/actions/embeddables.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/actions/embeddables.ts @@ -21,11 +21,11 @@ import _ from 'lodash'; import { createAction } from 'redux-actions'; +import { EmbeddableMetadata, EmbeddableState } from 'ui/embeddable'; import { getEmbeddableCustomization, getPanel } from '../../selectors'; import { PanelId, PanelState } from '../selectors'; import { updatePanel } from './panels'; -import { EmbeddableMetadata, EmbeddableState } from 'ui/embeddable'; import { KibanaAction, KibanaThunk } from '../../selectors/types'; export enum EmbeddableActionTypeKeys { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts b/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts index 7c4951ae4bd0ba..6b537a2a2c405a 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/panel/panel_header/panel_options_menu_container.ts @@ -26,6 +26,7 @@ import { ContextMenuPanel, Embeddable, } from 'ui/embeddable'; +import { Dispatch } from 'redux'; import { panelActionsStore } from '../../store/panel_actions_store'; import { getCustomizePanelAction, @@ -46,7 +47,6 @@ import { setVisibleContextMenuPanelId, } from '../../actions'; -import { Dispatch } from 'redux'; import { CoreKibanaState } from '../../../selectors'; import { DashboardViewMode } from '../../dashboard_view_mode'; import { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts b/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts index 4eb8c6ffd670b4..4f1d060d991266 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/reducers/view.ts @@ -19,10 +19,10 @@ import { cloneDeep } from 'lodash'; import { Reducer } from 'redux'; -import { ViewActions, ViewActionTypeKeys } from '../actions'; import { Filters, Query, RefreshConfig, TimeRange } from 'ui/embeddable'; import { QueryLanguageType } from 'ui/embeddable/types'; +import { ViewActions, ViewActionTypeKeys } from '../actions'; import { DashboardViewMode } from '../dashboard_view_mode'; import { PanelId, ViewState } from '../selectors'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.ts b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.ts index ef1debdb218e90..8b5a53353d82ed 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable_factory.ts @@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n'; import chrome from 'ui/chrome'; import { EmbeddableFactory } from 'ui/embeddable'; import { getVisualizeLoader } from 'ui/visualize/loader'; -import { VisualizeEmbeddable } from './visualize_embeddable'; import { Legacy } from 'kibana'; import { @@ -29,6 +28,7 @@ import { OnEmbeddableStateChanged, } from 'ui/embeddable/embeddable_factory'; import { VisTypesRegistry } from 'ui/registry/vis_types'; +import { VisualizeEmbeddable } from './visualize_embeddable'; import { VisualizationAttributes } from '../../../../../server/saved_objects/service/saved_objects_client'; import { SavedVisualizations } from '../types'; import { DisabledLabEmbeddable } from './disabled_lab_embeddable'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx index 99b394a3f2e5d7..5f6d56852e7bc1 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.tsx @@ -21,14 +21,13 @@ import React from 'react'; import { EuiModal, EuiOverlayMask } from '@elastic/eui'; +import chrome from 'ui/chrome'; +import { VisType } from 'ui/vis'; import { VisualizeConstants } from '../visualize_constants'; import { SearchSelection } from './search_selection'; import { TypeSelection } from './type_selection'; -import chrome from 'ui/chrome'; -import { VisType } from 'ui/vis'; - interface TypeSelectionProps { isOpen: boolean; onClose: () => void; diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx index d31ebe1d3d8b32..d4b448e1620a8c 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx +++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/type_selection/type_selection.tsx @@ -34,13 +34,12 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; +import { memoizeLast } from 'ui/utils/memoize'; +import { VisType } from 'ui/vis'; import { NewVisHelp } from './new_vis_help'; import { VisHelpText } from './vis_help_text'; import { VisTypeIcon } from './vis_type_icon'; -import { memoizeLast } from 'ui/utils/memoize'; -import { VisType } from 'ui/vis'; - interface VisTypeListEntry extends VisType { highlighted: boolean; } diff --git a/src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx b/src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx index d8426805f57ba7..ae7389e8d42f21 100644 --- a/src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx +++ b/src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx @@ -50,16 +50,15 @@ import { EuiShowFor, } from '@elastic/eui'; -import { HeaderBreadcrumbs } from './header_breadcrumbs'; -import { HeaderHelpMenu } from './header_help_menu'; -import { HeaderNavControls } from './header_nav_controls'; - import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; import chrome, { NavLink } from 'ui/chrome'; import { HelpExtension } from 'ui/chrome'; import { RecentlyAccessedHistoryItem } from 'ui/persisted_log'; import { ChromeHeaderNavControlsRegistry } from 'ui/registry/chrome_header_nav_controls'; import { relativeToAbsolute } from 'ui/url/relative_to_absolute'; +import { HeaderNavControls } from './header_nav_controls'; +import { HeaderHelpMenu } from './header_help_menu'; +import { HeaderBreadcrumbs } from './header_breadcrumbs'; import { NavControlSide } from '../'; import { Breadcrumb } from '../../../../../../../core/public/chrome'; diff --git a/src/legacy/ui/public/chrome/directives/header_global_nav/components/header_help_menu.tsx b/src/legacy/ui/public/chrome/directives/header_global_nav/components/header_help_menu.tsx index 43fbe1323f0b24..65a4db537d9a2a 100644 --- a/src/legacy/ui/public/chrome/directives/header_global_nav/components/header_help_menu.tsx +++ b/src/legacy/ui/public/chrome/directives/header_global_nav/components/header_help_menu.tsx @@ -21,9 +21,6 @@ import { FormattedMessage } from '@kbn/i18n/react'; import React, { Component, Fragment } from 'react'; import * as Rx from 'rxjs'; -import { documentationLinks } from '../../../../documentation_links'; -import { metadata } from '../../../../metadata'; - import { // TODO: add type annotations // @ts-ignore @@ -42,6 +39,8 @@ import { } from '@elastic/eui'; import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; import { HelpExtension } from 'ui/chrome'; +import { metadata } from '../../../../metadata'; +import { documentationLinks } from '../../../../documentation_links'; import { HeaderExtension } from './header_extension'; diff --git a/src/legacy/ui/public/query_bar/components/query_bar.tsx b/src/legacy/ui/public/query_bar/components/query_bar.tsx index 2d0233c5867247..84d92920f84b5a 100644 --- a/src/legacy/ui/public/query_bar/components/query_bar.tsx +++ b/src/legacy/ui/public/query_bar/components/query_bar.tsx @@ -28,17 +28,6 @@ import { kfetch } from 'ui/kfetch'; import { PersistedLog } from 'ui/persisted_log'; import { Storage } from 'ui/storage'; import { timeHistory } from 'ui/timefilter/time_history'; -import { - AutocompleteSuggestion, - AutocompleteSuggestionType, - getAutocompleteProvider, -} from '../../autocomplete_providers'; -import chrome from '../../chrome'; -import { fromUser, toUser } from '../../parse_query'; -import { matchPairs } from '../lib/match_pairs'; -import { QueryLanguageSwitcher } from './language_switcher'; -import { SuggestionsComponent } from './typeahead/suggestions_component'; - import { EuiButton, EuiFieldText, @@ -48,13 +37,22 @@ import { EuiOutsideClickDetector, EuiSuperDatePicker, } from '@elastic/eui'; - -// @ts-ignore import { EuiSuperUpdateButton } from '@elastic/eui'; - import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; import { documentationLinks } from 'ui/documentation_links'; import { Toast, toastNotifications } from 'ui/notify'; +import { + AutocompleteSuggestion, + AutocompleteSuggestionType, + getAutocompleteProvider, +} from '../../autocomplete_providers'; +import chrome from '../../chrome'; +import { fromUser, toUser } from '../../parse_query'; +import { matchPairs } from '../lib/match_pairs'; +import { QueryLanguageSwitcher } from './language_switcher'; +import { SuggestionsComponent } from './typeahead/suggestions_component'; + +// @ts-ignore const KEY_CODES = { LEFT: 37, diff --git a/src/legacy/ui/public/share/components/url_panel_content.tsx b/src/legacy/ui/public/share/components/url_panel_content.tsx index e7d719b5ba694c..c579def221effb 100644 --- a/src/legacy/ui/public/share/components/url_panel_content.tsx +++ b/src/legacy/ui/public/share/components/url_panel_content.tsx @@ -34,11 +34,10 @@ import { import { format as formatUrl, parse as parseUrl } from 'url'; +import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; import { unhashUrl } from '../../state_management/state_hashing'; import { shortenUrl } from '../lib/url_shortener'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; - // TODO: Remove once EuiIconTip supports "content" prop const FixedEuiIconTip = EuiIconTip as React.SFC; diff --git a/src/legacy/ui/public/share/show_share_context_menu.tsx b/src/legacy/ui/public/share/show_share_context_menu.tsx index 4dae2005da75e6..dcc685b0dbdf7d 100644 --- a/src/legacy/ui/public/share/show_share_context_menu.tsx +++ b/src/legacy/ui/public/share/show_share_context_menu.tsx @@ -20,12 +20,10 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { ShareContextMenu } from './components/share_context_menu'; -import { ShareActionProvider } from './share_action'; - import { EuiWrappingPopover } from '@elastic/eui'; - import { I18nContext } from 'ui/i18n'; +import { ShareContextMenu } from './components/share_context_menu'; +import { ShareActionProvider } from './share_action'; let isOpen = false; diff --git a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts index 5d1ae2611742b8..fe1cbff54402c3 100644 --- a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts +++ b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts @@ -22,6 +22,8 @@ import { debounce, forEach, get } from 'lodash'; import * as Rx from 'rxjs'; import { share } from 'rxjs/operators'; // @ts-ignore untyped dependency +import { i18n } from '@kbn/i18n'; +import { toastNotifications } from 'ui/notify'; import { registries } from '../../../../core_plugins/interpreter/public/registries'; import { Inspector } from '../../inspector'; import { Adapters } from '../../inspector/types'; @@ -46,9 +48,6 @@ import { } from './types'; import { queryGeohashBounds } from './utils'; -import { i18n } from '@kbn/i18n'; -import { toastNotifications } from 'ui/notify'; - interface EmbeddedVisualizeHandlerParams extends VisualizeLoaderParams { Private: IPrivate; queryFilter: any; diff --git a/src/legacy/ui/public/visualize/loader/visualize_data_loader.ts b/src/legacy/ui/public/visualize/loader/visualize_data_loader.ts index 63d64bf4c0b1c0..589b5f2723112c 100644 --- a/src/legacy/ui/public/visualize/loader/visualize_data_loader.ts +++ b/src/legacy/ui/public/visualize/loader/visualize_data_loader.ts @@ -18,6 +18,7 @@ */ import { isEqual } from 'lodash'; +import { getVisParams } from 'ui/visualize/loader/pipeline_helpers/build_pipeline'; import { VisRequestHandlersRegistryProvider as RequestHandlersProvider } from '../../registry/vis_request_handlers'; import { VisResponseHandlersRegistryProvider as ResponseHandlerProvider } from '../../registry/vis_response_handlers'; @@ -33,8 +34,6 @@ import { import { VisResponseData } from './types'; -import { getVisParams } from 'ui/visualize/loader/pipeline_helpers/build_pipeline'; - function getHandler( from: Array<{ name: string; handler: T }>, type: string | T diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/HttpContext.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/HttpContext.tsx index 006afc21641940..4a8af6a8429b5d 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/HttpContext.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/HttpContext.tsx @@ -6,6 +6,11 @@ import React, { Fragment } from 'react'; import styled from 'styled-components'; + +import { EuiSpacer, EuiTitle } from '@elastic/eui'; +import theme from '@elastic/eui/dist/eui_theme_light.json'; +import { idx } from 'x-pack/plugins/apm/common/idx'; +import { Span } from 'x-pack/plugins/apm/typings/es_schemas/ui/Span'; import { borderRadius, fontFamilyCode, @@ -15,11 +20,6 @@ import { units } from '../../../../../../../style/variables'; -import { EuiSpacer, EuiTitle } from '@elastic/eui'; -import theme from '@elastic/eui/dist/eui_theme_light.json'; -import { idx } from 'x-pack/plugins/apm/common/idx'; -import { Span } from 'x-pack/plugins/apm/typings/es_schemas/ui/Span'; - const ContextUrl = styled.div` padding: ${px(units.half)} ${px(unit)}; background: ${theme.euiColorLightestShade}; diff --git a/x-pack/plugins/infra/public/lib/compose/kibana_compose.ts b/x-pack/plugins/infra/public/lib/compose/kibana_compose.ts index 216d9051cf6446..54996e9a48352b 100644 --- a/x-pack/plugins/infra/public/lib/compose/kibana_compose.ts +++ b/x-pack/plugins/infra/public/lib/compose/kibana_compose.ts @@ -13,17 +13,15 @@ import uiRoutes from 'ui/routes'; // @ts-ignore: path dynamic for kibana import { timezoneProvider } from 'ui/vis/lib/timezone'; -import { InfraKibanaObservableApiAdapter } from '../adapters/observable_api/kibana_observable_api'; - -import introspectionQueryResultData from '../../graphql/introspection.json'; -import { InfraKibanaFrameworkAdapter } from '../adapters/framework/kibana_framework_adapter'; -import { InfraFrontendLibs } from '../lib'; - import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory'; import ApolloClient from 'apollo-client'; import { ApolloLink } from 'apollo-link'; import { HttpLink } from 'apollo-link-http'; import { withClientState } from 'apollo-link-state'; +import { InfraFrontendLibs } from '../lib'; +import introspectionQueryResultData from '../../graphql/introspection.json'; +import { InfraKibanaFrameworkAdapter } from '../adapters/framework/kibana_framework_adapter'; +import { InfraKibanaObservableApiAdapter } from '../adapters/observable_api/kibana_observable_api'; export function compose(): InfraFrontendLibs { const cache = new InMemoryCache({ diff --git a/x-pack/plugins/ml/public/components/annotations/annotation_flyout/index.tsx b/x-pack/plugins/ml/public/components/annotations/annotation_flyout/index.tsx index 4dc5e363c231dd..9b53adb7233253 100644 --- a/x-pack/plugins/ml/public/components/annotations/annotation_flyout/index.tsx +++ b/x-pack/plugins/ml/public/components/annotations/annotation_flyout/index.tsx @@ -22,6 +22,10 @@ import { EuiTitle, } from '@elastic/eui'; +import { CommonProps } from '@elastic/eui'; +import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { InjectedIntlProps } from 'react-intl'; +import { toastNotifications } from 'ui/notify'; import { annotation$, annotationsRefresh$, @@ -31,11 +35,6 @@ import { injectObservablesAsProps } from '../../../util/observable_utils'; import { AnnotationDescriptionList } from '../annotation_description_list'; import { DeleteAnnotationModal } from '../delete_annotation_modal'; -import { CommonProps } from '@elastic/eui'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; -import { InjectedIntlProps } from 'react-intl'; -import { toastNotifications } from 'ui/notify'; - import { ml } from '../../../services/ml_api_service'; interface Props { diff --git a/x-pack/plugins/reporting/public/components/report_listing.tsx b/x-pack/plugins/reporting/public/components/report_listing.tsx index 262362a1e5a518..7fc826a7208992 100644 --- a/x-pack/plugins/reporting/public/components/report_listing.tsx +++ b/x-pack/plugins/reporting/public/components/report_listing.tsx @@ -15,13 +15,6 @@ import moment from 'moment'; import React, { Component } from 'react'; import chrome from 'ui/chrome'; import { toastNotifications } from 'ui/notify'; -import { Poller } from '../../../../common/poller'; -import { JobStatuses } from '../constants/job_statuses'; -import { downloadReport } from '../lib/download_report'; -import { jobQueueClient, JobQueueEntry } from '../lib/job_queue_client'; -import { ReportErrorButton } from './report_error_button'; -import { ReportInfoButton } from './report_info_button'; - import { EuiBasicTable, EuiButtonIcon, @@ -32,6 +25,12 @@ import { EuiTitle, EuiToolTip, } from '@elastic/eui'; +import { Poller } from '../../../../common/poller'; +import { JobStatuses } from '../constants/job_statuses'; +import { downloadReport } from '../lib/download_report'; +import { jobQueueClient, JobQueueEntry } from '../lib/job_queue_client'; +import { ReportErrorButton } from './report_error_button'; +import { ReportInfoButton } from './report_info_button'; interface Job { id: string; From dd4707a17b618ff8a6fd756fd7ca2ef7ea0d8746 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 4 Apr 2019 00:33:44 +0100 Subject: [PATCH 32/36] chore(NA): fix ts ignore positions after auto fix. --- src/legacy/ui/public/query_bar/components/query_bar.tsx | 3 +-- .../ui/public/visualize/loader/embedded_visualize_handler.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/legacy/ui/public/query_bar/components/query_bar.tsx b/src/legacy/ui/public/query_bar/components/query_bar.tsx index 84d92920f84b5a..6a83d12ea953ba 100644 --- a/src/legacy/ui/public/query_bar/components/query_bar.tsx +++ b/src/legacy/ui/public/query_bar/components/query_bar.tsx @@ -37,6 +37,7 @@ import { EuiOutsideClickDetector, EuiSuperDatePicker, } from '@elastic/eui'; +// @ts-ignore import { EuiSuperUpdateButton } from '@elastic/eui'; import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; import { documentationLinks } from 'ui/documentation_links'; @@ -52,8 +53,6 @@ import { matchPairs } from '../lib/match_pairs'; import { QueryLanguageSwitcher } from './language_switcher'; import { SuggestionsComponent } from './typeahead/suggestions_component'; -// @ts-ignore - const KEY_CODES = { LEFT: 37, UP: 38, diff --git a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts index fe1cbff54402c3..72f3662d16da33 100644 --- a/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts +++ b/src/legacy/ui/public/visualize/loader/embedded_visualize_handler.ts @@ -21,9 +21,9 @@ import { EventEmitter } from 'events'; import { debounce, forEach, get } from 'lodash'; import * as Rx from 'rxjs'; import { share } from 'rxjs/operators'; -// @ts-ignore untyped dependency import { i18n } from '@kbn/i18n'; import { toastNotifications } from 'ui/notify'; +// @ts-ignore untyped dependency import { registries } from '../../../../core_plugins/interpreter/public/registries'; import { Inspector } from '../../inspector'; import { Adapters } from '../../inspector/types'; From f9074d5a7a46271249faecc95593cfde379dcf97 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Thu, 4 Apr 2019 19:06:34 +0100 Subject: [PATCH 33/36] fix(NA): performance issue with typescript eslint. --- packages/eslint-config-kibana/typescript.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index bf2c96996bf362..b4f73185a0d925 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -42,7 +42,14 @@ module.exports = { experimentalObjectRestSpread: true, jsx: true }, - project: './tsconfig.json' + // NOTE: That is to avoid a known performance issue related with the `ts.Program` used by + // typescript eslint. As we are not using rules that need types information, we can safely + // disabling that feature setting the project to undefined. That issue is being addressed + // by the typescript eslint team. More info could be found here: + // https://github.com/typescript-eslint/typescript-eslint/issues/389 + // https://github.com/typescript-eslint/typescript-eslint/issues/243 + // https://github.com/typescript-eslint/typescript-eslint/pull/361 + project: undefined }, // NOTE: we can't override the extends option here to apply @@ -180,11 +187,5 @@ module.exports = { eslintConfigPrettierTypescriptEslintRules ) }, - { - parserOptions: { - project: 'x-pack/tsconfig.json' - }, - files: ['x-pack/**/*.{ts,tsx}'], - }, ] }; From 2dfe095ed5850ce05437fcc442ae5275f38feaa9 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 5 Apr 2019 04:50:15 +0100 Subject: [PATCH 34/36] refact(NA): eslint configs organization. --- .eslintrc.js | 512 ++++++++++++++++++++ packages/eslint-config-kibana/.eslintrc.js | 139 +----- packages/eslint-config-kibana/javascript.js | 389 --------------- 3 files changed, 533 insertions(+), 507 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1b3e4a8c7dabe4..ba8b77a7866095 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,515 @@ +const { readdirSync } = require('fs'); +const { resolve } = require('path'); + +const APACHE_2_0_LICENSE_HEADER = ` +/* + * 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 ELASTIC_LICENSE_HEADER = ` +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +`; + module.exports = { extends: ['@elastic/eslint-config-kibana'], + + overrides: [ + /** + * Prettier + */ + { + files: [ + '.eslintrc.js', + 'packages/kbn-eslint-plugin-eslint/**/*', + 'packages/kbn-config-schema/**/*', + 'packages/kbn-pm/**/*', + 'packages/kbn-es/**/*', + 'packages/elastic-datemath/**/*', + 'packages/kbn-i18n/**/*', + 'packages/kbn-dev-utils/**/*', + 'packages/kbn-plugin-helpers/**/*', + 'packages/kbn-plugin-generator/**/*', + 'packages/kbn-test-subj-selector/**/*', + 'packages/kbn-test/**/*', + 'packages/kbn-eslint-import-resolver-kibana/**/*', + 'src/legacy/server/saved_objects/**/*', + 'x-pack/plugins/apm/**/*', + 'x-pack/plugins/canvas/**/*', + '**/*.{ts,tsx}', + ], + plugins: ['prettier'], + rules: Object.assign( + { + 'prettier/prettier': ['error'], + }, + require('eslint-config-prettier').rules, + require('eslint-config-prettier/react').rules + ), + }, + + /** + * Files that require Apache 2.0 headers, settings + * are overridden below for files that require Elastic + * Licence headers + */ + { + files: ['**/*.{js,ts,tsx}'], + rules: { + '@kbn/eslint/require-license-header': [ + 'error', + { + license: APACHE_2_0_LICENSE_HEADER, + }, + ], + '@kbn/eslint/disallow-license-headers': [ + 'error', + { + licenses: [ELASTIC_LICENSE_HEADER], + }, + ], + }, + }, + + /** + * Files that require Elastic license headers instead of Apache 2.0 header + */ + { + files: ['x-pack/**/*.{js,ts,tsx}'], + rules: { + '@kbn/eslint/require-license-header': [ + 'error', + { + license: ELASTIC_LICENSE_HEADER, + }, + ], + '@kbn/eslint/disallow-license-headers': [ + 'error', + { + licenses: [APACHE_2_0_LICENSE_HEADER], + }, + ], + }, + }, + + /** + * Restricted paths + */ + { + files: ['**/*.js'], + rules: { + '@kbn/eslint/no-restricted-paths': [ + 'error', + { + basePath: __dirname, + zones: [ + { + target: [ + 'src/legacy/**/*', + 'x-pack/**/*', + '!x-pack/**/*.test.*', + 'src/plugins/**/(public|server)/**/*', + 'src/core/(public|server)/**/*', + ], + from: [ + 'src/core/public/**/*', + '!src/core/public/index*', + '!src/core/public/utils/**/*', + + 'src/core/server/**/*', + '!src/core/server/index*', + + 'src/plugins/**/public/**/*', + '!src/plugins/**/public/index*', + + 'src/plugins/**/server/**/*', + '!src/plugins/**/server/index*', + ], + allowSameFolder: true, + }, + ], + }, + ], + }, + }, + + /** + * Allow default exports + */ + { + files: ['x-pack/test/functional/apps/**/*.js', 'x-pack/plugins/apm/**/*.js'], + rules: { + 'import/no-default-export': 'off', + 'import/no-named-as-default': 'off', + }, + }, + + /** + * Files that are allowed to import webpack-specific stuff + */ + { + files: [ + '**/public/**/*.js', + '**/webpackShims/**/*.js', + 'packages/kbn-ui-framework/doc_site/src/**/*.js', + 'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away) + ], + settings: { + // instructs import/no-extraneous-dependencies to treat modules + // in plugins/ or ui/ namespace as "core modules" so they don't + // trigger failures for not being listed in package.json + 'import/core-modules': ['plugins', 'legacy/ui', 'uiExports'], + + 'import/resolver': { + '@kbn/eslint-import-resolver-kibana': { + forceNode: false, + rootPackageName: 'kibana', + kibanaPath: '.', + pluginMap: readdirSync(resolve(__dirname, 'x-pack/plugins')).reduce((acc, name) => { + if (!name.startsWith('_')) { + acc[name] = `x-pack/plugins/${name}`; + } + return acc; + }, {}), + }, + }, + }, + }, + + /** + * Files that ARE NOT allowed to use devDependencies + */ + { + files: [ + 'packages/kbn-ui-framework/**/*.js', + 'x-pack/**/*.js', + 'packages/kbn-interpreter/**/*.js', + ], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: false, + peerDependencies: true, + }, + ], + }, + }, + + /** + * Files that ARE allowed to use devDependencies + */ + { + files: [ + 'packages/kbn-ui-framework/**/*.test.js', + 'packages/kbn-ui-framework/doc_site/**/*.js', + 'packages/kbn-ui-framework/generator-kui/**/*.js', + 'packages/kbn-ui-framework/Gruntfile.js', + 'packages/kbn-es/src/**/*.js', + 'packages/kbn-interpreter/tasks/**/*.js', + 'packages/kbn-interpreter/src/plugin/**/*.js', + 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*.js', + 'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', + 'x-pack/**/*.test.js', + 'x-pack/test_utils/**/*', + 'x-pack/gulpfile.js', + 'x-pack/plugins/apm/public/utils/testHelpers.js', + ], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + peerDependencies: true, + }, + ], + }, + }, + + /** + * Files that run BEFORE node version check + */ + { + files: ['scripts/**/*.js', 'src/setup_node_env/**/*.js'], + rules: { + 'import/no-commonjs': 'off', + 'prefer-object-spread/prefer-object-spread': 'off', + 'no-var': 'off', + 'prefer-const': 'off', + 'prefer-destructuring': 'off', + 'no-restricted-syntax': [ + 'error', + 'ImportDeclaration', + 'ExportNamedDeclaration', + 'ExportDefaultDeclaration', + 'ExportAllDeclaration', + 'ArrowFunctionExpression', + 'AwaitExpression', + 'ClassDeclaration', + 'RestElement', + 'SpreadElement', + 'YieldExpression', + 'VariableDeclaration[kind="const"]', + 'VariableDeclaration[kind="let"]', + 'VariableDeclarator[id.type="ArrayPattern"]', + 'VariableDeclarator[id.type="ObjectPattern"]', + ], + }, + }, + + /** + * Files that run in the browser with only node-level transpilation + */ + { + files: [ + 'test/functional/services/lib/web_element_wrapper/scroll_into_view_if_necessary.js', + '**/browser_exec_scripts/**/*.js', + ], + rules: { + 'prefer-object-spread/prefer-object-spread': 'off', + 'no-var': 'off', + 'prefer-const': 'off', + 'prefer-destructuring': 'off', + 'no-restricted-syntax': [ + 'error', + 'ArrowFunctionExpression', + 'AwaitExpression', + 'ClassDeclaration', + 'ImportDeclaration', + 'RestElement', + 'SpreadElement', + 'YieldExpression', + 'VariableDeclaration[kind="const"]', + 'VariableDeclaration[kind="let"]', + 'VariableDeclarator[id.type="ArrayPattern"]', + 'VariableDeclarator[id.type="ObjectPattern"]', + ], + }, + }, + + /** + * Files that run AFTER node version check + * and are not also transpiled with babel + */ + { + files: [ + '.eslintrc.js', + '**/webpackShims/**/*.js', + 'packages/kbn-plugin-generator/**/*.js', + 'packages/kbn-plugin-helpers/**/*.js', + 'packages/kbn-eslint-import-resolver-kibana/**/*.js', + 'packages/kbn-eslint-plugin-eslint/**/*', + 'x-pack/gulpfile.js', + 'x-pack/dev-tools/mocha/setup_mocha.js', + 'x-pack/scripts/*.js', + ], + rules: { + 'import/no-commonjs': 'off', + 'prefer-object-spread/prefer-object-spread': 'off', + 'no-restricted-syntax': [ + 'error', + 'ImportDeclaration', + 'ExportNamedDeclaration', + 'ExportDefaultDeclaration', + 'ExportAllDeclaration', + ], + }, + }, + + /** + * APM overrides + */ + { + files: ['x-pack/plugins/apm/**/*.js'], + rules: { + 'no-unused-vars': ['error', { ignoreRestSiblings: true }], + 'no-console': ['warn', { allow: ['error'] }], + }, + }, + + /** + * GIS overrides + */ + { + files: ['x-pack/plugins/maps/**/*.js'], + rules: { + 'react/prefer-stateless-function': [0, { ignorePureComponents: false }], + }, + }, + + /** + * Graph overrides + */ + { + files: ['x-pack/plugins/graph/**/*.js'], + globals: { + angular: true, + $: true, + }, + rules: { + 'block-scoped-var': 'off', + camelcase: 'off', + eqeqeq: 'off', + 'guard-for-in': 'off', + 'new-cap': 'off', + 'no-loop-func': 'off', + 'no-redeclare': 'off', + 'no-shadow': 'off', + 'no-unused-vars': 'off', + 'one-var': 'off', + }, + }, + + /** + * ML overrides + */ + { + files: ['x-pack/plugins/ml/**/*.js'], + rules: { + 'no-shadow': 'error', + }, + }, + + /** + * disable jsx-a11y for kbn-ui-framework + */ + { + files: ['packages/kbn-ui-framework/**/*.js'], + rules: { + 'jsx-a11y/click-events-have-key-events': 'off', + 'jsx-a11y/anchor-has-content': 'off', + 'jsx-a11y/tabindex-no-positive': 'off', + 'jsx-a11y/label-has-associated-control': 'off', + 'jsx-a11y/aria-role': 'off', + }, + }, + + /** + * Monitoring overrides + */ + { + files: ['x-pack/plugins/monitoring/**/*.js'], + rules: { + 'block-spacing': ['error', 'always'], + curly: ['error', 'all'], + 'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }], + 'no-else-return': 'error', + }, + }, + { + files: ['x-pack/plugins/monitoring/public/**/*.js'], + env: { browser: true }, + }, + + /** + * Canvas overrides + */ + { + files: ['x-pack/plugins/canvas/**/*.js'], + rules: { + radix: 'error', + curly: ['error', 'all'], + + // module importing + 'import/order': [ + 'error', + { + groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], + }, + ], + 'import/extensions': ['error', 'never', { json: 'always', less: 'always', svg: 'always' }], + + // react + 'react/no-did-mount-set-state': 'error', + 'react/no-did-update-set-state': 'error', + 'react/no-multi-comp': ['error', { ignoreStateless: true }], + 'react/self-closing-comp': 'error', + 'react/sort-comp': 'error', + 'react/jsx-boolean-value': 'error', + 'react/jsx-wrap-multilines': 'error', + 'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }], + 'react/forbid-elements': [ + 'error', + { + forbid: [ + { + element: 'EuiConfirmModal', + message: 'Use instead', + }, + { + element: 'EuiPopover', + message: 'Use instead', + }, + { + element: 'EuiIconTip', + message: 'Use instead', + }, + ], + }, + ], + }, + }, + { + files: [ + 'x-pack/plugins/canvas/gulpfile.js', + 'x-pack/plugins/canvas/scripts/*.js', + 'x-pack/plugins/canvas/tasks/*.js', + 'x-pack/plugins/canvas/tasks/**/*.js', + 'x-pack/plugins/canvas/__tests__/**/*.js', + 'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', + ], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + peerDependencies: true, + }, + ], + }, + }, + { + files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'], + globals: { canvas: true, $: true }, + rules: { + 'import/no-unresolved': [ + 'error', + { + ignore: ['!!raw-loader.+.svg$'], + }, + ], + }, + }, + { + files: ['x-pack/plugins/canvas/public/**/*.js'], + env: { + browser: true, + }, + }, + { + files: ['x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*.js'], + env: { + jquery: true, + }, + }, + ], }; diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index 79e92d409a0a68..6d39eb98ddb4bc 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -1,32 +1,3 @@ -const APACHE_2_0_LICENSE_HEADER = ` -/* - * 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 ELASTIC_LICENSE_HEADER = ` -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -`; - module.exports = { extends: [ './javascript.js', @@ -35,95 +6,27 @@ module.exports = { ], plugins: ['@kbn/eslint-plugin-eslint'], - overrides: [ - /** - * Prettier - */ - { - files: [ - '.eslintrc.js', - 'packages/kbn-eslint-plugin-eslint/**/*', - 'packages/kbn-config-schema/**/*', - 'packages/kbn-pm/**/*', - 'packages/kbn-es/**/*', - 'packages/elastic-datemath/**/*', - 'packages/kbn-i18n/**/*', - 'packages/kbn-dev-utils/**/*', - 'packages/kbn-plugin-helpers/**/*', - 'packages/kbn-plugin-generator/**/*', - 'packages/kbn-test-subj-selector/**/*', - 'packages/kbn-test/**/*', - 'packages/kbn-eslint-import-resolver-kibana/**/*', - 'src/legacy/server/saved_objects/**/*', - 'x-pack/plugins/apm/**/*', - 'x-pack/plugins/canvas/**/*', - '**/*.{ts,tsx}', - ], - plugins: ['prettier'], - rules: Object.assign( - { - 'prettier/prettier': ['error'], - }, - require('eslint-config-prettier').rules, - require('eslint-config-prettier/react').rules - ), - }, + parserOptions: { + ecmaVersion: 6 + }, - /** - * Files that require Apache 2.0 headers, settings - * are overridden below for files that require Elastic - * Licence headers - */ - { - files: ['**/*.{js,ts,tsx}'], - rules: { - '@kbn/eslint/require-license-header': [ - 'error', - { - license: APACHE_2_0_LICENSE_HEADER, - }, - ], - '@kbn/eslint/disallow-license-headers': [ - 'error', - { - licenses: [ELASTIC_LICENSE_HEADER], - }, - ], - '@kbn/eslint/module_migration': [ - 'error', - [ - { - from: 'expect.js', - to: '@kbn/expect', - }, - { - from: 'x-pack', - toRelative: 'x-pack', - }, - ], - ], - }, - }, + env: { + es6: true + }, - /** - * Files that require Elastic license headers instead of Apache 2.0 header - */ - { - files: ['x-pack/**/*.{js,ts,tsx}'], - rules: { - '@kbn/eslint/require-license-header': [ - 'error', - { - license: ELASTIC_LICENSE_HEADER, - }, - ], - '@kbn/eslint/disallow-license-headers': [ - 'error', - { - licenses: [APACHE_2_0_LICENSE_HEADER], - }, - ], - }, - }, - ], + rules: { + '@kbn/eslint/module_migration': [ + 'error', + [ + { + from: 'expect.js', + to: '@kbn/expect', + }, + { + from: 'x-pack', + toRelative: 'x-pack', + }, + ], + ], + } }; diff --git a/packages/eslint-config-kibana/javascript.js b/packages/eslint-config-kibana/javascript.js index 9d2e7546b4dd95..a5433fa6b5d97d 100644 --- a/packages/eslint-config-kibana/javascript.js +++ b/packages/eslint-config-kibana/javascript.js @@ -1,5 +1,4 @@ const semver = require('semver'); -const { resolve } = require('path'); const { readdirSync } = require('fs'); const PKG = require('../../package.json'); const RESTRICTED_GLOBALS = require('./restricted_globals'); @@ -89,38 +88,6 @@ module.exports = { 'no-restricted-globals': ['error', ...RESTRICTED_GLOBALS], 'no-restricted-imports': [2, RESTRICTED_MODULES], 'no-restricted-modules': [2, RESTRICTED_MODULES], - '@kbn/eslint/no-restricted-paths': [ - 'error', - { - basePath: __dirname, - zones: [ - { - target: [ - 'src/legacy/**/*', - 'x-pack/**/*', - '!x-pack/**/*.test.*', - 'src/plugins/**/(public|server)/**/*', - 'src/core/(public|server)/**/*', - ], - from: [ - 'src/core/public/**/*', - '!src/core/public/index*', - '!src/core/public/utils/**/*', - - 'src/core/server/**/*', - '!src/core/server/index*', - - 'src/plugins/**/public/**/*', - '!src/plugins/**/public/index*', - - 'src/plugins/**/server/**/*', - '!src/plugins/**/server/index*', - ], - allowSameFolder: true, - }, - ], - }, - ], 'no-return-assign': 'off', 'no-script-url': 'error', 'no-sequences': 'error', @@ -228,361 +195,5 @@ module.exports = { 'prefer-object-spread/prefer-object-spread': 'error', } }, - - /** - * Allow default exports - */ - { - files: ['x-pack/test/functional/apps/**/*.js', 'x-pack/plugins/apm/**/*.js'], - rules: { - 'import/no-default-export': 'off', - 'import/no-named-as-default': 'off', - }, - }, - - /** - * Files that are allowed to import webpack-specific stuff - */ - { - files: [ - '**/public/**/*.js', - '**/webpackShims/**/*.js', - 'packages/kbn-ui-framework/doc_site/src/**/*.js', - 'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away) - ], - settings: { - // instructs import/no-extraneous-dependencies to treat modules - // in plugins/ or ui/ namespace as "core modules" so they don't - // trigger failures for not being listed in package.json - 'import/core-modules': ['plugins', 'legacy/ui', 'uiExports'], - - 'import/resolver': { - '@kbn/eslint-import-resolver-kibana': { - forceNode: false, - rootPackageName: 'kibana', - kibanaPath: '.', - pluginMap: readdirSync(resolve(__dirname, '../../x-pack/plugins')).reduce((acc, name) => { - if (!name.startsWith('_')) { - acc[name] = `x-pack/plugins/${name}`; - } - return acc; - }, {}), - }, - }, - }, - }, - - /** - * Files that ARE NOT allowed to use devDependencies - */ - { - files: ['packages/kbn-ui-framework/**/*.js', 'x-pack/**/*.js', 'packages/kbn-interpreter/**/*.js'], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: false, - peerDependencies: true, - }, - ], - }, - }, - - /** - * Files that ARE allowed to use devDependencies - */ - { - files: [ - 'packages/kbn-ui-framework/**/*.test.js', - 'packages/kbn-ui-framework/doc_site/**/*.js', - 'packages/kbn-ui-framework/generator-kui/**/*.js', - 'packages/kbn-ui-framework/Gruntfile.js', - 'packages/kbn-es/src/**/*.js', - 'packages/kbn-interpreter/tasks/**/*.js', - 'packages/kbn-interpreter/src/plugin/**/*.js', - 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*.js', - 'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', - 'x-pack/**/*.test.js', - 'x-pack/test_utils/**/*', - 'x-pack/gulpfile.js', - 'x-pack/plugins/apm/public/utils/testHelpers.js', - ], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: true, - peerDependencies: true, - }, - ], - }, - }, - - /** - * Files that run BEFORE node version check - */ - { - files: ['scripts/**/*.js', 'src/setup_node_env/**/*.js'], - rules: { - 'import/no-commonjs': 'off', - 'prefer-object-spread/prefer-object-spread': 'off', - 'no-var': 'off', - 'prefer-const': 'off', - 'prefer-destructuring': 'off', - 'no-restricted-syntax': [ - 'error', - 'ImportDeclaration', - 'ExportNamedDeclaration', - 'ExportDefaultDeclaration', - 'ExportAllDeclaration', - 'ArrowFunctionExpression', - 'AwaitExpression', - 'ClassDeclaration', - 'RestElement', - 'SpreadElement', - 'YieldExpression', - 'VariableDeclaration[kind="const"]', - 'VariableDeclaration[kind="let"]', - 'VariableDeclarator[id.type="ArrayPattern"]', - 'VariableDeclarator[id.type="ObjectPattern"]', - ], - }, - }, - - /** - * Files that run in the browser with only node-level transpilation - */ - { - files: [ - 'test/functional/services/lib/web_element_wrapper/scroll_into_view_if_necessary.js', - '**/browser_exec_scripts/**/*.js', - ], - rules: { - 'prefer-object-spread/prefer-object-spread': 'off', - 'no-var': 'off', - 'prefer-const': 'off', - 'prefer-destructuring': 'off', - 'no-restricted-syntax': [ - 'error', - 'ArrowFunctionExpression', - 'AwaitExpression', - 'ClassDeclaration', - 'ImportDeclaration', - 'RestElement', - 'SpreadElement', - 'YieldExpression', - 'VariableDeclaration[kind="const"]', - 'VariableDeclaration[kind="let"]', - 'VariableDeclarator[id.type="ArrayPattern"]', - 'VariableDeclarator[id.type="ObjectPattern"]', - ], - }, - }, - - /** - * Files that run AFTER node version check - * and are not also transpiled with babel - */ - { - files: [ - '.eslintrc.js', - '**/webpackShims/**/*.js', - 'packages/kbn-plugin-generator/**/*.js', - 'packages/kbn-plugin-helpers/**/*.js', - 'packages/kbn-eslint-import-resolver-kibana/**/*.js', - 'packages/kbn-eslint-plugin-eslint/**/*', - 'x-pack/gulpfile.js', - 'x-pack/dev-tools/mocha/setup_mocha.js', - 'x-pack/scripts/*.js', - ], - rules: { - 'import/no-commonjs': 'off', - 'prefer-object-spread/prefer-object-spread': 'off', - 'no-restricted-syntax': [ - 'error', - 'ImportDeclaration', - 'ExportNamedDeclaration', - 'ExportDefaultDeclaration', - 'ExportAllDeclaration', - ], - }, - }, - - /** - * APM overrides - */ - { - files: ['x-pack/plugins/apm/**/*.js'], - rules: { - 'no-unused-vars': ['error', { ignoreRestSiblings: true }], - 'no-console': ['warn', { allow: ['error'] }], - }, - }, - - /** - * GIS overrides - */ - { - files: ['x-pack/plugins/maps/**/*.js'], - rules: { - 'react/prefer-stateless-function': [0, { ignorePureComponents: false }], - }, - }, - - /** - * Graph overrides - */ - { - files: ['x-pack/plugins/graph/**/*.js'], - globals: { - angular: true, - $: true, - }, - rules: { - 'block-scoped-var': 'off', - camelcase: 'off', - eqeqeq: 'off', - 'guard-for-in': 'off', - 'new-cap': 'off', - 'no-loop-func': 'off', - 'no-redeclare': 'off', - 'no-shadow': 'off', - 'no-unused-vars': 'off', - 'one-var': 'off', - }, - }, - - /** - * ML overrides - */ - { - files: ['x-pack/plugins/ml/**/*.js'], - rules: { - 'no-shadow': 'error', - }, - }, - - /** - * disable jsx-a11y for kbn-ui-framework - */ - { - files: ['packages/kbn-ui-framework/**/*.js'], - rules: { - 'jsx-a11y/click-events-have-key-events': 'off', - 'jsx-a11y/anchor-has-content': 'off', - 'jsx-a11y/tabindex-no-positive': 'off', - 'jsx-a11y/label-has-associated-control': 'off', - 'jsx-a11y/aria-role': 'off', - }, - }, - - /** - * Monitoring overrides - */ - { - files: ['x-pack/plugins/monitoring/**/*.js'], - rules: { - 'block-spacing': ['error', 'always'], - curly: ['error', 'all'], - 'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }], - 'no-else-return': 'error', - }, - }, - { - files: ['x-pack/plugins/monitoring/public/**/*.js'], - env: { browser: true }, - }, - - /** - * Canvas overrides - */ - { - files: ['x-pack/plugins/canvas/**/*.js'], - rules: { - radix: 'error', - curly: ['error', 'all'], - - // module importing - 'import/order': [ - 'error', - { - groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], - }, - ], - 'import/extensions': ['error', 'never', { json: 'always', less: 'always', svg: 'always' }], - - // react - 'react/no-did-mount-set-state': 'error', - 'react/no-did-update-set-state': 'error', - 'react/no-multi-comp': ['error', { ignoreStateless: true }], - 'react/self-closing-comp': 'error', - 'react/sort-comp': 'error', - 'react/jsx-boolean-value': 'error', - 'react/jsx-wrap-multilines': 'error', - 'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }], - 'react/forbid-elements': [ - 'error', - { - forbid: [ - { - element: 'EuiConfirmModal', - message: 'Use instead', - }, - { - element: 'EuiPopover', - message: 'Use instead', - }, - { - element: 'EuiIconTip', - message: 'Use instead', - }, - ], - }, - ], - }, - }, - { - files: [ - 'x-pack/plugins/canvas/gulpfile.js', - 'x-pack/plugins/canvas/scripts/*.js', - 'x-pack/plugins/canvas/tasks/*.js', - 'x-pack/plugins/canvas/tasks/**/*.js', - 'x-pack/plugins/canvas/__tests__/**/*.js', - 'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', - ], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: true, - peerDependencies: true, - }, - ], - }, - }, - { - files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'], - globals: { canvas: true, $: true }, - rules: { - 'import/no-unresolved': [ - 'error', - { - ignore: ['!!raw-loader.+.svg$'], - }, - ], - }, - }, - { - files: ['x-pack/plugins/canvas/public/**/*.js'], - env: { - browser: true, - }, - }, - { - files: ['x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*.js'], - env: { - jquery: true, - }, - }, ] }; From 6e7a508d8faeb6d27963ab1fddaff08b60eb2eb5 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 5 Apr 2019 14:00:31 +0100 Subject: [PATCH 35/36] chore(NA): apply resticted paths to ts files too. --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index ba8b77a7866095..f1f2b34fae2fc1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -115,7 +115,7 @@ module.exports = { * Restricted paths */ { - files: ['**/*.js'], + files: ['**/*.{js,ts,tsx}'], rules: { '@kbn/eslint/no-restricted-paths': [ 'error', From 485de218a84747140b9105b087a688e452bd2e9b Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 5 Apr 2019 16:10:07 +0100 Subject: [PATCH 36/36] chore(NA): split comment from eslint ignore. --- src/legacy/ui/public/saved_objects/simple_saved_object.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/legacy/ui/public/saved_objects/simple_saved_object.ts b/src/legacy/ui/public/saved_objects/simple_saved_object.ts index 06e766d5f7dacf..4bb20efdf43fa3 100644 --- a/src/legacy/ui/public/saved_objects/simple_saved_object.ts +++ b/src/legacy/ui/public/saved_objects/simple_saved_object.ts @@ -34,7 +34,8 @@ import { SavedObjectsClient } from './saved_objects_client'; */ export class SimpleSavedObject { public attributes: T; - // eslint-disable-next-line variable-name We want to use the same interface this class had in JS + // 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'];