diff --git a/src/main.ts b/src/main.ts index b9df1cecc..b30faed03 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import path = require("path"); +import * as path from "path"; export namespace DummyFiles { export function TestFolder(): string { diff --git a/test/src/files/correct.test.ts b/test/src/files/correct.test.ts index a7bd48ff4..e30bf8ba6 100644 --- a/test/src/files/correct.test.ts +++ b/test/src/files/correct.test.ts @@ -1,4 +1,3 @@ -import { Github } from "../github"; import { Schema } from "../schema-tester"; import { Files } from "../utillity"; diff --git a/test/src/files/incorrect.test.ts b/test/src/files/incorrect.test.ts index eb1d596b7..1da6e9a5c 100644 --- a/test/src/files/incorrect.test.ts +++ b/test/src/files/incorrect.test.ts @@ -1,4 +1,3 @@ -import { Github } from "../github"; import { Schema } from "../schema-tester"; import { Files } from "../utillity"; diff --git a/test/src/github.ts b/test/src/github.ts index 839d039d2..5e1c34d81 100644 --- a/test/src/github.ts +++ b/test/src/github.ts @@ -9,7 +9,7 @@ export interface ErrorAnnotation { export namespace Github { export function createError(message: string, error: ErrorAnnotation = {}): void { const data = Object.entries(error) - .filter(([key, value]) => value !== undefined) + .filter(([, value]) => value !== undefined) .map(([key, value]) => `${key}=${value}`) .join(","); diff --git a/test/src/schema-tester.ts b/test/src/schema-tester.ts index d921842cc..fa5e60513 100644 --- a/test/src/schema-tester.ts +++ b/test/src/schema-tester.ts @@ -1,19 +1,9 @@ import { existsSync, readFileSync } from "fs"; +import * as path from "path"; import * as url from "url"; -import { - Diagnostic, - getLanguageService, - JSONDocument, - LanguageService, - LanguageSettings, - SchemaConfiguration, - SchemaRequestService, - TextDocument, - Thenable, -} from "vscode-json-languageservice"; +import { Diagnostic, getLanguageService, JSONDocument, LanguageService, LanguageSettings, SchemaConfiguration, TextDocument, Thenable } from "vscode-json-languageservice"; import * as data from "../../vscode-settings.json"; import { Files } from "./utillity"; -import path = require("path"); export namespace Schema { const workspaceContext = { diff --git a/test/src/utillity.ts b/test/src/utillity.ts index 78a0f5945..63f1eb9b1 100644 --- a/test/src/utillity.ts +++ b/test/src/utillity.ts @@ -1,5 +1,5 @@ -import FastGlob = require("fast-glob"); -import path = require("path"); +import * as FastGlob from "fast-glob"; +import * as path from "path"; export namespace Files { export function TestFolder(): string { diff --git a/test/src/validator.test.ts b/test/src/validator.test.ts index 4e72f723e..12f0c86a0 100644 --- a/test/src/validator.test.ts +++ b/test/src/validator.test.ts @@ -1,8 +1,8 @@ -import path = require("path"); -import { Files } from "./utillity"; -import * as fs from "fs"; import * as JSONC from "comment-json"; +import * as fs from "fs"; +import * as path from "path"; import { ErrorAnnotation, Github } from "./github"; +import { Files } from "./utillity"; describe("Validate", function () { const folder = path.join(Files.TestFolder(), "..", "source"); @@ -10,11 +10,8 @@ describe("Validate", function () { expect(files.length).toBeGreaterThan(0); test.each(files)("Validating schema parts: %s", (filepath) => { - let object: JsonSchema | undefined = undefined; - let data: string; - - data = fs.readFileSync(filepath, "utf8"); - object = JSONC.parse(data) as JsonSchema; + const data = fs.readFileSync(filepath, "utf8"); + const object = JSONC.parse(data) as JsonSchema; expect(object).toBeDefined(); if (!object) { return;