mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-01 20:32:19 +08:00
chore(code): fix type errors
This commit is contained in:
parent
2476f380b0
commit
9e5f2bf8c8
@ -4,7 +4,6 @@ import { describe, expect, it } from "vitest";
|
|||||||
|
|
||||||
async function lint(code: string, mimeType: string) {
|
async function lint(code: string, mimeType: string) {
|
||||||
const linterData = await _lint(mimeType);
|
const linterData = await _lint(mimeType);
|
||||||
console.log("Got linter data", linterData);
|
|
||||||
if (!("linter" in linterData)) {
|
if (!("linter" in linterData)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import type { Linter } from "eslint-linter-browserify";
|
||||||
|
|
||||||
export async function lint(mimeType: string) {
|
export async function lint(mimeType: string) {
|
||||||
|
|
||||||
const Linter = (await import("eslint-linter-browserify")).Linter;
|
const Linter = (await import("eslint-linter-browserify")).Linter;
|
||||||
@ -22,9 +24,7 @@ export async function lint(mimeType: string) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
const config: (Linter.LegacyConfig | Linter.Config | Linter.Config[]) = [
|
||||||
linter: new Linter(),
|
|
||||||
config: [
|
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
{
|
{
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
@ -37,6 +37,10 @@ export async function lint(mimeType: string) {
|
|||||||
"no-unused-vars": [ "warn", { vars: "local", args: "after-used" }]
|
"no-unused-vars": [ "warn", { vars: "local", args: "after-used" }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
linter: new Linter(),
|
||||||
|
config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user