Skip to content

Commit

Permalink
Avoid loading full lodash.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Jun 3, 2022
1 parent 453f25d commit f3f99f6
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ module.exports = {
],
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
'no-restricted-imports': ['error', { "paths": ["lodash"] }],
'import/no-restricted-paths': [
'error',
{
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/jupyter/preferredRemoteKernelIdProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { inject, injectable, named } from 'inversify';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import { Memento, Uri } from 'vscode';
import { traceInfo, traceVerbose } from '../../platform/logging';
import { getDisplayPath } from '../../platform/common/platform/fs-paths';
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/jupyter/serverSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict';

import { inject, injectable } from 'inversify';
import { isNil } from 'lodash';
import isNil from 'lodash/isNil';
import { EventEmitter, QuickPickItem, ThemeIcon, Uri } from 'vscode';
import { IApplicationShell, IClipboard } from '../../platform/common/application/types';
import { traceDecoratorError, traceError, traceWarning } from '../../platform/logging';
Expand Down
2 changes: 1 addition & 1 deletion src/notebooks/controllers/remoteSwitcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { inject, injectable } from 'inversify';
import { noop } from 'lodash';
import noop from 'lodash/noop';
import { StatusBarAlignment, StatusBarItem } from 'vscode';
import { IExtensionSingleActivationService } from '../../platform/activation/types';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/notebooks/execution/notebookUpdater.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { noop } from 'lodash';
import noop from 'lodash/noop';
import { isPromise } from 'rxjs/internal-compatibility';
import { NotebookDocument, NotebookEditor, workspace, WorkspaceEdit, window } from 'vscode';
import { createDeferred } from '../../platform/common/utils/async';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from 'chai';
import { cloneDeep } from 'lodash';
import cloneDeep from 'lodash/cloneDeep';
import * as sinon from 'sinon';
import * as path from '../../../platform/vscode-path/path';
import * as vscode from 'vscode';
Expand Down
2 changes: 1 addition & 1 deletion src/test/datascience/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import * as vscode from 'vscode';
import { getFilePath } from '../../platform/common/platform/fs-paths';
import { traceInfo } from '../../platform/logging';
import { noop } from 'lodash';
import noop from 'lodash/noop';
import { IPythonApiProvider } from '../../platform/api/types';
import { IJupyterSettings, Resource } from '../../platform/common/types';
import { InteractiveWindow } from '../../interactive-window/interactiveWindow';
Expand Down
2 changes: 1 addition & 1 deletion src/test/datascience/mockCommandManager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { noop } from 'lodash';
import noop from 'lodash/noop';
import { Disposable, TextEditor, TextEditorEdit } from 'vscode';

import { ICommandNameArgumentTypeMapping } from '../../platform/common/application/commands';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { inject, injectable } from 'inversify';

import { captureTelemetry } from '../../../telemetry';
import { IDataViewer, IDataViewerDataProvider, IDataViewerFactory } from './types';
import { debounce } from 'lodash';
import debounce from 'lodash/debounce';
import { ICommandManager } from '../../../platform/common/application/types';
import { ContextKey } from '../../../platform/common/contextKey';
import { IAsyncDisposable, IAsyncDisposableRegistry, IDisposableRegistry } from '../../../platform/common/types';
Expand Down
2 changes: 1 addition & 1 deletion src/webviews/webview-side/data-explorer/mainPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { generateTestData } from './testData';
import '../react-common/codicon/codicon.css';
import '../react-common/seti/seti.less';
import { SliceControl } from './sliceControl';
import { debounce } from 'lodash';
import debounce from 'lodash/debounce';
import * as uuid from 'uuid/v4';

import { initializeIcons } from '@fluentui/react';
Expand Down

0 comments on commit f3f99f6

Please sign in to comment.