chore(code): fix type errors

This commit is contained in:
Elian Doran 2025-05-11 15:33:46 +03:00
parent 2476f380b0
commit 9e5f2bf8c8
No known key found for this signature in database
2 changed files with 8 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import { describe, expect, it } from "vitest";
async function lint(code: string, mimeType: string) {
const linterData = await _lint(mimeType);
console.log("Got linter data", linterData);
if (!("linter" in linterData)) {
return [];
}

View File

@ -1,3 +1,5 @@
import type { Linter } from "eslint-linter-browserify";
export async function lint(mimeType: string) {
const Linter = (await import("eslint-linter-browserify")).Linter;
@ -22,9 +24,7 @@ export async function lint(mimeType: string) {
}
return {
linter: new Linter(),
config: [
const config: (Linter.LegacyConfig | Linter.Config | Linter.Config[]) = [
js.configs.recommended,
{
languageOptions: {
@ -37,6 +37,10 @@ export async function lint(mimeType: string) {
"no-unused-vars": [ "warn", { vars: "local", args: "after-used" }]
}
}
]
];
return {
linter: new Linter(),
config
}
}