eng - use `esModuleInterop` for extensions
This commit is contained in:
Родитель
f09184ceb7
Коммит
e6f315d2fc
|
@ -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';
|
||||
|
|
Загрузка…
Ссылка в новой задаче