Skip to content

Commit

Permalink
Fixes microsoft#208581: ESLint and .vscode/extensions is tricky to co…
Browse files Browse the repository at this point in the history
…nfigure (microsoft#210031)
  • Loading branch information
dbaeumer authored Apr 10, 2024
1 parent b9226f2 commit 13a88a8
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 44 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@
**/test/unit/assert.js
**/test/automation/out/**
**/typings/**
!.vscode
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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);
},
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
13 changes: 7 additions & 6 deletions .vscode/extensions/vscode-selfhost-test-provider/src/testTree.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 13a88a8

Please sign in to comment.