mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
Add self.WASM to types.d.ts, and silence no-unused-vars, since it collides with the typescript counterpart in eslint.
This commit is contained in:
parent
f9ad33069e
commit
a4a2a78252
4 changed files with 6 additions and 5 deletions
|
@ -4,8 +4,8 @@
|
|||
"plugins": ["@typescript-eslint"],
|
||||
"rules": {
|
||||
"no-await-in-loop": "warn",
|
||||
"no-unused-labels": "error",
|
||||
"no-unused-vars": "error",
|
||||
"no-unused-labels": "warn",
|
||||
"no-unused-vars": "off",
|
||||
"quotes": ["error", "double"],
|
||||
"max-lines-per-function": [
|
||||
"error",
|
||||
|
@ -25,6 +25,6 @@
|
|||
"no-unreachable": "warn",
|
||||
"no-undef": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off"
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ function traverseParsedHtml(node, origin?: URL) {
|
|||
let js = node.children[0].data;
|
||||
const htmlcomment = /<!--[\s\S]*?-->/g;
|
||||
js = js.replace(htmlcomment, "");
|
||||
node.children[0].data = rewriteJs(js, origin);
|
||||
node.children[0].data = rewriteJs(js);
|
||||
}
|
||||
if (node.name === "meta" && hasAttrib(node, "http-equiv")) {
|
||||
if (node.attribs["http-equiv"] === "content-security-policy") {
|
||||
|
|
|
@ -20,7 +20,7 @@ import { initSync, rewrite_js } from "../../../rewriter/out/rewriter.js";
|
|||
import "../../../static/wasm.js";
|
||||
|
||||
initSync(new WebAssembly.Module(
|
||||
Uint8Array.from(atob(WASM), c => c.charCodeAt(0))
|
||||
Uint8Array.from(atob(self.WASM), c => c.charCodeAt(0))
|
||||
))
|
||||
|
||||
export function rewriteJs(js: string) {
|
||||
|
|
1
src/types.d.ts
vendored
1
src/types.d.ts
vendored
|
@ -47,5 +47,6 @@ declare global {
|
|||
xor: Codec;
|
||||
};
|
||||
};
|
||||
WASM: string;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue