diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-05-27 00:02:16 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 10:02:16 -0400 |
commit | 228f9c207f8320908325a553c96e465da08fc617 (patch) | |
tree | 54f2aba9f577d713dcbed5882ae7ae9e53c7baaf /std/node | |
parent | 24c36fd8625df6b276108109478a62b4661a0b3f (diff) |
Use ts-expect-error instead of ts-ignore. (#5869)
Diffstat (limited to 'std/node')
-rw-r--r-- | std/node/global.ts | 2 | ||||
-rw-r--r-- | std/node/module.ts | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/std/node/global.ts b/std/node/global.ts index c877d1d53..7d147cc4b 100644 --- a/std/node/global.ts +++ b/std/node/global.ts @@ -5,5 +5,5 @@ Object.defineProperty(globalThis, Symbol.toStringTag, { configurable: true, }); -// @ts-ignore +// @ts-expect-error globalThis["global"] = globalThis; diff --git a/std/node/module.ts b/std/node/module.ts index 4e0c55c1d..71c25beac 100644 --- a/std/node/module.ts +++ b/std/node/module.ts @@ -263,9 +263,9 @@ class Module { message = message + "\nRequire stack:\n- " + requireStack.join("\n- "); } const err = new Error(message); - // @ts-ignore + // @ts-expect-error err.code = "MODULE_NOT_FOUND"; - // @ts-ignore + // @ts-expect-error err.requireStack = requireStack; throw err; } @@ -737,7 +737,7 @@ function tryPackage( `Cannot find module '${filename}'. ` + 'Please verify that the package.json has a valid "main" entry' ); - // @ts-ignore + // @ts-expect-error err.code = "MODULE_NOT_FOUND"; throw err; } @@ -882,7 +882,7 @@ function applyExports(basePath: string, expansion: string): string { `Package exports for '${basePath}' do not define ` + `a '${mappingKey}' subpath` ); - // @ts-ignore + // @ts-expect-error e.code = "MODULE_NOT_FOUND"; throw e; } @@ -982,7 +982,7 @@ function resolveExportsTarget( } else { e = new Error(`No valid exports main found for '${basePath}'`); } - // @ts-ignore + // @ts-expect-error e.code = "MODULE_NOT_FOUND"; throw e; } @@ -1007,7 +1007,7 @@ const CircularRequirePrototypeWarningProxy = new Proxy( { // eslint-disable-next-line @typescript-eslint/no-explicit-any get(target, prop): any { - // @ts-ignore + // @ts-expect-error if (prop in target) return target[prop]; emitCircularRequireWarning(prop); return undefined; @@ -1058,7 +1058,7 @@ type RequireWrapper = ( function wrapSafe(filename: string, content: string): RequireWrapper { // TODO: fix this const wrapper = Module.wrap(content); - // @ts-ignore + // @ts-expect-error const [f, err] = Deno.core.evalContext(wrapper, filename); if (err) { throw err; |