Skip to content

Commit

Permalink
fixing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 committed Nov 8, 2024
1 parent 3b1a3be commit dd54689
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path = require("path");
import * as path from "path";

export namespace DummyFiles {
export function TestFolder(): string {
Expand Down
1 change: 0 additions & 1 deletion test/src/files/correct.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Github } from "../github";
import { Schema } from "../schema-tester";
import { Files } from "../utillity";

Expand Down
1 change: 0 additions & 1 deletion test/src/files/incorrect.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Github } from "../github";
import { Schema } from "../schema-tester";
import { Files } from "../utillity";

Expand Down
2 changes: 1 addition & 1 deletion test/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(",");

Expand Down
14 changes: 2 additions & 12 deletions test/src/schema-tester.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions test/src/utillity.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
13 changes: 5 additions & 8 deletions test/src/validator.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
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");
const files = Files.GetFiles(folder);
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;
Expand Down

0 comments on commit dd54689

Please sign in to comment.