diff --git a/.eslintrc.js b/.eslintrc.js index 3778bd374da61..5802f67a7cd65 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1229,5 +1229,20 @@ module.exports = { '@typescript-eslint/prefer-ts-expect-error': 'error', }, }, + { + files: [ + '**/public/**/*.{js,mjs,ts,tsx}', + '**/common/**/*.{js,mjs,ts,tsx}', + 'packages/**/*.{js,mjs,ts,tsx}', + ], + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: ['lodash/*', '!lodash/fp'], + }, + ], + }, + }, ], }; diff --git a/packages/kbn-std/src/merge.ts b/packages/kbn-std/src/merge.ts index c0de50544a34e..dca8077435657 100644 --- a/packages/kbn-std/src/merge.ts +++ b/packages/kbn-std/src/merge.ts @@ -16,6 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isPlainObject from 'lodash/isPlainObject'; /** * Deeply merges two objects, omitting undefined values, and not deeply merging Arrays. diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx index 41dacfd8b588a..5fa74f927d2de 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx @@ -6,6 +6,8 @@ import cytoscape from 'cytoscape'; import dagre from 'cytoscape-dagre'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; import React, { createContext, diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.ts b/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.ts index 3f879196f2a4f..e77fc4dfb2f51 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.ts +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.ts @@ -5,6 +5,8 @@ */ import cytoscape from 'cytoscape'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import debounce from 'lodash/debounce'; import { useEffect } from 'react'; import { EuiTheme, useUiTracker } from '../../../../../observability/public'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_icon/source_icon.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_icon/source_icon.tsx index ddbe327a40a30..67d435e330c3d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_icon/source_icon.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_icon/source_icon.tsx @@ -6,6 +6,8 @@ import React from 'react'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import _camelCase from 'lodash/camelCase'; import { images } from '../assets'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx index 17ca8e58a80fa..a2e252c886354 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx @@ -7,6 +7,8 @@ import React from 'react'; import classNames from 'classnames'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import _kebabCase from 'lodash/kebabCase'; import { Link } from 'react-router-dom'; diff --git a/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js b/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js index 75569f472e219..b523dc3c1ba6c 100644 --- a/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js +++ b/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js @@ -5,6 +5,8 @@ */ import React from 'react'; import { i18n } from '@kbn/i18n'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEmpty from 'lodash/isEmpty'; import './brace_imports'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/policy_serialization.test.ts b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/policy_serialization.test.ts index 753ffb111cf13..222887069a0dc 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/policy_serialization.test.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/policy_serialization.test.ts @@ -3,6 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import cloneDeep from 'lodash/cloneDeep'; import { serializePolicy } from './policy_serialization'; import { diff --git a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/shared/serialize_phase_with_allocation.ts b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/shared/serialize_phase_with_allocation.ts index 5a9db3069aea6..c29ae3ab22831 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/shared/serialize_phase_with_allocation.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/shared/serialize_phase_with_allocation.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import cloneDeep from 'lodash/cloneDeep'; import { diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx index a32e1e68141b5..0541b811508ee 100644 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx +++ b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx @@ -5,6 +5,8 @@ */ import { i18n } from '@kbn/i18n'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import flowRight from 'lodash/flowRight'; import React from 'react'; import { Redirect, RouteComponentProps } from 'react-router-dom'; diff --git a/x-pack/plugins/licensing/public/services/feature_usage_service.ts b/x-pack/plugins/licensing/public/services/feature_usage_service.ts index c076bff58359f..d8fe892a2f684 100644 --- a/x-pack/plugins/licensing/public/services/feature_usage_service.ts +++ b/x-pack/plugins/licensing/public/services/feature_usage_service.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isDate from 'lodash/isDate'; import type { HttpSetup, HttpStart } from 'src/core/public'; import { LicenseType } from '../../common/types'; diff --git a/x-pack/plugins/ml/common/util/job_utils.ts b/x-pack/plugins/ml/common/util/job_utils.ts index 9729240567c24..04a460251cb6f 100644 --- a/x-pack/plugins/ml/common/util/job_utils.ts +++ b/x-pack/plugins/ml/common/util/job_utils.ts @@ -4,9 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEmpty from 'lodash/isEmpty'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import pick from 'lodash/pick'; import semver from 'semver'; diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js index d5025fd3c3649..67db378fb7951 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js +++ b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js @@ -10,6 +10,8 @@ * getting the annotations via props (used in Anomaly Explorer and Single Series Viewer). */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import uniq from 'lodash/uniq'; import PropTypes from 'prop-types'; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js index 378ee82805173..d6eb0afed753d 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js @@ -9,6 +9,8 @@ */ import PropTypes from 'prop-types'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; import React, { Component } from 'react'; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table_columns.js b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table_columns.js index 57f3a08713ffe..299173fc4436d 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table_columns.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table_columns.js @@ -7,6 +7,8 @@ import { EuiButtonIcon, EuiLink, EuiScreenReaderOnly } from '@elastic/eui'; import React from 'react'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.js b/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.js index c4ef45800dc3d..e0b20ab731749 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.js @@ -11,7 +11,11 @@ import PropTypes from 'prop-types'; import React, { Component, Fragment } from 'react'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import pick from 'lodash/pick'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/influencers_cell.js b/x-pack/plugins/ml/public/application/components/anomalies_table/influencers_cell.js index abdb0961351ab..505ccf46c5a62 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/influencers_cell.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/influencers_cell.js @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.js b/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.js index 6025dd1c7433e..114dc463fa3a6 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.js @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import cloneDeep from 'lodash/cloneDeep'; import moment from 'moment'; import rison from 'rison-node'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_table_settings.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_table_settings.ts index 052068c30b84c..71e503998ed47 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_table_settings.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_table_settings.ts @@ -6,7 +6,11 @@ import { useState } from 'react'; import { Direction, EuiBasicTableProps, EuiTableSortingType } from '@elastic/eui'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import sortBy from 'lodash/sortBy'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; const PAGE_SIZE = 10; diff --git a/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/combined_fields/geo_point.tsx b/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/combined_fields/geo_point.tsx index 831ae8de8081a..0f6ffe44cc9f8 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/combined_fields/geo_point.tsx +++ b/x-pack/plugins/ml/public/application/datavisualizer/file_based/components/combined_fields/geo_point.tsx @@ -5,6 +5,8 @@ */ import { i18n } from '@kbn/i18n'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import debounce from 'lodash/debounce'; import { FormattedMessage } from '@kbn/i18n/react'; import React, { ChangeEvent, Component, Fragment } from 'react'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.js index a6fda86f27a7c..9ca1d935c6e1e 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.js @@ -11,11 +11,23 @@ * and manages the layout of the charts in the containing div. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import find from 'lodash/find'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import sortBy from 'lodash/sortBy'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import map from 'lodash/map'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import reduce from 'lodash/reduce'; import { buildConfig } from './explorer_chart_config_builder'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.test.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.test.js index a7d422d161108..8e9e8a03929c3 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.test.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container_service.test.js @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import cloneDeep from 'lodash/cloneDeep'; import mockAnomalyChartRecords from './__mocks__/mock_anomaly_chart_records.json'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx b/x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx index 05e082711f619..f464eaf362c3a 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx +++ b/x-pack/plugins/ml/public/application/explorer/explorer_swimlane.tsx @@ -10,8 +10,14 @@ import React from 'react'; import './_explorer.scss'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import uniq from 'lodash/uniq'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; import d3 from 'd3'; import moment from 'moment'; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js index 8bc0057b27d6d..558fe4c73c597 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js @@ -7,6 +7,8 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import sortBy from 'lodash/sortBy'; import moment from 'moment'; diff --git a/x-pack/plugins/ml/public/application/services/forecast_service.js b/x-pack/plugins/ml/public/application/services/forecast_service.js index c13e265b4655c..a99c82015df4d 100644 --- a/x-pack/plugins/ml/public/application/services/forecast_service.js +++ b/x-pack/plugins/ml/public/application/services/forecast_service.js @@ -6,8 +6,14 @@ // Service for carrying out requests to run ML forecasts and to obtain // data on forecasts that have been performed. +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import find from 'lodash/find'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; import { map } from 'rxjs/operators'; diff --git a/x-pack/plugins/ml/public/application/services/job_service.js b/x-pack/plugins/ml/public/application/services/job_service.js index ea97492ae0f5a..eef760fb5d017 100644 --- a/x-pack/plugins/ml/public/application/services/job_service.js +++ b/x-pack/plugins/ml/public/application/services/job_service.js @@ -4,10 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import cloneDeep from 'lodash/cloneDeep'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import find from 'lodash/find'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isNumber from 'lodash/isNumber'; import moment from 'moment'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/ml/public/application/services/mapping_service.js b/x-pack/plugins/ml/public/application/services/mapping_service.js index 251bb0bce5690..76ed494995477 100644 --- a/x-pack/plugins/ml/public/application/services/mapping_service.js +++ b/x-pack/plugins/ml/public/application/services/mapping_service.js @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; import { ml } from './ml_api_service'; diff --git a/x-pack/plugins/ml/public/application/services/results_service/result_service_rx.ts b/x-pack/plugins/ml/public/application/services/results_service/result_service_rx.ts index 22f878a337f51..8ba71ba948b15 100644 --- a/x-pack/plugins/ml/public/application/services/results_service/result_service_rx.ts +++ b/x-pack/plugins/ml/public/application/services/results_service/result_service_rx.ts @@ -13,7 +13,11 @@ // Returned response contains a results property containing the requested aggregation. import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; import { Dictionary } from '../../../../common/types/common'; import { ML_MEDIAN_PERCENTS } from '../../../../common/util/job_utils'; diff --git a/x-pack/plugins/ml/public/application/services/results_service/results_service.js b/x-pack/plugins/ml/public/application/services/results_service/results_service.js index fd48845494dfd..fac1ee1480172 100644 --- a/x-pack/plugins/ml/public/application/services/results_service/results_service.js +++ b/x-pack/plugins/ml/public/application/services/results_service/results_service.js @@ -4,7 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; import { ML_MEDIAN_PERCENTS } from '../../../../common/util/job_utils'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js index d825844ffa14b..9f18eb1f4fed6 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js @@ -9,6 +9,8 @@ */ import PropTypes from 'prop-types'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; import React, { Component } from 'react'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js index c1afb2994c92f..78583fc4872b2 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js @@ -12,9 +12,17 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import useObservable from 'react-use/lib/useObservable'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import reduce from 'lodash/reduce'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; import d3 from 'd3'; import moment from 'moment'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseries_search_service.ts b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseries_search_service.ts index 5149fecb0ec26..b8f5f08822766 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseries_search_service.ts +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseries_search_service.ts @@ -4,9 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import find from 'lodash/find'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import filter from 'lodash/filter'; import { Observable } from 'rxjs'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/timeseriesexplorer_utils.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/timeseriesexplorer_utils.js index 7d14bb43ef811..c8c1c98e758b8 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/timeseriesexplorer_utils.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/timeseriesexplorer_utils.js @@ -10,8 +10,14 @@ * Viewer dashboard. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import each from 'lodash/each'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import find from 'lodash/find'; import moment from 'moment-timezone'; diff --git a/x-pack/plugins/ml/public/application/util/chart_config_builder.js b/x-pack/plugins/ml/public/application/util/chart_config_builder.js index bc63404a106db..0c4aa4f717dbe 100644 --- a/x-pack/plugins/ml/public/application/util/chart_config_builder.js +++ b/x-pack/plugins/ml/public/application/util/chart_config_builder.js @@ -9,6 +9,8 @@ * in the source metric data. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; import { mlFunctionToESAggregation } from '../../../common/util/job_utils'; diff --git a/x-pack/plugins/ml/public/application/util/time_buckets.js b/x-pack/plugins/ml/public/application/util/time_buckets.js index 15b8f24804ec8..f859b465f5de1 100644 --- a/x-pack/plugins/ml/public/application/util/time_buckets.js +++ b/x-pack/plugins/ml/public/application/util/time_buckets.js @@ -4,10 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isPlainObject from 'lodash/isPlainObject'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isString from 'lodash/isString'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import ary from 'lodash/ary'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import sortBy from 'lodash/sortBy'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import assign from 'lodash/assign'; import moment from 'moment'; import dateMath from '@elastic/datemath'; diff --git a/x-pack/plugins/ml/public/ml_url_generator/anomaly_detection_urls_generator.ts b/x-pack/plugins/ml/public/ml_url_generator/anomaly_detection_urls_generator.ts index 6a44756412fe3..97ee083bedaa6 100644 --- a/x-pack/plugins/ml/public/ml_url_generator/anomaly_detection_urls_generator.ts +++ b/x-pack/plugins/ml/public/ml_url_generator/anomaly_detection_urls_generator.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEmpty from 'lodash/isEmpty'; import { AnomalyDetectionQueryState, diff --git a/x-pack/plugins/ml/public/ml_url_generator/common.ts b/x-pack/plugins/ml/public/ml_url_generator/common.ts index f929e513e618a..59dddeed29888 100644 --- a/x-pack/plugins/ml/public/ml_url_generator/common.ts +++ b/x-pack/plugins/ml/public/ml_url_generator/common.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEmpty from 'lodash/isEmpty'; import { MlGenericUrlState } from '../../common/types/ml_url_generator'; import { setStateToKbnUrl } from '../../../../../src/plugins/kibana_utils/public'; diff --git a/x-pack/plugins/security_solution/public/common/containers/sourcerer/index.tsx b/x-pack/plugins/security_solution/public/common/containers/sourcerer/index.tsx index afacd68d71592..b02a09625ccf3 100644 --- a/x-pack/plugins/security_solution/public/common/containers/sourcerer/index.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/sourcerer/index.tsx @@ -5,6 +5,8 @@ */ import deepEqual from 'fast-deep-equal'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; import { useEffect, useMemo } from 'react'; import { useDispatch, useSelector } from 'react-redux'; diff --git a/x-pack/plugins/security_solution/public/common/store/sourcerer/reducer.ts b/x-pack/plugins/security_solution/public/common/store/sourcerer/reducer.ts index b65d4d6338e50..221244aaf9200 100644 --- a/x-pack/plugins/security_solution/public/common/store/sourcerer/reducer.ts +++ b/x-pack/plugins/security_solution/public/common/store/sourcerer/reducer.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEmpty from 'lodash/isEmpty'; import { reducerWithInitialState } from 'typescript-fsa-reducers'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx index 99999ddbf1976..dc31db76c3911 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx @@ -7,6 +7,8 @@ import { EuiButtonEmpty, EuiFormRow } from '@elastic/eui'; import React, { FC, memo, useCallback, useState, useEffect } from 'react'; import styled from 'styled-components'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; import { DEFAULT_INDEX_KEY } from '../../../../../common/constants'; diff --git a/x-pack/plugins/security_solution/public/timelines/containers/api.ts b/x-pack/plugins/security_solution/public/timelines/containers/api.ts index c6794d125368e..6350b36daa268 100644 --- a/x-pack/plugins/security_solution/public/timelines/containers/api.ts +++ b/x-pack/plugins/security_solution/public/timelines/containers/api.ts @@ -6,6 +6,8 @@ import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; import { pipe } from 'fp-ts/lib/pipeable'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEmpty from 'lodash/isEmpty'; import { throwErrors } from '../../../../case/common/api'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_pivot_editor/advanced_pivot_editor.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_pivot_editor/advanced_pivot_editor.tsx index cb888444ca867..afb0f49a8c816 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_pivot_editor/advanced_pivot_editor.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_pivot_editor/advanced_pivot_editor.tsx @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; import React, { memo, FC } from 'react'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.tsx index 6204aeff0306e..3cfab74f42111 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.tsx @@ -18,6 +18,8 @@ import { EuiSelectOption, } from '@elastic/eui'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import cloneDeep from 'lodash/cloneDeep'; import { useUpdateEffect } from 'react-use'; import { AggName } from '../../../../../../common/types/aggregations'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/apply_transform_config_to_define_state.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/apply_transform_config_to_define_state.ts index f00102a2f87c0..0235cdcf8b5e4 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/apply_transform_config_to_define_state.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/apply_transform_config_to_define_state.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; import { Dictionary } from '../../../../../../../common/types/common'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx index f27d50ac2773c..416d34481451e 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx @@ -7,6 +7,8 @@ import React, { useCallback, useContext, useEffect, useState } from 'react'; import { EuiComboBox, EuiFormRow } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import debounce from 'lodash/debounce'; import { useUpdateEffect } from 'react-use'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.ts b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.ts index c3430ed94c628..b0e1770c50d53 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.ts +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.ts @@ -4,7 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import isEqual from 'lodash/isEqual'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import merge from 'lodash/merge'; import { useReducer } from 'react'; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_table_settings.ts b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_table_settings.ts index ad40a3f8103b9..b3aafbd187c91 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_table_settings.ts +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_table_settings.ts @@ -6,7 +6,11 @@ import { useState } from 'react'; import { Direction, EuiBasicTableProps, EuiTableSortingType } from '@elastic/eui'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import sortBy from 'lodash/sortBy'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import get from 'lodash/get'; const PAGE_SIZE = 10; diff --git a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.tsx b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.tsx index 28a0990cf7526..e048eeed9534a 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.tsx +++ b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/components/connected_flyout_manage_drilldowns/connected_flyout_manage_drilldowns.tsx @@ -7,6 +7,8 @@ import React, { useEffect, useState, useMemo } from 'react'; import { ToastsStart } from 'kibana/public'; import useMountedState from 'react-use/lib/useMountedState'; +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import intersection from 'lodash/intersection'; import { DrilldownWizardConfig, FlyoutDrilldownWizard } from '../flyout_drilldown_wizard'; import { FlyoutListManageDrilldowns } from '../flyout_list_manage_drilldowns'; diff --git a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/url_drilldown_scope.ts b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/url_drilldown_scope.ts index 2c9237fac593f..4a6de4e26e8a7 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/url_drilldown_scope.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/url_drilldown_scope.ts @@ -4,6 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +// Prefer importing entire lodash library, e.g. import { get } from "lodash" +// eslint-disable-next-line no-restricted-imports import partition from 'lodash/partition'; import { getFlattenedObject } from '@kbn/std'; import { UrlDrilldownGlobalScope, UrlDrilldownScope } from './types';