diff --git a/src/public/app/services/eslint.spec.ts b/src/public/app/services/eslint.spec.ts index c6b87162a..42eac213c 100644 --- a/src/public/app/services/eslint.spec.ts +++ b/src/public/app/services/eslint.spec.ts @@ -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([]); + }); }); diff --git a/src/public/app/services/eslint.ts b/src/public/app/services/eslint.ts index 4563239e6..bdb2dcaee 100644 --- a/src/public/app/services/eslint.ts +++ b/src/public/app/services/eslint.ts @@ -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") {