mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 04:42:28 +08:00
chore(code): fix type errors
This commit is contained in:
parent
2476f380b0
commit
9e5f2bf8c8
2 changed files with 8 additions and 5 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue