mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01: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) {
 | 
			
		||||
    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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user