Skip to content

Commit 63ce752

Browse files
Adding comment about importing lodash library (#78156)
* added comment about importing lodash library * fixed space with prefer * cleaned up extra space and removed comments for lodash/fp * took out the comment in server files * Remove newlines Co-authored-by: Nathan L Smith <smith@nlsmith.com>
1 parent 83c44db commit 63ce752

File tree

49 files changed

+179
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+179
-0
lines changed

.eslintrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,5 +1229,20 @@ module.exports = {
12291229
'@typescript-eslint/prefer-ts-expect-error': 'error',
12301230
},
12311231
},
1232+
{
1233+
files: [
1234+
'**/public/**/*.{js,mjs,ts,tsx}',
1235+
'**/common/**/*.{js,mjs,ts,tsx}',
1236+
'packages/**/*.{js,mjs,ts,tsx}',
1237+
],
1238+
rules: {
1239+
'no-restricted-imports': [
1240+
'error',
1241+
{
1242+
patterns: ['lodash/*', '!lodash/fp'],
1243+
},
1244+
],
1245+
},
1246+
},
12321247
],
12331248
};

packages/kbn-std/src/merge.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
20+
// eslint-disable-next-line no-restricted-imports
1921
import isPlainObject from 'lodash/isPlainObject';
2022
/**
2123
* Deeply merges two objects, omitting undefined values, and not deeply merging Arrays.

x-pack/plugins/apm/public/components/app/ServiceMap/Cytoscape.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
import cytoscape from 'cytoscape';
88
import dagre from 'cytoscape-dagre';
9+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
10+
// eslint-disable-next-line no-restricted-imports
911
import isEqual from 'lodash/isEqual';
1012
import React, {
1113
createContext,

x-pack/plugins/apm/public/components/app/ServiceMap/use_cytoscape_event_handlers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66

77
import cytoscape from 'cytoscape';
8+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
9+
// eslint-disable-next-line no-restricted-imports
810
import debounce from 'lodash/debounce';
911
import { useEffect } from 'react';
1012
import { EuiTheme, useUiTracker } from '../../../../../observability/public';

x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_icon/source_icon.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
import React from 'react';
88

9+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
10+
// eslint-disable-next-line no-restricted-imports
911
import _camelCase from 'lodash/camelCase';
1012

1113
import { images } from '../assets';

x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import React from 'react';
88

99
import classNames from 'classnames';
10+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
11+
// eslint-disable-next-line no-restricted-imports
1012
import _kebabCase from 'lodash/kebabCase';
1113
import { Link } from 'react-router-dom';
1214

x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
import React from 'react';
77
import { i18n } from '@kbn/i18n';
8+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
9+
// eslint-disable-next-line no-restricted-imports
810
import isEmpty from 'lodash/isEmpty';
911

1012
import './brace_imports';

x-pack/plugins/index_lifecycle_management/public/application/services/policies/policy_serialization.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
7+
// eslint-disable-next-line no-restricted-imports
68
import cloneDeep from 'lodash/cloneDeep';
79
import { serializePolicy } from './policy_serialization';
810
import {

x-pack/plugins/index_lifecycle_management/public/application/services/policies/shared/serialize_phase_with_allocation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
8+
// eslint-disable-next-line no-restricted-imports
79
import cloneDeep from 'lodash/cloneDeep';
810

911
import {

x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66

77
import { i18n } from '@kbn/i18n';
8+
// Prefer importing entire lodash library, e.g. import { get } from "lodash"
9+
// eslint-disable-next-line no-restricted-imports
810
import flowRight from 'lodash/flowRight';
911
import React from 'react';
1012
import { Redirect, RouteComponentProps } from 'react-router-dom';

0 commit comments

Comments
 (0)