Skip to content

Commit

Permalink
Remove noop from external dependencies (#10372)
Browse files Browse the repository at this point in the history
* Remove noop from external dependencies

* update noop restricted import rule
  • Loading branch information
rebornix authored Jun 8, 2022
1 parent d191916 commit 05ca1af
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ module.exports = {
],
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
'no-restricted-imports': ['error', { paths: ['lodash', 'rxjs'] }],
'no-restricted-imports': ['error', { paths: ['lodash', 'rxjs', 'lodash/noop', 'rxjs/util/noop'] }],
'import/no-restricted-paths': [
'error',
{
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/execution/notebookUpdater.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import noop = require('lodash/noop');
import { isPromise } from 'rxjs/internal-compatibility';
import { NotebookDocument, NotebookEditor, workspace, WorkspaceEdit, window } from 'vscode';
import { createDeferred } from '../../platform/common/utils/async';
import { noop } from '../../platform/common/utils/misc';

/**
* Use this class to perform updates on all cells.
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,6 @@
// Licensed under the MIT License.

import { inject, injectable } from 'inversify';
import noop = require('lodash/noop');
import { StatusBarAlignment, StatusBarItem } from 'vscode';
import { IExtensionSingleActivationService } from '../../platform/activation/types';
import {
Expand All @@ -19,6 +18,7 @@ import { INotebookControllerManager } from '../types';
import { IJupyterServerUriStorage } from '../../kernels/jupyter/types';
import { Settings } from '../../platform/common/constants';
import { isJupyterNotebook } from '../../platform/common/utils';
import { noop } from '../../platform/common/utils/misc';

@injectable()
export class RemoteSwitcher implements IExtensionSingleActivationService {
Expand Down
2 changes: 1 addition & 1 deletion src/platform/api/pythonApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
} from './types';
import * as localize from '../common/utils/localize';
import { injectable, inject } from 'inversify';
import { noop } from 'rxjs/util/noop';
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
import { IWorkspaceService, IApplicationShell, ICommandManager } from '../common/application/types';
import { isCI, PythonExtension, Telemetry } from '../common/constants';
Expand All @@ -30,6 +29,7 @@ import { IInterpreterSelector, IInterpreterQuickPickItem } from '../interpreter/
import { IInterpreterService } from '../interpreter/contracts';
import { areInterpreterPathsSame } from '../pythonEnvironments/info/interpreter';
import { TraceOptions } from '../logging/types';
import { noop } from '../common/utils/misc';

export function deserializePythonEnvironment(
pythonVersion: Partial<PythonEnvironment_PythonApi> | undefined
Expand Down
3 changes: 1 addition & 2 deletions src/test/datascience/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { assert } from 'chai';
import * as vscode from 'vscode';
import { getFilePath } from '../../platform/common/platform/fs-paths';
import { traceInfo } from '../../platform/logging';
import noop = require('lodash/noop');
import { IPythonApiProvider } from '../../platform/api/types';
import { IJupyterSettings, Resource } from '../../platform/common/types';
import { InteractiveWindow } from '../../interactive-window/interactiveWindow';
Expand All @@ -20,7 +19,7 @@ import {
import { IDataScienceCodeLensProvider } from '../../interactive-window/editor-integration/types';
import { IInteractiveWindowProvider, IInteractiveWindow } from '../../interactive-window/types';
import { Commands } from '../../platform/common/constants';
import { sleep } from '../core';
import { noop, sleep } from '../core';
import { arePathsSame } from '../../platform/common/platform/fileUtils';
import { IS_REMOTE_NATIVE_TEST } from '../constants';
import { isWeb } from '../../platform/common/utils/misc';
Expand Down
2 changes: 1 addition & 1 deletion src/test/datascience/mockCommandManager.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import noop = require('lodash/noop');
import { Disposable, TextEditor, TextEditorEdit } from 'vscode';

import { ICommandNameArgumentTypeMapping } from '../../platform/common/application/commands';
import { ICommandManager } from '../../platform/common/application/types';
import { noop } from '../core';

/* eslint-disable @typescript-eslint/no-explicit-any, , no-multi-str, */
export class MockCommandManager implements ICommandManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ suite('Dummy13', () => {
});
});
// import { assert } from 'chai';
// import { noop } from 'jquery';
// import * as portfinder from 'portfinder';
// import * as uuid from 'uuid/v4';
// import { IPythonExtensionChecker } from '../../../platform/api/types';
Expand Down

0 comments on commit 05ca1af

Please sign in to comment.