mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
chore(code): fix type errors
This commit is contained in:
@@ -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 [];
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user