eng - use `esModuleInterop` for extensions

This commit is contained in:
Johannes 2024-10-01 21:57:30 +02:00
Родитель f09184ceb7
Коммит e6f315d2fc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 6DEF802A22264FCA
15 изменённых файлов: 17 добавлений и 16 удалений

Просмотреть файл

@ -290,7 +290,7 @@ export class ExtensionLinter {
const text = document.getText();
if (!this.markdownIt) {
this.markdownIt = new (await import('markdown-it'));
this.markdownIt = new ((await import('markdown-it')).default);
}
const tokens = this.markdownIt.parse(text, {});
const tokensAndPositions: TokenAndPosition[] = (function toTokensAndPositions(this: ExtensionLinter, tokens: MarkdownItType.Token[], begin = 0, end = text.length): TokenAndPosition[] {

Просмотреть файл

@ -8,7 +8,7 @@ import * as path from 'path';
import * as os from 'os';
import * as cp from 'child_process';
import { fileURLToPath } from 'url';
import * as which from 'which';
import which from 'which';
import { EventEmitter } from 'events';
import * as iconv from '@vscode/iconv-lite-umd';
import * as filetype from 'file-type';

Просмотреть файл

@ -6,7 +6,7 @@
import TelemetryReporter from '@vscode/extension-telemetry';
import * as fs from 'fs';
import * as path from 'path';
import * as picomatch from 'picomatch';
import picomatch from 'picomatch';
import { CancellationError, CancellationToken, CancellationTokenSource, Command, commands, Disposable, Event, EventEmitter, FileDecoration, l10n, LogLevel, LogOutputChannel, Memento, ProgressLocation, ProgressOptions, RelativePattern, scm, SourceControl, SourceControlInputBox, SourceControlInputBoxValidation, SourceControlInputBoxValidationType, SourceControlResourceDecorations, SourceControlResourceGroup, SourceControlResourceState, TabInputNotebookDiff, TabInputTextDiff, TabInputTextMultiDiff, ThemeColor, Uri, window, workspace, WorkspaceEdit } from 'vscode';
import { ActionButton } from './actionButton';
import { ApiRepository } from './api/api1';

Просмотреть файл

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import 'mocha';
import * as assert from 'assert';
import assert from 'assert';
import { workspace, commands, window, Uri, WorkspaceEdit, Range, TextDocument, extensions, TabInputTextDiff } from 'vscode';
import * as cp from 'child_process';
import * as fs from 'fs';

Просмотреть файл

@ -7,7 +7,7 @@ import { Event, Disposable, EventEmitter, SourceControlHistoryItemRef } from 'vs
import { dirname, sep, relative } from 'path';
import { Readable } from 'stream';
import { promises as fs, createReadStream } from 'fs';
import * as byline from 'byline';
import byline from 'byline';
export const isMacintosh = process.platform === 'darwin';
export const isWindows = process.platform === 'win32';

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import assert from 'assert';
import * as words from '../utils/strings';
import * as fs from 'fs';
import * as path from 'path';

Просмотреть файл

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import type * as nbformat from '@jupyterlab/nbformat';
import * as detectIndent from 'detect-indent';
import detectIndent from 'detect-indent';
import * as vscode from 'vscode';
import { getPreferredLanguage, jupyterNotebookModelToNotebookData } from './deserializers';
import * as fnv from '@enonic/fnv-plus';

Просмотреть файл

@ -129,7 +129,7 @@ export class MarkdownItEngine implements IMdParser {
if (!this._md) {
this._md = (async () => {
const markdownIt = await import('markdown-it');
let md: MarkdownIt = markdownIt(await getMarkdownOptions(() => md));
let md: MarkdownIt = markdownIt.default(await getMarkdownOptions(() => md));
md.linkify.set({ fuzzyLink: false });
for (const plugin of this._contributionProvider.contributions.markdownItPlugins.values()) {
@ -143,7 +143,7 @@ export class MarkdownItEngine implements IMdParser {
const frontMatterPlugin = await import('markdown-it-front-matter');
// Extract rules from front matter plugin and apply at a lower precedence
let fontMatterRule: any;
frontMatterPlugin({
frontMatterPlugin.default(<any>{
block: {
ruler: {
before: (_id: any, _id2: any, rule: any) => { fontMatterRule = rule; }

Просмотреть файл

@ -11,7 +11,7 @@ import { NpmScriptsTreeDataProvider } from './npmView';
import { getPackageManager, invalidateTasksCache, NpmTaskProvider, hasPackageJson } from './tasks';
import { invalidateHoverScriptsCache, NpmScriptHoverProvider } from './scriptHover';
import { NpmScriptLensProvider } from './npmScriptLens';
import * as which from 'which';
import which from 'which';
let treeDataProvider: NpmScriptsTreeDataProvider | undefined;

Просмотреть файл

@ -4,9 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import findWorkspaceRoot = require('../node_modules/find-yarn-workspace-root');
import * as findUp from 'find-up';
import findUp from 'find-up';
import * as path from 'path';
import * as whichPM from 'which-pm';
import whichPM from 'which-pm';
import { Uri, workspace } from 'vscode';
interface PreferredProperties {

Просмотреть файл

@ -10,7 +10,7 @@ import {
} from 'vscode';
import * as path from 'path';
import * as fs from 'fs';
import * as minimatch from 'minimatch';
import minimatch from 'minimatch';
import { Utils } from 'vscode-uri';
import { findPreferredPM } from './preferred-pm';
import { readScripts } from './readScripts';

Просмотреть файл

@ -5,7 +5,7 @@
import * as cp from 'child_process';
import { StringDecoder } from 'string_decoder';
import * as which from 'which';
import which from 'which';
import * as path from 'path';
import * as vscode from 'vscode';
import { ThrottledDelayer } from './utils/async';

Просмотреть файл

@ -1,5 +1,6 @@
{
"compilerOptions": {
"esModuleInterop": true,
"target": "es2020",
"lib": [
"ES2016",

Просмотреть файл

@ -5,7 +5,7 @@
import * as path from 'path';
import * as vscode from 'vscode';
import * as assert from 'assert';
import assert from 'assert';
suite('mapped edits provider', () => {

Просмотреть файл

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import assert from 'assert';
import * as fs from 'fs';
import { basename, join, posix } from 'path';
import * as vscode from 'vscode';