From 61c34ac749e86f709dfa203359db72e0c2d48e39 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Tue, 16 May 2023 15:42:07 +0200 Subject: [PATCH] [browser] fix lint issues (#86155) * fix lint issues * don't format jiterpreter-tables --- src/mono/wasm/runtime/.eslintignore | 2 + src/mono/wasm/runtime/.eslintrc.cjs | 7 +++- src/mono/wasm/runtime/base64.ts | 2 +- src/mono/wasm/runtime/cancelable-promise.ts | 1 - .../server_pthread/protocol-client-commands.ts | 2 +- src/mono/wasm/runtime/exports-internal.ts | 3 +- src/mono/wasm/runtime/gc-handles.ts | 4 -- src/mono/wasm/runtime/hybrid-globalization.ts | 2 +- src/mono/wasm/runtime/invoke-js.ts | 7 ---- src/mono/wasm/runtime/jiterpreter-opcodes.ts | 46 +++++++++++----------- src/mono/wasm/runtime/loader/exit.ts | 3 -- src/mono/wasm/runtime/marshal-to-cs.ts | 1 - src/mono/wasm/runtime/net6-legacy/buffers.ts | 2 +- src/mono/wasm/runtime/net6-legacy/cs-to-js.ts | 3 -- .../wasm/runtime/net6-legacy/exports-legacy.ts | 2 +- src/mono/wasm/runtime/net6-legacy/js-to-cs.ts | 11 +----- .../wasm/runtime/net6-legacy/method-binding.ts | 1 - src/mono/wasm/runtime/net6-legacy/method-calls.ts | 1 - src/mono/wasm/runtime/package.json | 3 +- src/mono/wasm/runtime/rollup.config.js | 10 ++--- src/mono/wasm/runtime/web-socket.ts | 6 +-- 21 files changed, 49 insertions(+), 70 deletions(-) create mode 100644 src/mono/wasm/runtime/.eslintignore diff --git a/src/mono/wasm/runtime/.eslintignore b/src/mono/wasm/runtime/.eslintignore new file mode 100644 index 0000000..682049e --- /dev/null +++ b/src/mono/wasm/runtime/.eslintignore @@ -0,0 +1,2 @@ +jiterpreter-opcodes.ts +jiterpreter-tables.ts diff --git a/src/mono/wasm/runtime/.eslintrc.cjs b/src/mono/wasm/runtime/.eslintrc.cjs index 3ab56e9..dc9e8df 100644 --- a/src/mono/wasm/runtime/.eslintrc.cjs +++ b/src/mono/wasm/runtime/.eslintrc.cjs @@ -20,6 +20,8 @@ module.exports = { "node_modules/**/*.*", "bin/**/*.*", "es6/*.js", + "jiterpreter-opcodes.ts", + "jiterpreter-tables.ts", ], "rules": { "@typescript-eslint/no-explicit-any": "off", @@ -34,7 +36,10 @@ module.exports = { "ignoredNodes": ["VariableDeclaration[declarations.length=0]"] // fixes https://github.com/microsoft/vscode-eslint/issues/1149 } ], - "linebreak-style": "off", + "no-multi-spaces": ["error"], + "arrow-spacing": ["error"], + "block-spacing": ["error"], + "comma-spacing": ["error"], "quotes": [ "error", "double" diff --git a/src/mono/wasm/runtime/base64.ts b/src/mono/wasm/runtime/base64.ts index 68a9e82..ac0664b 100644 --- a/src/mono/wasm/runtime/base64.ts +++ b/src/mono/wasm/runtime/base64.ts @@ -5,7 +5,7 @@ // https://github.com/sq/JSIL/blob/1d57d5427c87ab92ffa3ca4b82429cd7509796ba/JSIL.Libraries/Includes/Bootstrap/Core/Classes/System.Convert.js#L149 // Thanks to Katelyn Gadd @kg -export function toBase64StringImpl(inArray: Uint8Array, offset?: number, length?: number) : string{ +export function toBase64StringImpl(inArray: Uint8Array, offset?: number, length?: number) : string{ const reader = _makeByteReader(inArray, offset, length); let result = ""; let ch1: number | null = 0, ch2: number | null = 0, ch3: number | null = 0; diff --git a/src/mono/wasm/runtime/cancelable-promise.ts b/src/mono/wasm/runtime/cancelable-promise.ts index 1f696a1..c15b2e8 100644 --- a/src/mono/wasm/runtime/cancelable-promise.ts +++ b/src/mono/wasm/runtime/cancelable-promise.ts @@ -8,7 +8,6 @@ import { ControllablePromise, GCHandle } from "./types/internal"; export const _are_promises_supported = ((typeof Promise === "object") || (typeof Promise === "function")) && (typeof Promise.resolve === "function"); -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function isThenable(js_obj: any): boolean { // When using an external Promise library like Bluebird the Promise.resolve may not be sufficient // to identify the object as a Promise. diff --git a/src/mono/wasm/runtime/diagnostics/server_pthread/protocol-client-commands.ts b/src/mono/wasm/runtime/diagnostics/server_pthread/protocol-client-commands.ts index 1327694..a255e65 100644 --- a/src/mono/wasm/runtime/diagnostics/server_pthread/protocol-client-commands.ts +++ b/src/mono/wasm/runtime/diagnostics/server_pthread/protocol-client-commands.ts @@ -41,7 +41,7 @@ export interface EventPipeCommandStopTracing extends EventPipeClientCommandBase } export interface EventPipeCollectTracingCommandProvider { - keywords: [number, number]; // lo,hi. FIXME: this is ugly + keywords: [number, number]; // lo,hi. FIXME: this is ugly logLevel: number; provider_name: string; filter_data: string | null; diff --git a/src/mono/wasm/runtime/exports-internal.ts b/src/mono/wasm/runtime/exports-internal.ts index 14f5709..1301eee 100644 --- a/src/mono/wasm/runtime/exports-internal.ts +++ b/src/mono/wasm/runtime/exports-internal.ts @@ -23,7 +23,7 @@ export function export_internal(): any { mono_wasm_profiler_init_aot: cwraps.mono_wasm_profiler_init_aot, mono_wasm_profiler_init_browser: cwraps.mono_wasm_profiler_init_browser, mono_wasm_exec_regression: cwraps.mono_wasm_exec_regression, - mono_intern_string,// MarshalTests.cs + mono_intern_string, // MarshalTests.cs // with mono_wasm_debugger_log and mono_wasm_trace_logger logging: undefined, @@ -87,7 +87,6 @@ export function export_internal(): any { }; } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function cwraps_internal(internal: any): void { Object.assign(internal, { mono_wasm_exit: cwraps.mono_wasm_exit, diff --git a/src/mono/wasm/runtime/gc-handles.ts b/src/mono/wasm/runtime/gc-handles.ts index 500b462..a4e8117 100644 --- a/src/mono/wasm/runtime/gc-handles.ts +++ b/src/mono/wasm/runtime/gc-handles.ts @@ -36,7 +36,6 @@ export function get_js_obj(js_handle: JSHandle): any { return null; } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function mono_wasm_get_js_handle(js_obj: any): JSHandle { if (js_obj[cs_owned_js_handle_symbol]) { return js_obj[cs_owned_js_handle_symbol]; @@ -73,7 +72,6 @@ export function mono_wasm_release_cs_owned_object(js_handle: JSHandle): void { } } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function setup_managed_proxy(result: any, gc_handle: GCHandle): void { // keep the gc_handle so that we could easily convert it back to original C# object for roundtrip result[js_owned_gc_handle_symbol] = gc_handle; @@ -90,7 +88,6 @@ export function setup_managed_proxy(result: any, gc_handle: GCHandle): void { _js_owned_object_table.set(gc_handle, wr); } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function teardown_managed_proxy(result: any, gc_handle: GCHandle): void { // The JS object associated with this gc_handle has been collected by the JS GC. // As such, it's not possible for this gc_handle to be invoked by JS anymore, so @@ -109,7 +106,6 @@ export function teardown_managed_proxy(result: any, gc_handle: GCHandle): void { } } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function assert_not_disposed(result: any): GCHandle { const gc_handle = result[js_owned_gc_handle_symbol]; mono_assert(gc_handle != GCHandleNull, "ObjectDisposedException"); diff --git a/src/mono/wasm/runtime/hybrid-globalization.ts b/src/mono/wasm/runtime/hybrid-globalization.ts index 8e068a6..e0f3fdb 100644 --- a/src/mono/wasm/runtime/hybrid-globalization.ts +++ b/src/mono/wasm/runtime/hybrid-globalization.ts @@ -181,7 +181,7 @@ export function compare_strings(string1: string, string2: string, locale: string return string1.localeCompare(string2, locale, { sensitivity: "base" }); // a ≠ b, a = á, a = A case 13: // 13: IgnoreKanaType | IgnoreCase | IgnoreSymbols - return string1.localeCompare(string2, locale, { sensitivity: "accent", ignorePunctuation: true }); // a ≠ b, a ≠ á, a = A + return string1.localeCompare(string2, locale, { sensitivity: "accent", ignorePunctuation: true }); // a ≠ b, a ≠ á, a = A case 14: // 14: IgnoreKanaType | IgnoreSymbols | IgnoreNonSpace return string1.localeCompare(string2, locale, { sensitivity: "case", ignorePunctuation: true });// a ≠ b, a = á, a ≠ A diff --git a/src/mono/wasm/runtime/invoke-js.ts b/src/mono/wasm/runtime/invoke-js.ts index 4080ff1..cda5b3b 100644 --- a/src/mono/wasm/runtime/invoke-js.ts +++ b/src/mono/wasm/runtime/invoke-js.ts @@ -287,25 +287,21 @@ function mono_wasm_lookup_function(function_name: string, js_module_name: string return fn.bind(scope); } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function set_property(self: any, name: string, value: any): void { mono_assert(self, "Null reference"); self[name] = value; } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function get_property(self: any, name: string): any { mono_assert(self, "Null reference"); return self[name]; } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function has_property(self: any, name: string): boolean { mono_assert(self, "Null reference"); return name in self; } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function get_typeof_property(self: any, name: string): string { mono_assert(self, "Null reference"); return typeof self[name]; @@ -341,8 +337,6 @@ export function dynamic_import(module_name: string, module_url: string): Promise }); } - -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function _wrap_error_flag(is_exception: Int32Ptr | null, ex: any): string { let res = "unknown exception"; if (ex) { @@ -365,7 +359,6 @@ function _wrap_error_flag(is_exception: Int32Ptr | null, ex: any): string { return res; } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function wrap_error_root(is_exception: Int32Ptr | null, ex: any, result: WasmRoot): void { const res = _wrap_error_flag(is_exception, ex); js_string_to_mono_string_root(res, result); diff --git a/src/mono/wasm/runtime/jiterpreter-opcodes.ts b/src/mono/wasm/runtime/jiterpreter-opcodes.ts index 8f6668a..e188778 100644 --- a/src/mono/wasm/runtime/jiterpreter-opcodes.ts +++ b/src/mono/wasm/runtime/jiterpreter-opcodes.ts @@ -7,26 +7,26 @@ import { Module } from "./globals"; import cwraps from "./cwraps"; export const enum MintOpArgType { - MintOpNoArgs = 0, - MintOpShortInt, - MintOpUShortInt, - MintOpInt, - MintOpLongInt, - MintOpFloat, - MintOpDouble, - MintOpBranch, - MintOpShortBranch, - MintOpSwitch, - MintOpMethodToken, - MintOpFieldToken, - MintOpClassToken, - MintOpTwoShorts, - MintOpTwoInts, - MintOpShortAndInt, - MintOpShortAndShortBranch, - MintOpPair2, - MintOpPair3, - MintOpPair4 + MintOpNoArgs = 0, + MintOpShortInt, + MintOpUShortInt, + MintOpInt, + MintOpLongInt, + MintOpFloat, + MintOpDouble, + MintOpBranch, + MintOpShortBranch, + MintOpSwitch, + MintOpMethodToken, + MintOpFieldToken, + MintOpClassToken, + MintOpTwoShorts, + MintOpTwoInts, + MintOpShortAndInt, + MintOpShortAndShortBranch, + MintOpPair2, + MintOpPair3, + MintOpPair4 } export const enum JiterpSpecialOpcode { @@ -50,9 +50,9 @@ export type OpcodeNameTable = { [key: number]: string; } -const opcodeNameCache : OpcodeNameTable = {}; +const opcodeNameCache: OpcodeNameTable = {}; -export function getOpcodeName (opcode: number) : string { +export function getOpcodeName(opcode: number): string { let result = opcodeNameCache[opcode]; if (typeof (result) !== "string") { const pName = cwraps.mono_jiterp_get_opcode_info(opcode, OpcodeInfoType.Name); @@ -64,7 +64,7 @@ export function getOpcodeName (opcode: number) : string { export type SimdInfoSubtable = Array export type SimdInfoTable = { - [argument_count: number] : SimdInfoSubtable + [argument_count: number]: SimdInfoSubtable } // Keep this in sync with the wasm spec (but I don't think any changes will impact it), diff --git a/src/mono/wasm/runtime/loader/exit.ts b/src/mono/wasm/runtime/loader/exit.ts index ff3b62b..818e811 100644 --- a/src/mono/wasm/runtime/loader/exit.ts +++ b/src/mono/wasm/runtime/loader/exit.ts @@ -4,7 +4,6 @@ import { ENVIRONMENT_IS_NODE, ENVIRONMENT_IS_SHELL, ENVIRONMENT_IS_WEB, INTERNAL, loaderHelpers, runtimeHelpers } from "./globals"; import { consoleWebSocket } from "./logging"; -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function abort_startup(reason: any, should_exit: boolean): void { if (loaderHelpers.diagnosticTracing) console.trace("MONO_WASM: abort_startup"); loaderHelpers.allDownloadsQueued.promise_control.reject(reason); @@ -30,7 +29,6 @@ export function abort_startup(reason: any, should_exit: boolean): void { } } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function mono_exit(exit_code: number, reason?: any): void { if (loaderHelpers.config && loaderHelpers.config.asyncFlushOnExit && exit_code === 0) { // this would NOT call Node's exit() immediately, it's a hanging promise @@ -73,7 +71,6 @@ async function flush_node_streams() { } } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function set_exit_code_and_quit_now(exit_code: number, reason?: any): void { if (runtimeHelpers.ExitStatus) { if (reason && !(reason instanceof runtimeHelpers.ExitStatus)) { diff --git a/src/mono/wasm/runtime/marshal-to-cs.ts b/src/mono/wasm/runtime/marshal-to-cs.ts index fbdd362..8915588 100644 --- a/src/mono/wasm/runtime/marshal-to-cs.ts +++ b/src/mono/wasm/runtime/marshal-to-cs.ts @@ -325,7 +325,6 @@ function _marshal_task_to_cs(arg: JSMarshalerArgument, value: Promise, _?: }); } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function marshal_exception_to_cs(arg: JSMarshalerArgument, value: any): void { if (value === null || value === undefined) { set_arg_type(arg, MarshalerType.None); diff --git a/src/mono/wasm/runtime/net6-legacy/buffers.ts b/src/mono/wasm/runtime/net6-legacy/buffers.ts index 533a161..3e5ca31 100644 --- a/src/mono/wasm/runtime/net6-legacy/buffers.ts +++ b/src/mono/wasm/runtime/net6-legacy/buffers.ts @@ -55,7 +55,7 @@ function typed_array_from(pinned_array: MonoArray, begin: number, end: number, b case 14: newTypedArray = new Float64Array(end - begin); break; - case 15: // This is a special case because the typed array is also byte[] + case 15: // This is a special case because the typed array is also byte[] newTypedArray = new Uint8ClampedArray(end - begin); break; default: diff --git a/src/mono/wasm/runtime/net6-legacy/cs-to-js.ts b/src/mono/wasm/runtime/net6-legacy/cs-to-js.ts index 0585daa..3473093 100644 --- a/src/mono/wasm/runtime/net6-legacy/cs-to-js.ts +++ b/src/mono/wasm/runtime/net6-legacy/cs-to-js.ts @@ -99,7 +99,6 @@ export function _unbox_mono_obj_root_with_known_nonprimitive_type(root: WasmRoot return _unbox_mono_obj_root_with_known_nonprimitive_type_impl(root, type, typePtr, unbox_buffer); } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function unbox_mono_obj_root(root: WasmRoot): any { if (root.value === 0) return undefined; @@ -129,7 +128,6 @@ export function unbox_mono_obj_root(root: WasmRoot): any { } } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function mono_array_to_js_array(mono_array: MonoArray): any[] | null { if (mono_array === MonoArrayNull) return null; @@ -146,7 +144,6 @@ function is_nested_array_ref(ele: WasmRoot) { return legacyManagedExports._is_simple_array_ref(ele.address); } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function mono_array_root_to_js_array(arrayRoot: WasmRoot): any[] | null { if (arrayRoot.value === MonoArrayNull) return null; diff --git a/src/mono/wasm/runtime/net6-legacy/exports-legacy.ts b/src/mono/wasm/runtime/net6-legacy/exports-legacy.ts index fc661b4..d73cc4e 100644 --- a/src/mono/wasm/runtime/net6-legacy/exports-legacy.ts +++ b/src/mono/wasm/runtime/net6-legacy/exports-legacy.ts @@ -76,7 +76,7 @@ export function cwraps_mono_api(mono: MONOType): void { export function export_internal_api(): any { return { - mono_method_resolve,//MarshalTests.cs + mono_method_resolve, //MarshalTests.cs }; } diff --git a/src/mono/wasm/runtime/net6-legacy/js-to-cs.ts b/src/mono/wasm/runtime/net6-legacy/js-to-cs.ts index 21558c8..945640a 100644 --- a/src/mono/wasm/runtime/net6-legacy/js-to-cs.ts +++ b/src/mono/wasm/runtime/net6-legacy/js-to-cs.ts @@ -9,14 +9,13 @@ import { wrap_error_root, wrap_no_error_root } from "../invoke-js"; import { setI32_unchecked, setU32_unchecked, setF64, setB32 } from "../memory"; import { mono_wasm_new_root, mono_wasm_release_roots, mono_wasm_new_external_root } from "../roots"; import { js_string_to_mono_string_root, js_string_to_mono_string_interned_root } from "../strings"; -import { MonoObject, is_nullish, MonoClass, MonoArray, MonoMethod, MonoObjectNull, JSHandle, MonoObjectRef, JSHandleNull, JSHandleDisposed, WasmRoot } from "../types/internal"; +import { MonoObject, is_nullish, MonoClass, MonoArray, MonoObjectNull, JSHandle, MonoObjectRef, JSHandleNull, JSHandleDisposed, WasmRoot } from "../types/internal"; import { TypedArray, Int32Ptr } from "../types/emscripten"; import { has_backing_array_buffer } from "./buffers"; import { legacyManagedExports } from "./corebindings"; import { get_js_owned_object_by_gc_handle_ref } from "./cs-to-js"; import { legacyHelpers, wasm_type_symbol } from "./globals"; -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function _js_to_mono_uri_root(should_add_in_flight: boolean, js_obj: any, result: WasmRoot): void { switch (true) { case js_obj === null: @@ -37,7 +36,6 @@ export function _js_to_mono_uri_root(should_add_in_flight: boolean, js_obj: any, /** * @deprecated Not GC or thread safe. For blazor use only */ -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function js_to_mono_obj(js_obj: any): MonoObject { const temp = mono_wasm_new_root(); try { @@ -51,7 +49,6 @@ export function js_to_mono_obj(js_obj: any): MonoObject { /** * @deprecated Not GC or thread safe */ -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function _js_to_mono_obj_unsafe(should_add_in_flight: boolean, js_obj: any): MonoObject { const temp = mono_wasm_new_root(); try { @@ -62,7 +59,6 @@ export function _js_to_mono_obj_unsafe(should_add_in_flight: boolean, js_obj: an } } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function js_to_mono_obj_root(js_obj: any, result: WasmRoot, should_add_in_flight: boolean): void { if (is_nullish(result)) throw new Error("Expected (value, WasmRoot, boolean)"); @@ -157,7 +153,6 @@ function js_typedarray_to_heap(typedArray: TypedArray) { return heapBytes; } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function js_typed_array_to_array_root(js_obj: any, result: WasmRoot): void { // JavaScript typed arrays are array-like objects and provide a mechanism for accessing // raw binary data. (...) To achieve maximum flexibility and efficiency, JavaScript typed arrays @@ -181,7 +176,6 @@ export function js_typed_array_to_array_root(js_obj: any, result: WasmRoot(); try { @@ -192,8 +186,7 @@ export function js_typed_array_to_array(js_obj: any): MonoArray { } } -// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/explicit-module-boundary-types -export function js_to_mono_enum(js_obj: any, method: MonoMethod, parmIdx: number): number { +export function js_to_mono_enum(js_obj: any): number { if (typeof (js_obj) !== "number") throw new Error(`Expected numeric value for enum argument, got '${js_obj}'`); diff --git a/src/mono/wasm/runtime/net6-legacy/method-binding.ts b/src/mono/wasm/runtime/net6-legacy/method-binding.ts index 4cab645..18ec621 100644 --- a/src/mono/wasm/runtime/net6-legacy/method-binding.ts +++ b/src/mono/wasm/runtime/net6-legacy/method-binding.ts @@ -40,7 +40,6 @@ export function _get_class_name(classPtr: MonoClass): string { return cwraps.mono_wasm_get_type_name(cwraps.mono_wasm_class_get_type(classPtr)); } -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function _create_named_function(name: string, argumentNames: string[], body: string, closure: any): Function { let result = null; let closureArgumentList: any[] | null = null; diff --git a/src/mono/wasm/runtime/net6-legacy/method-calls.ts b/src/mono/wasm/runtime/net6-legacy/method-calls.ts index 330e7c0..235e45c 100644 --- a/src/mono/wasm/runtime/net6-legacy/method-calls.ts +++ b/src/mono/wasm/runtime/net6-legacy/method-calls.ts @@ -283,7 +283,6 @@ export function mono_wasm_get_global_object_ref(global_name: MonoStringRef, is_e } // Blazor specific custom routine -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function mono_wasm_invoke_js_blazor(exceptionMessage: Int32Ptr, callInfo: any, arg0: any, arg1: any, arg2: any): void | number { try { if (MonoWasmThreads) { diff --git a/src/mono/wasm/runtime/package.json b/src/mono/wasm/runtime/package.json index 46345ab..249235b 100644 --- a/src/mono/wasm/runtime/package.json +++ b/src/mono/wasm/runtime/package.json @@ -11,7 +11,8 @@ "types": "dotnet.d.ts", "scripts": { "rollup": "rollup -c", - "lint": "eslint --no-color --max-warnings=0 \"./**/*.ts\" \"./*.js\"" + "lint": "eslint --no-color --max-warnings=0 \"./**/*.ts\" \"./*.js\"", + "format": "eslint --fix \"./**/*.ts\" \"./*.js\"" }, "keywords": [ "dotnet", diff --git a/src/mono/wasm/runtime/rollup.config.js b/src/mono/wasm/runtime/rollup.config.js index dd8c7b8..6e7279d 100644 --- a/src/mono/wasm/runtime/rollup.config.js +++ b/src/mono/wasm/runtime/rollup.config.js @@ -22,8 +22,8 @@ const terserConfig = { compress: { defaults: true, passes: 2, - drop_debugger: false,// we invoke debugger - drop_console: false,// we log to console + drop_debugger: false, // we invoke debugger + drop_console: false, // we log to console }, mangle: { // because of stack walk at src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -73,9 +73,9 @@ try { } function consts(dict) { - /// implement rollup-plugin-const in terms of @rollup/plugin-virtual - /// It's basically the same thing except "consts" names all its modules with a "consts:" prefix, - /// and the virtual module always exports a single default binding (the const value). + // implement rollup-plugin-const in terms of @rollup/plugin-virtual + // It's basically the same thing except "consts" names all its modules with a "consts:" prefix, + // and the virtual module always exports a single default binding (the const value). let newDict = {}; for (const k in dict) { diff --git a/src/mono/wasm/runtime/web-socket.ts b/src/mono/wasm/runtime/web-socket.ts index e28477b..b103071 100644 --- a/src/mono/wasm/runtime/web-socket.ts +++ b/src/mono/wasm/runtime/web-socket.ts @@ -237,7 +237,7 @@ function _mono_wasm_web_socket_on_message(ws: WebSocketExtension, event: Message _text_encoder_utf8 = new TextEncoder(); } event_queue.enqueue({ - type: 0,// WebSocketMessageType.Text + type: 0, // WebSocketMessageType.Text // according to the spec https://encoding.spec.whatwg.org/ // - Unpaired surrogates will get replaced with 0xFFFD // - utf8 encode specifically is defined to never throw @@ -250,7 +250,7 @@ function _mono_wasm_web_socket_on_message(ws: WebSocketExtension, event: Message throw new Error("ERR19: WebSocket receive expected ArrayBuffer"); } event_queue.enqueue({ - type: 1,// WebSocketMessageType.Binary + type: 1, // WebSocketMessageType.Binary data: new Uint8Array(event.data), offset: 0 }); @@ -372,7 +372,7 @@ type ReceivePromiseControl = PromiseController & { } type Message = { - type: number,// WebSocketMessageType + type: number, // WebSocketMessageType data: Uint8Array, offset: number } -- 2.7.4