From 483cb9a7d3ad2ece88bc4fd69a984bf63bbdc920 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Tue, 19 Nov 2019 10:11:02 +0100 Subject: [PATCH] Upgrade typescript-eslint to 2.8.0 (#50956) * Upgrade typescript-eslint to 2.8.0 * merge eslint-utils versions --- package.json | 4 +- packages/eslint-config-kibana/package.json | 4 +- .../ErrorGroupDetails/DetailView/index.tsx | 2 - .../ServiceIntegrations/index.tsx | 2 - .../AddEditFlyout/index.tsx | 8 +-- .../Waterfall/SpanFlyout/index.tsx | 2 - .../shared/Summary/TransactionSummary.tsx | 2 - .../shared/charts/TransactionCharts/index.tsx | 2 - .../apm/server/lib/errors/get_error_groups.ts | 2 - .../get_services/get_services_items.ts | 4 -- .../get_agent_name_by_service.ts | 2 - .../lib/transactions/breakdown/index.ts | 2 - .../get_anomaly_data/get_ml_bucket_size.ts | 2 - .../charts/get_anomaly_data/transform.test.ts | 2 - .../charts/get_anomaly_data/transform.ts | 2 - .../charts/get_timeseries_data/transform.ts | 6 -- yarn.lock | 69 +++++++++++-------- 17 files changed, 47 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index b0a74a4a5e04..ac06753d7d04 100644 --- a/package.json +++ b/package.json @@ -347,8 +347,8 @@ "@types/uuid": "^3.4.4", "@types/vinyl-fs": "^2.4.11", "@types/zen-observable": "^0.8.0", - "@typescript-eslint/eslint-plugin": "^2.7.0", - "@typescript-eslint/parser": "^2.7.0", + "@typescript-eslint/eslint-plugin": "^2.8.0", + "@typescript-eslint/parser": "^2.8.0", "angular-mocks": "^1.7.8", "archiver": "^3.1.1", "axe-core": "^3.3.2", diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index c67629f058d5..71517bc10404 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,8 +15,8 @@ }, "homepage": "https://github.com/elastic/eslint-config-kibana#readme", "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^2.7.0", - "@typescript-eslint/parser": "^2.7.0", + "@typescript-eslint/eslint-plugin": "^2.8.0", + "@typescript-eslint/parser": "^2.8.0", "babel-eslint": "^10.0.3", "eslint": "^6.5.1", "eslint-plugin-babel": "^5.3.0", diff --git a/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupDetails/DetailView/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupDetails/DetailView/index.tsx index de7f0e133ba4..879733685c5f 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupDetails/DetailView/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupDetails/DetailView/index.tsx @@ -82,8 +82,6 @@ export function DetailView({ errorGroup, urlParams, location }: Props) { const errorUrl = error.error.page?.url || error.url?.full; const method = error.http?.request.method; - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const status = error.http?.response?.status_code; return ( diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/index.tsx index c4cc7dbfd5d1..8903900a625c 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/index.tsx @@ -148,8 +148,6 @@ export class ServiceIntegrations extends React.Component { panels={[ { id: 0, - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase items: this.getPanelItems(license.features.ml?.is_available) } ]} diff --git a/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/index.tsx index 46d6f80bf483..853ce26d324f 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/Settings/AgentConfigurations/AddEditFlyout/index.tsx @@ -88,21 +88,17 @@ export function AddEditFlyout({ // config settings const [sampleRate, setSampleRate] = useState( - // TODO(TS-3.7-ESLINT) ( - selectedConfig?.settings.transaction_sample_rate || // eslint-disable-line @typescript-eslint/camelcase + selectedConfig?.settings.transaction_sample_rate || defaultSettings.TRANSACTION_SAMPLE_RATE ).toString() ); const [captureBody, setCaptureBody] = useState( - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase selectedConfig?.settings.capture_body || defaultSettings.CAPTURE_BODY ); const [transactionMaxSpans, setTransactionMaxSpans] = useState( - // TODO(TS-3.7-ESLINT) ( - selectedConfig?.settings.transaction_max_spans || // eslint-disable-line @typescript-eslint/camelcase + selectedConfig?.settings.transaction_max_spans || defaultSettings.TRANSACTION_MAX_SPANS ).toString() ); diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/index.tsx index bb7c03c63f8a..cc1f9dd529bc 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/index.tsx @@ -101,8 +101,6 @@ export function SpanFlyout({ const dbContext = span.span.db; const httpContext = span.span.http; const spanTypes = getSpanTypes(span); - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const spanHttpStatusCode = httpContext?.response.status_code; const spanHttpUrl = httpContext?.url?.original; const spanHttpMethod = httpContext?.method; diff --git a/x-pack/legacy/plugins/apm/public/components/shared/Summary/TransactionSummary.tsx b/x-pack/legacy/plugins/apm/public/components/shared/Summary/TransactionSummary.tsx index 4de70895ff32..c24435d38100 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/Summary/TransactionSummary.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/Summary/TransactionSummary.tsx @@ -29,8 +29,6 @@ const getTransactionResultSummaryItem = (transaction: Transaction) => { if (url) { const method = transaction.http?.request.method; - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const status = transaction.http?.response?.status_code; return ; diff --git a/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/index.tsx b/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/index.tsx index bb4d9fa26498..c032d6035990 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/index.tsx @@ -171,8 +171,6 @@ export class TransactionCharts extends Component { {license => - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase this.renderMLHeader(license.features.ml?.is_available) } diff --git a/x-pack/legacy/plugins/apm/server/lib/errors/get_error_groups.ts b/x-pack/legacy/plugins/apm/server/lib/errors/get_error_groups.ts index baaa2d97752e..24e7114efdde 100644 --- a/x-pack/legacy/plugins/apm/server/lib/errors/get_error_groups.ts +++ b/x-pack/legacy/plugins/apm/server/lib/errors/get_error_groups.ts @@ -105,8 +105,6 @@ export async function getErrorGroups({ // aggregations can be undefined when no matching indices are found. // this is an exception rather than the rule so the ES type does not account for this. - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const hits = (resp.aggregations?.error_groups.buckets || []).map(bucket => { const source = bucket.sample.hits.hits[0]._source; const message = diff --git a/x-pack/legacy/plugins/apm/server/lib/services/get_services/get_services_items.ts b/x-pack/legacy/plugins/apm/server/lib/services/get_services/get_services_items.ts index 240a3bd35cbe..6611ae76bc33 100644 --- a/x-pack/legacy/plugins/apm/server/lib/services/get_services/get_services_items.ts +++ b/x-pack/legacy/plugins/apm/server/lib/services/get_services/get_services_items.ts @@ -58,13 +58,9 @@ export async function getServicesItems(setup: Setup) { const eventTypes = bucket.events.buckets; const transactions = eventTypes.find(e => e.key === 'transaction'); - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const totalTransactions = transactions?.doc_count || 0; const errors = eventTypes.find(e => e.key === 'error'); - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const totalErrors = errors?.doc_count || 0; const deltaAsMinutes = (end - start) / 1000 / 60; diff --git a/x-pack/legacy/plugins/apm/server/lib/settings/agent_configuration/get_agent_name_by_service.ts b/x-pack/legacy/plugins/apm/server/lib/settings/agent_configuration/get_agent_name_by_service.ts index 83df9153e557..dccf8b110d08 100644 --- a/x-pack/legacy/plugins/apm/server/lib/settings/agent_configuration/get_agent_name_by_service.ts +++ b/x-pack/legacy/plugins/apm/server/lib/settings/agent_configuration/get_agent_name_by_service.ts @@ -48,8 +48,6 @@ export async function getAgentNameByService({ }; const { aggregations } = await client.search(params); - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const agentName = aggregations?.agent_names.buckets[0].key as | string | undefined; diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/breakdown/index.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/breakdown/index.ts index 1c84c68fd8c4..3166938090d8 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/breakdown/index.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/breakdown/index.ts @@ -148,8 +148,6 @@ export async function getTransactionBreakdown({ const kpiNames = kpis.map(kpi => kpi.name); - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const bucketsByDate = resp.aggregations?.by_date.buckets || []; const timeseriesPerSubtype = bucketsByDate.reduce((prev, bucket) => { diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/get_ml_bucket_size.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/get_ml_bucket_size.ts index dfa9e9b70abd..4933f1b1ed43 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/get_ml_bucket_size.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/get_ml_bucket_size.ts @@ -49,8 +49,6 @@ export async function getMlBucketSize({ try { const resp = await client.search(params); - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase return resp.hits.hits[0]?._source.bucket_span || 0; } catch (err) { const isHttpError = 'statusCode' in err; diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.test.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.test.ts index 83a7ffe1f241..6f8fb39d8933 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.test.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.test.ts @@ -293,8 +293,6 @@ function getESResponse(buckets: any): ESResponse { lower: { value: bucket?.lower?.value || null }, upper: { value: bucket?.upper?.value || null }, anomaly_score: { - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase value: bucket?.anomaly_score?.value || null } }; diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.ts index 2994990067d0..aa69d069ebe0 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.ts @@ -32,8 +32,6 @@ export function anomalySeriesTransform( timeSeriesDates: number[] ) { const buckets = - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase response.aggregations?.ml_avg_response_times.buckets.map(getBucket) || []; const bucketSizeInMillis = Math.max(bucketSize, mlBucketSize) * 1000; diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts index 1752258078ad..b16958a26927 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts @@ -19,15 +19,9 @@ export function timeseriesTransformer({ bucketSize: number; }) { const aggs = timeseriesResponse.aggregations; - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const overallAvgDuration = aggs?.overall_avg_duration.value || null; - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const responseTimeBuckets = aggs?.response_times.buckets || []; const { avg, p95, p99 } = getResponseTime(responseTimeBuckets); - // TODO(TS-3.7-ESLINT) - // eslint-disable-next-line @typescript-eslint/camelcase const transactionResultBuckets = aggs?.transaction_results.buckets || []; const tpmBuckets = getTpmBuckets(transactionResultBuckets, bucketSize); diff --git a/yarn.lock b/yarn.lock index 30d5f1544ecd..150e7a98796f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4209,24 +4209,24 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d" integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg== -"@typescript-eslint/eslint-plugin@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.7.0.tgz#dff176bdb73dfd7e2e43062452189bd1b9db6021" - integrity sha512-H5G7yi0b0FgmqaEUpzyBlVh0d9lq4cWG2ap0RKa6BkF3rpBb6IrAoubt1NWh9R2kRs/f0k6XwRDiDz3X/FqXhQ== +"@typescript-eslint/eslint-plugin@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.8.0.tgz#eca584d46094ebebc3cb3e9fb625bfbc904a534d" + integrity sha512-ohqul5s6XEB0AzPWZCuJF5Fd6qC0b4+l5BGEnrlpmvXxvyymb8yw8Bs4YMF8usNAeuCJK87eFIHy8g8GFvOtGA== dependencies: - "@typescript-eslint/experimental-utils" "2.7.0" - eslint-utils "^1.4.2" + "@typescript-eslint/experimental-utils" "2.8.0" + eslint-utils "^1.4.3" functional-red-black-tree "^1.0.1" - regexpp "^2.0.1" + regexpp "^3.0.0" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.7.0.tgz#58d790a3884df3041b5a5e08f9e5e6b7c41864b5" - integrity sha512-9/L/OJh2a5G2ltgBWJpHRfGnt61AgDeH6rsdg59BH0naQseSwR7abwHq3D5/op0KYD/zFT4LS5gGvWcMmegTEg== +"@typescript-eslint/experimental-utils@2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.8.0.tgz#208b4164d175587e9b03ce6fea97d55f19c30ca9" + integrity sha512-jZ05E4SxCbbXseQGXOKf3ESKcsGxT8Ucpkp1jiVp55MGhOvZB2twmWKf894PAuVQTCgbPbJz9ZbRDqtUWzP8xA== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.7.0" + "@typescript-eslint/typescript-estree" "2.8.0" eslint-scope "^5.0.0" "@typescript-eslint/experimental-utils@^1.13.0": @@ -4238,14 +4238,14 @@ "@typescript-eslint/typescript-estree" "1.13.0" eslint-scope "^4.0.0" -"@typescript-eslint/parser@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.7.0.tgz#b5e6a4944e2b68dba1e7fbfd5242e09ff552fd12" - integrity sha512-ctC0g0ZvYclxMh/xI+tyqP0EC2fAo6KicN9Wm2EIao+8OppLfxji7KAGJosQHSGBj3TcqUrA96AjgXuKa5ob2g== +"@typescript-eslint/parser@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.8.0.tgz#e10f7c40c8cf2fb19920c879311e6c46ad17bacb" + integrity sha512-NseXWzhkucq+JM2HgqAAoKEzGQMb5LuTRjFPLQzGIdLthXMNUfuiskbl7QSykvWW6mvzCtYbw1fYWGa2EIaekw== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.7.0" - "@typescript-eslint/typescript-estree" "2.7.0" + "@typescript-eslint/experimental-utils" "2.8.0" + "@typescript-eslint/typescript-estree" "2.8.0" eslint-visitor-keys "^1.1.0" "@typescript-eslint/typescript-estree@1.13.0": @@ -4256,13 +4256,14 @@ lodash.unescape "4.0.1" semver "5.5.0" -"@typescript-eslint/typescript-estree@2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.7.0.tgz#34fd98c77a07b40d04d5b4203eddd3abeab909f4" - integrity sha512-vVCE/DY72N4RiJ/2f10PTyYekX2OLaltuSIBqeHYI44GQ940VCYioInIb8jKMrK9u855OEJdFC+HmWAZTnC+Ag== +"@typescript-eslint/typescript-estree@2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.8.0.tgz#fcc3fe6532840085d29b75432c8a59895876aeca" + integrity sha512-ksvjBDTdbAQ04cR5JyFSDX113k66FxH1tAXmi+dj6hufsl/G0eMc/f1GgLjEVPkYClDbRKv+rnBFuE5EusomUw== dependencies: debug "^4.1.1" - glob "^7.1.4" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" is-glob "^4.0.1" lodash.unescape "4.0.1" semver "^6.3.0" @@ -11381,12 +11382,12 @@ eslint-scope@^5.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" - integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== +eslint-utils@^1.4.2, eslint-utils@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== dependencies: - eslint-visitor-keys "^1.0.0" + eslint-visitor-keys "^1.1.0" eslint-visitor-keys@^1.0.0: version "1.0.0" @@ -13483,6 +13484,18 @@ glob@^6.0.1, glob@^6.0.4: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@~7.0.0: version "7.0.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.6.tgz#211bafaf49e525b8cd93260d14ab136152b3f57a"