From 64cd55fe58d4a98892f5469ad5a9250d9157ed28 Mon Sep 17 00:00:00 2001 From: Gabe Yuan Date: Tue, 29 Aug 2023 00:42:11 +0800 Subject: [PATCH] set no-eval --- package.json | 8 +++++++- src/userscript.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f0e953d..b10a96c 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,13 @@ ], "globals": { "GM": true - } + }, + "no-eval": [ + "error", + { + "allowIndirect": true + } + ] }, "browserslist": { "production": [ diff --git a/src/userscript.js b/src/userscript.js index 1004231..a2f1d64 100644 --- a/src/userscript.js +++ b/src/userscript.js @@ -9,7 +9,7 @@ import { trySyncAllSubRules } from "./libs/rules"; import { isGm } from "./libs/browser"; import { MSG_TRANS_TOGGLE, MSG_TRANS_PUTRULE } from "./config"; import { isIframe } from "./libs/iframe"; -import { genEventName, handlePing, injectScript } from "./libs/gm"; +import { handlePing, injectScript } from "./libs/gm"; /** * 入口函数