Fixes #208581: ESLint and .vscode/extensions is tricky to configure (#210031)

This commit is contained in:
Dirk Bäumer 2024-04-10 12:03:56 +02:00 committed by GitHub
parent b9226f2929
commit 13a88a8da4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 56 additions and 44 deletions

View File

@ -33,3 +33,4 @@
**/test/unit/assert.js
**/test/automation/out/**
**/typings/**
!.vscode

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IstanbulCoverageContext } from 'istanbul-to-vscode';

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Debounces the function call for an interval.

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { randomBytes } from 'crypto';
import { tmpdir } from 'os';

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import {
@ -98,15 +99,15 @@ const formatJsonValue = (value: unknown) => {
context => (node: ts.Node) => {
const visitor = (node: ts.Node): ts.Node =>
ts.isPropertyAssignment(node) &&
ts.isStringLiteralLike(node.name) &&
identifierLikeRe.test(node.name.text)
ts.isStringLiteralLike(node.name) &&
identifierLikeRe.test(node.name.text)
? ts.factory.createPropertyAssignment(
ts.factory.createIdentifier(node.name.text),
ts.visitNode(node.initializer, visitor) as ts.Expression
)
ts.factory.createIdentifier(node.name.text),
ts.visitNode(node.initializer, visitor) as ts.Expression
)
: ts.isStringLiteralLike(node) && node.text === '[undefined]'
? ts.factory.createIdentifier('undefined')
: ts.visitEachChild(node, visitor, context);
? ts.factory.createIdentifier('undefined')
: ts.visitEachChild(node, visitor, context);
return ts.visitNode(node, visitor);
},
@ -189,7 +190,7 @@ class StrictEqualAssertion {
return undefined;
}
constructor(private readonly expression: ts.CallExpression) {}
constructor(private readonly expression: ts.CallExpression) { }
/** Gets the expected value */
public get expectedValue(): ts.Expression | undefined {

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export const memoizeLast = <A, T>(fn: (args: A) => T): ((args: A) => T) => {
let last: { arg: A; result: T } | undefined;

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { TestMessage } from 'vscode';
export interface TestMessageMetadata {

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { promises as fs } from 'fs';
import * as vscode from 'vscode';

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import * as vscode from 'vscode';

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import {
GREATEST_LOWER_BOUND,

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { join, relative } from 'path';
import * as ts from 'typescript';
@ -57,7 +58,7 @@ export class TestFile {
constructor(
public readonly uri: vscode.Uri,
public readonly workspaceFolder: vscode.WorkspaceFolder
) {}
) { }
public getId() {
return this.uri.toString().toLowerCase();
@ -168,8 +169,8 @@ export abstract class TestConstruct {
}
}
export class TestSuite extends TestConstruct {}
export class TestSuite extends TestConstruct { }
export class TestCase extends TestConstruct {}
export class TestCase extends TestConstruct { }
export type VSCodeTest = TestFile | TestSuite | TestCase;

View File

@ -1,6 +1,7 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { spawn } from 'child_process';
import { promises as fs } from 'fs';