Skip to content

Commit 08d1072

Browse files
refactor: enable esModuleInterop, fix imports #3760
Set esModuleInterop in tsconfig.json to enable module import compatibility with CommonJS modules. Now we do not need to use "import * as x from 'x'" anymore. Signed-off-by: Nikolas Komonen <[email protected]>
1 parent 297f88b commit 08d1072

File tree

335 files changed

+363
-361
lines changed

Some content is hidden

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

335 files changed

+363
-361
lines changed

scripts/lint/testLint.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { glob } from 'glob'
7-
import * as Mocha from 'mocha'
6+
import glob from 'glob'
7+
import Mocha from 'mocha'
8+
89
;(async () => {
910
try {
1011
console.log('Running linting tests...')

src/apprunner/explorer/apprunnerServiceNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import * as AsyncLock from 'async-lock'
6+
import AsyncLock from 'async-lock'
77
import { AppRunnerClient } from '../../shared/clients/apprunnerClient'
88
import { AppRunner } from 'aws-sdk'
99
import { AppRunnerNode } from './apprunnerNode'

src/awsexplorer/childNodeLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AWSTreeNodeBase } from '../shared/treeview/nodes/awsTreeNodeBase'
77
import { LoadMoreNode } from '../shared/treeview/nodes/loadMoreNode'
88
import { MoreResultsNode } from './moreResultsNode'
99
import { ChildNodeCache } from './childNodeCache'
10-
import * as AsyncLock from 'async-lock'
10+
import AsyncLock from 'async-lock'
1111

1212
const lockKey = 'ChildNodeLoader'
1313

src/cloudWatchLogs/commands/addLogEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import * as vscode from 'vscode'
7-
import * as AsyncLock from 'async-lock'
7+
import AsyncLock from 'async-lock'
88
import { getLogger } from '../../shared/logger/logger'
99
import { LogDataRegistry } from '../registry/logDataRegistry'
1010
import { CancellationError } from '../../shared/utilities/timeoutUtils'

src/cloudWatchLogs/commands/viewLogStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as nls from 'vscode-nls'
77
const localize = nls.loadMessageBundle()
88

99
import * as vscode from 'vscode'
10-
import * as moment from 'moment'
10+
import moment from 'moment'
1111
import * as picker from '../../shared/ui/picker'
1212
import { MultiStepWizard, WIZARD_RETRY, WIZARD_TERMINATE, WizardStep } from '../../shared/wizards/multiStepWizard'
1313
import { LogGroupNode } from '../explorer/logGroupNode'

src/cloudWatchLogs/document/textContent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import * as moment from 'moment'
6+
import moment from 'moment'
77
import { INSIGHTS_TIMESTAMP_FORMAT } from '../../shared/constants'
88
import { CloudWatchLogsEvent, CloudWatchLogsGroupInfo } from '../registry/logDataRegistry'
99

src/codewhisperer/service/inlineCompletionService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import globals from '../../shared/extensionGlobals'
2323
import { AuthUtil } from '../util/authUtil'
2424
import { shared } from '../../shared/utilities/functionUtils'
2525
import { ImportAdderProvider } from './importAdderProvider'
26-
import * as AsyncLock from 'async-lock'
26+
import AsyncLock from 'async-lock'
2727
import { updateInlineLockKey } from '../models/constants'
2828
import { ClassifierTrigger } from './classifierTrigger'
2929
import { CodeWhispererUserGroupSettings } from '../util/userGroupUtil'

src/codewhisperer/util/dependencyGraph/dependencyGraph.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as fs from 'fs-extra'
77
import * as vscode from 'vscode'
8-
import * as admZip from 'adm-zip'
8+
import admZip from 'adm-zip'
99
import { existsSync, statSync } from 'fs'
1010
import { asyncCallWithTimeout } from '../commonUtil'
1111
import path = require('path')

src/codewhisperer/util/supplementalContext/utgUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import * as glob from 'glob'
6+
import glob from 'glob'
77
import * as fs from 'fs-extra'
88
import * as path from 'path'
99
import * as vscode from 'vscode'

src/dev/beta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import * as path from 'path'
77
import * as nls from 'vscode-nls'
88
import * as vscode from 'vscode'
9-
import * as AdmZip from 'adm-zip'
9+
import AdmZip from 'adm-zip'
1010
import got from 'got'
1111
import globals from '../shared/extensionGlobals'
1212
import { getLogger } from '../shared/logger'

0 commit comments

Comments
 (0)