mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
fix(eslint): disable linting of TypeScript due to types (closes #1503)
This commit is contained in:
parent
2c694fe5d7
commit
b0e584924b
@ -55,4 +55,8 @@ describe("Linter", () => {
|
||||
expect(await lint(`module.exports("Hi");`, "application/javascript;env=backend")).toStrictEqual([]);
|
||||
expect(await lint(`module.exports("Hi");`, "application/javascript;env=frontend")).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("ignores TypeScript file", async () => {
|
||||
expect(await lint("export async function lint(code: string, mimeType: string) {}", "text/typescript-jsx")).toStrictEqual([]);
|
||||
});
|
||||
});
|
||||
|
@ -10,6 +10,12 @@ export async function lint(code: string, mimeType: string) {
|
||||
module: "readonly"
|
||||
};
|
||||
|
||||
// Unsupported languages
|
||||
if (mimeType.startsWith("text/typescript")) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Custom globals
|
||||
if (mimeType === "application/javascript;env=frontend") {
|
||||
globals = { ...globals, ...globalDefinitions.jquery };
|
||||
} else if (mimeType === "application/javascript;env=backend") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user