From a8d1e94e08646e7d12a806cfe3674c9875cba966 Mon Sep 17 00:00:00 2001 From: toyobayashi Date: Thu, 16 Feb 2023 13:53:05 +0800 Subject: [PATCH] update eslint --- .eslintrc.js | 4 ++++ package.json | 14 +++++++------- packages/emnapi/src/emscripten/runtime.d.ts | 2 +- packages/emnapi/src/emscripten/util.ts | 6 +++--- packages/emnapi/src/internal.ts | 2 +- packages/runtime/src/Context.ts | 2 +- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index fb6b0fb0..4bbe08b0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,6 +24,10 @@ module.exports = { '@typescript-eslint/no-dynamic-delete': 'off', '@typescript-eslint/method-signature-style': 'off', '@typescript-eslint/prefer-includes': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/consistent-type-imports': 'off', + '@typescript-eslint/consistent-generic-constructors': 'off', '@typescript-eslint/no-unnecessary-type-assertion': 'off', '@typescript-eslint/member-delimiter-style': ['error', { multiline: { diff --git a/package.json b/package.json index fc4322bb..f7c80cf8 100644 --- a/package.json +++ b/package.json @@ -31,13 +31,13 @@ "@tybys/tsapi": "^0.6.0", "@types/fs-extra": "^9.0.13", "@types/node": "^16.11.21", - "@typescript-eslint/eslint-plugin": "^5.32.0", - "@typescript-eslint/parser": "^5.32.0", - "eslint": "^8.21.0", - "eslint-config-standard-with-typescript": "^22.0.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-n": "^15.2.4", - "eslint-plugin-promise": "^6.0.0", + "@typescript-eslint/eslint-plugin": "^5.52.0", + "@typescript-eslint/parser": "^5.52.0", + "eslint": "^8.34.0", + "eslint-config-standard-with-typescript": "^34.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.6.1", + "eslint-plugin-promise": "^6.1.1", "fs-extra": "^10.1.0", "typescript": "~4.8.4" }, diff --git a/packages/emnapi/src/emscripten/runtime.d.ts b/packages/emnapi/src/emscripten/runtime.d.ts index 407fe410..9ba71e53 100644 --- a/packages/emnapi/src/emscripten/runtime.d.ts +++ b/packages/emnapi/src/emscripten/runtime.d.ts @@ -3,7 +3,7 @@ declare const LibraryManager: { library: any } -declare function mergeInto (target: any, source: { [key: string]: any }): void +declare function mergeInto (target: any, source: Record): void // runtime declare const wasmMemory: WebAssembly.Memory diff --git a/packages/emnapi/src/emscripten/util.ts b/packages/emnapi/src/emscripten/util.ts index 01ad4029..bdcda61a 100644 --- a/packages/emnapi/src/emscripten/util.ts +++ b/packages/emnapi/src/emscripten/util.ts @@ -14,18 +14,18 @@ function emnapiImplement (name: string, sig: string | undefined, compilerTimeFun // emnapi_* function emnapiImplement2 (...args: Parameters): void function emnapiImplement2 (): void { - return emnapiImplement.apply(null, arguments as any) + emnapiImplement.apply(null, arguments as any) } // _emnapi_* function emnapiImplementInternal (...args: Parameters): void function emnapiImplementInternal (): void { - return emnapiImplement.apply(null, arguments as any) + emnapiImplement.apply(null, arguments as any) } // $emnapi* function emnapiImplementHelper (name: string, sig: string | undefined, compilerTimeFunction: Function, deps?: string[], _exportName?: string): void { - return emnapiImplement(name, sig, compilerTimeFunction, deps) + emnapiImplement(name, sig, compilerTimeFunction, deps) } function emnapiDefineVar (name: string, value: any, deps?: string[], postset?: string): void { diff --git a/packages/emnapi/src/internal.ts b/packages/emnapi/src/internal.ts index c8fcdc29..bab0745c 100644 --- a/packages/emnapi/src/internal.ts +++ b/packages/emnapi/src/internal.ts @@ -89,7 +89,7 @@ function emnapiDefineProperty (envObject: Env, obj: object, propertyName: string } } -function emnapiGetHandle (js_object: napi_value): { status: napi_status; handle?: Handle} { +function emnapiGetHandle (js_object: napi_value): { status: napi_status; handle?: Handle } { let handle = emnapiCtx.handleStore.get(js_object)! if (!(handle.isObject() || handle.isFunction())) { return { status: napi_status.napi_invalid_arg } diff --git a/packages/runtime/src/Context.ts b/packages/runtime/src/Context.ts index 292001f1..4f765416 100644 --- a/packages/runtime/src/Context.ts +++ b/packages/runtime/src/Context.ts @@ -184,7 +184,7 @@ export class Context { } closeScope (envObject: Env, _scope?: HandleScope): void { - return this.scopeStore.closeScope(envObject) + this.scopeStore.closeScope(envObject) } ensureHandle (value: S): Handle {