mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-02 21:42:15 +08:00
feat(eslint): add support for module.exports
This commit is contained in:
parent
1fb4634b7b
commit
be6e56fbe8
@ -50,4 +50,9 @@ describe("Linter", () => {
|
||||
expect(await lint(`$("<div>");`, "application/javascript;env=backend")).toMatchObject([{ "ruleId": "no-undef" }]);
|
||||
expect(await lint(`console.log($("<div>"));`, "application/javascript;env=frontend")).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it("supports module.exports", async () => {
|
||||
expect(await lint(`module.exports("Hi");`, "application/javascript;env=backend")).toStrictEqual([]);
|
||||
expect(await lint(`module.exports("Hi");`, "application/javascript;env=frontend")).toStrictEqual([]);
|
||||
});
|
||||
});
|
||||
|
@ -6,7 +6,8 @@ export async function lint(code: string, mimeType: string) {
|
||||
|
||||
let globals: Record<string, any> = {
|
||||
...globalDefinitions.browser,
|
||||
api: "readonly"
|
||||
api: "readonly",
|
||||
module: "readonly"
|
||||
};
|
||||
|
||||
if (mimeType === "application/javascript;env=frontend") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user