Description: various workaround for typescript definitions
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2023-12-13

--- a/packages/expect/src/asymmetricMatchers.ts
+++ b/packages/expect/src/asymmetricMatchers.ts
@@ -267,6 +267,7 @@
   }
 
   asymmetricMatch(other: unknown) {
+// @ts-ignore
     const result = isA<string>('String', other) && other.includes(this.sample);
 
     return this.inverse ? !result : result;
@@ -290,6 +291,7 @@
   }
 
   asymmetricMatch(other: unknown) {
+// @ts-ignore
     const result = isA<string>('String', other) && this.sample.test(other);
 
     return this.inverse ? !result : result;
@@ -322,6 +324,7 @@
   }
 
   asymmetricMatch(other: unknown) {
+// @ts-ignore
     if (!isA<number>('Number', other)) {
       return false;
     }
@@ -332,6 +335,7 @@
       result = true; // -Infinity - -Infinity is NaN
     } else {
       result =
+// @ts-ignore
         Math.abs(this.sample - other) < Math.pow(10, -this.precision) / 2;
     }
     return this.inverse ? !result : result;
--- a/packages/expect/src/index.ts
+++ b/packages/expect/src/index.ts
@@ -53,6 +53,7 @@
   ThrowingMatcherFn,
 } from './types';
 
+// @ts-ignore
 export type {Tester, TesterContext} from '@jest/expect-utils';
 export {AsymmetricMatcher} from './asymmetricMatchers';
 export type {
--- a/packages/expect/src/matchers.ts
+++ b/packages/expect/src/matchers.ts
@@ -935,6 +935,7 @@
           '\n\n' +
           printDiffOrStringify(
             expected,
+// @ts-ignore
             getObjectSubset(received, expected, this.customTesters),
             EXPECTED_LABEL,
             RECEIVED_LABEL,
--- a/packages/jest-changed-files/src/git.ts
+++ b/packages/jest-changed-files/src/git.ts
@@ -18,6 +18,7 @@
   let result: execa.ExecaReturnValue;
 
   try {
+// @ts-ignore
     result = await execa('git', args, {cwd});
   } catch (e) {
     if (types.isNativeError(e)) {
@@ -100,6 +101,7 @@
     const options = ['rev-parse', '--show-cdup'];
 
     try {
+// @ts-ignore
       const result = await execa('git', options, {cwd});
 
       return path.resolve(cwd, result.stdout);
--- a/packages/jest-changed-files/src/hg.ts
+++ b/packages/jest-changed-files/src/hg.ts
@@ -33,6 +33,7 @@
     let result: execa.ExecaReturnValue;
 
     try {
+// @ts-ignore
       result = await execa('hg', args, {cwd, env});
     } catch (e) {
       if (types.isNativeError(e)) {
@@ -52,6 +53,7 @@
 
   getRoot: async cwd => {
     try {
+// @ts-ignore
       const result = await execa('hg', ['root'], {cwd, env});
 
       return result.stdout;
--- a/packages/jest-changed-files/src/index.ts
+++ b/packages/jest-changed-files/src/index.ts
@@ -22,6 +22,7 @@
 
 // This is an arbitrary number. The main goal is to prevent projects with
 // many roots (50+) from spawning too many processes at once.
+// @ts-ignore
 const mutex = pLimit(5);
 
 const findGitRoot = (dir: string) => mutex(() => git.getRoot(dir));
--- a/packages/jest-changed-files/src/sl.ts
+++ b/packages/jest-changed-files/src/sl.ts
@@ -37,6 +37,7 @@
     let result: execa.ExecaReturnValue;
 
     try {
+// @ts-ignore
       result = await execa('sl', args, {cwd, env});
     } catch (e) {
       if (types.isNativeError(e)) {
@@ -56,6 +57,7 @@
 
   getRoot: async cwd => {
     try {
+// @ts-ignore
       const result = await execa('sl', ['root'], {cwd, env});
 
       return result.stdout;
--- a/packages/jest-circus/src/eventHandler.ts
+++ b/packages/jest-circus/src/eventHandler.ts
@@ -217,6 +217,7 @@
     case 'test_retry': {
       const logErrorsBeforeRetry: boolean =
         // eslint-disable-next-line no-restricted-globals
+// @ts-ignore
         global[LOG_ERRORS_BEFORE_RETRY] || false;
       if (logErrorsBeforeRetry) {
         event.test.retryReasons.push(...event.test.errors);
@@ -227,7 +228,9 @@
     case 'run_start': {
       state.hasStarted = true;
       /* eslint-disable no-restricted-globals */
+// @ts-ignore
       global[TEST_TIMEOUT_SYMBOL] &&
+// @ts-ignore
         (state.testTimeout = global[TEST_TIMEOUT_SYMBOL]);
       /* eslint-enable */
       break;
--- a/packages/jest-circus/src/globalErrorHandlers.ts
+++ b/packages/jest-circus/src/globalErrorHandlers.ts
@@ -22,6 +22,7 @@
   parentProcess.removeAllListeners('unhandledRejection');
   parentProcess.on('uncaughtException', uncaught);
   parentProcess.on('unhandledRejection', uncaught);
+// @ts-ignore
   return {uncaughtException, unhandledRejection};
 };
 
--- a/packages/jest-circus/src/run.ts
+++ b/packages/jest-circus/src/run.ts
@@ -62,6 +62,7 @@
 
   // Tests that fail and are retried we run after other tests
   // eslint-disable-next-line no-restricted-globals
+// @ts-ignore
   const retryTimes = parseInt(global[RETRY_TIMES], 10) || 0;
   const deferredRetryTests = [];
 
@@ -135,6 +136,7 @@
 }
 
 function startTestsConcurrently(concurrentTests: Array<ConcurrentTestEntry>) {
+// @ts-ignore
   const mutex = pLimit(getState().maxConcurrency);
   const testNameStorage = new AsyncLocalStorage<string>();
   jestExpect.setState({currentConcurrentTestName: testNameStorage});
--- a/packages/jest-circus/src/state.ts
+++ b/packages/jest-circus/src/state.ts
@@ -39,13 +39,16 @@
 
 /* eslint-disable no-restricted-globals */
 export const resetState = (): void => {
+// @ts-ignore
   global[STATE_SYM] = createState();
 };
 
 resetState();
 
+// @ts-ignore
 export const getState = (): Circus.State => global[STATE_SYM];
 export const setState = (state: Circus.State): Circus.State =>
+// @ts-ignore
   (global[STATE_SYM] = state);
 /* eslint-enable */
 
--- a/packages/jest-config/src/getMaxWorkers.ts
+++ b/packages/jest-config/src/getMaxWorkers.ts
@@ -6,7 +6,7 @@
  */
 
 import {
-  // @ts-expect-error - added in Node 19.4.0
+  // @ts-ignore - added in Node 19.4.0
   availableParallelism,
   cpus,
 } from 'os';
--- a/packages/jest-config/src/readConfigFileAndSetRootDir.ts
+++ b/packages/jest-config/src/readConfigFileAndSetRootDir.ts
@@ -35,6 +35,7 @@
       configObject = await loadTSConfigFile(configPath);
     } else if (isJSON) {
       const fileContent = fs.readFileSync(configPath, 'utf8');
+// @ts-ignore
       configObject = parseJson(stripJsonComments(fileContent), configPath);
     } else {
       configObject = await requireOrImportModule<any>(configPath);
--- a/packages/jest-core/src/collectHandles.ts
+++ b/packages/jest-core/src/collectHandles.ts
@@ -42,7 +42,7 @@
 
 const alwaysActive = () => true;
 
-// @ts-expect-error: doesn't exist in v12 typings
+// @ts-ignore: doesn't exist in v12 typings
 const hasWeakRef = typeof WeakRef === 'function';
 
 const asyncSleep = promisify(setTimeout);
@@ -115,7 +115,7 @@
         // Handle that supports hasRef
         if ('hasRef' in resource) {
           if (hasWeakRef) {
-            // @ts-expect-error: doesn't exist in v12 typings
+            // @ts-ignore: doesn't exist in v12 typings
             const ref = new WeakRef(resource);
             isActive = () => {
               return ref.deref()?.hasRef() ?? false;
--- a/packages/jest-core/src/runJest.ts
+++ b/packages/jest-core/src/runJest.ts
@@ -294,7 +294,7 @@
     ...testSchedulerContext,
   });
 
-  // @ts-expect-error - second arg is unsupported (but harmless) in Node 14
+  // @ts-ignore - second arg is unsupported (but harmless) in Node 14
   performance.mark('jest/scheduleAndRun:start', {
     detail: {numTests: allTests.length},
   });
--- a/packages/jest-environment-jsdom/src/index.ts
+++ b/packages/jest-environment-jsdom/src/index.ts
@@ -73,7 +73,7 @@
       throw new Error('JSDOM did not return a Window object');
     }
 
-    // @ts-expect-error - for "universal" code (code should use `globalThis`)
+    // @ts-ignore - for "universal" code (code should use `globalThis`)
     global.global = global;
 
     // Node's error-message stack size is limited at 10, but it's pretty useful
--- a/packages/jest-environment-node/src/index.ts
+++ b/packages/jest-environment-node/src/index.ts
@@ -127,7 +127,7 @@
       }
     }
 
-    // @ts-expect-error - Buffer and gc is "missing"
+    // @ts-ignore - Buffer and gc is "missing"
     global.global = global;
     global.Buffer = Buffer;
     global.ArrayBuffer = ArrayBuffer;
--- a/packages/jest-jasmine2/src/jasmine/jasmineLight.ts
+++ b/packages/jest-jasmine2/src/jasmine/jasmineLight.ts
@@ -59,10 +59,12 @@
     enumerable: true,
     get() {
       // eslint-disable-next-line no-restricted-globals
+// @ts-ignore
       return global[testTimeoutSymbol] || createOptions.testTimeout || 5000;
     },
     set(value) {
       // eslint-disable-next-line no-restricted-globals
+// @ts-ignore
       global[testTimeoutSymbol] = value;
     },
   });
--- a/packages/jest-jasmine2/src/jasmineAsyncInstall.ts
+++ b/packages/jest-jasmine2/src/jasmineAsyncInstall.ts
@@ -76,6 +76,7 @@
     // didn't return a promise.
     const asyncJestLifecycle = function (done: DoneFn) {
       const wrappedFn = isGeneratorFn(fn) ? co.wrap(fn) : fn;
+// @ts-ignore
       const returnValue = wrappedFn.call({}, doneFnNoop);
 
       if (isPromise(returnValue)) {
@@ -195,6 +196,7 @@
     timeout?: number,
   ) => Spec,
   env: Jasmine['currentEnv_'],
+// @ts-ignore
   mutex: ReturnType<typeof pLimit>,
 ): Global.ItConcurrentBase {
   const concurrentFn = function (
@@ -254,6 +256,7 @@
   global: Global.Global,
 ): void {
   const jasmine = global.jasmine;
+// @ts-ignore
   const mutex = pLimit(globalConfig.maxConcurrency);
 
   const env = jasmine.getEnv();
--- a/packages/jest-jasmine2/src/jestExpect.ts
+++ b/packages/jest-jasmine2/src/jestExpect.ts
@@ -12,10 +12,12 @@
 
 export default function jestExpectAdapter(config: {expand: boolean}): void {
   // eslint-disable-next-line no-restricted-globals
+// @ts-ignore
   global.expect = jestExpect;
   jestExpect.setState({expand: config.expand});
 
   // eslint-disable-next-line no-restricted-globals
+// @ts-ignore
   const jasmine = global.jasmine;
   jasmine.anything = jestExpect.anything;
   jasmine.any = jestExpect.any;
--- a/packages/jest-leak-detector/src/index.ts
+++ b/packages/jest-leak-detector/src/index.ts
@@ -52,7 +52,7 @@
   }
 
   private _runGarbageCollector() {
-    // @ts-expect-error: not a function on `globalThis`
+    // @ts-ignore: not a function on `globalThis`
     const isGarbageCollectorHidden = globalThis.gc == null;
 
     // GC is usually hidden, so we have to expose it before running.
--- a/packages/jest-message-util/src/index.ts
+++ b/packages/jest-message-util/src/index.ts
@@ -151,10 +151,14 @@
         : `thrown: ${prettyFormat(error, {maxDepth: 3})}`;
     if ('cause' in error) {
       const prefix = '\n\nCause:\n';
+// @ts-ignore
       if (typeof error.cause === 'string' || typeof error.cause === 'number') {
+// @ts-ignore
         cause += `${prefix}${error.cause}`;
       } else if (
+// @ts-ignore
         types.isNativeError(error.cause) ||
+// @ts-ignore
         error.cause instanceof Error
       ) {
         /* `isNativeError` is used, because the error might come from another realm.
@@ -163,6 +167,7 @@
          [verror](https://www.npmjs.com/package/verror) or [axios](https://axios-http.com).
         */
         const formatted = formatExecError(
+// @ts-ignore
           error.cause,
           config,
           options,
@@ -173,7 +178,9 @@
         cause += `${prefix}${formatted}`;
       }
     }
+// @ts-ignore
     if ('errors' in error && Array.isArray(error.errors)) {
+// @ts-ignore
       for (const subError of error.errors) {
         subErrors.push(
           formatExecError(
@@ -393,8 +400,11 @@
   return (
     typeof errorOrStack !== 'string' &&
     'cause' in errorOrStack &&
+// @ts-ignore
     (typeof errorOrStack.cause === 'string' ||
+// @ts-ignore
       types.isNativeError(errorOrStack.cause) ||
+// @ts-ignore
       errorOrStack.cause instanceof Error)
   );
 }
@@ -446,9 +456,12 @@
   if (
     typeof failureDetails === 'object' &&
     'error' in failureDetails &&
+// @ts-ignore
     (types.isNativeError(failureDetails.error) ||
+// @ts-ignore
       failureDetails.error instanceof Error)
   ) {
+// @ts-ignore
     return failureDetails.error; // receiving instances of FailedAssertion for jest-jasmine
   }
   return content;
--- a/packages/jest-mock/src/index.ts
+++ b/packages/jest-mock/src/index.ts
@@ -999,7 +999,9 @@
       if (
         'object' in restore &&
         'property' in restore &&
+// @ts-ignore
         restore.object === object &&
+// @ts-ignore
         restore.property === propertyKey
       ) {
         return restore as ReplacedPropertyRestorer<T, K>;
--- a/packages/jest-repl/src/cli/runtime-cli.ts
+++ b/packages/jest-repl/src/cli/runtime-cli.ts
@@ -6,7 +6,7 @@
  */
 
 import {
-  // @ts-expect-error - added in Node 19.4.0
+  // @ts-ignore - added in Node 19.4.0
   availableParallelism,
   cpus,
 } from 'os';
--- a/packages/jest-reporters/src/CoverageReporter.ts
+++ b/packages/jest-reporters/src/CoverageReporter.ts
@@ -147,6 +147,7 @@
       worker = require('./CoverageWorker');
     } else {
       worker = new Worker(require.resolve('./CoverageWorker'), {
+// @ts-ignore
         enableWorkerThreads: this._globalConfig.workerThreads,
         exposedMethods: ['worker'],
         forkOptions: {serialization: 'json'},
@@ -460,6 +461,7 @@
           const converter = v8toIstanbul(
             res.url,
             fileTransform?.wrapperLength ?? 0,
+// @ts-ignore
             fileTransform && sourcemapContent
               ? {
                   originalSource: fileTransform.originalCode,
--- a/packages/jest-reporters/src/Status.ts
+++ b/packages/jest-reporters/src/Status.ts
@@ -184,7 +184,9 @@
         currentTestCases: this._currentTestCases,
         estimatedTime: this._estimatedTime,
         roundTime: true,
+// @ts-ignore
         seed: this._globalConfig.seed,
+// @ts-ignore
         showSeed: this._globalConfig.showSeed,
         width,
       })}`;
--- a/packages/jest-reporters/src/SummaryReporter.ts
+++ b/packages/jest-reporters/src/SummaryReporter.ts
@@ -125,7 +125,9 @@
 
       let message = getSummary(aggregatedResults, {
         estimatedTime: this._estimatedTime,
+// @ts-ignore
         seed: this._globalConfig.seed,
+// @ts-ignore
         showSeed: this._globalConfig.showSeed,
       });
 
--- a/packages/jest-reporters/src/types.ts
+++ b/packages/jest-reporters/src/types.ts
@@ -36,6 +36,7 @@
    */
   readonly onTestCaseStart?: (
     test: Test,
+// @ts-ignore
     testCaseStartInfo: Circus.TestCaseStartInfo,
   ) => Promise<void> | void;
   readonly onTestCaseResult?: (
--- a/packages/jest-resolve/src/fileWalkers.ts
+++ b/packages/jest-resolve/src/fileWalkers.ts
@@ -30,7 +30,7 @@
 
   let stat;
   try {
-    // @ts-expect-error TS2554 - throwIfNoEntry is only available in recent version of node, but inclusion of the option is a backward compatible no-op.
+    // @ts-ignore TS2554 - throwIfNoEntry is only available in recent version of node, but inclusion of the option is a backward compatible no-op.
     stat = fs.statSync(path, {throwIfNoEntry: false});
   } catch (e: any) {
     if (!(e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))) {
--- a/packages/jest-resolve/src/shouldLoadAsEsm.ts
+++ b/packages/jest-resolve/src/shouldLoadAsEsm.ts
@@ -6,7 +6,7 @@
  */
 
 import {dirname, extname} from 'path';
-// @ts-expect-error: experimental, not added to the types
+// @ts-ignore: experimental, not added to the types
 import {SyntheticModule} from 'vm';
 import {findClosestPackageJson, readPackageCached} from './fileWalkers';
 
--- a/packages/jest-runner/src/index.ts
+++ b/packages/jest-runner/src/index.ts
@@ -54,6 +54,7 @@
 
   async #createInBandTestRun(tests: Array<Test>, watcher: TestWatcher) {
     process.env.JEST_WORKER_ID = '1';
+// @ts-ignore
     const mutex = pLimit(1);
     return tests.reduce(
       (promise, test) =>
@@ -122,6 +123,7 @@
     if (worker.getStdout()) worker.getStdout().pipe(process.stdout);
     if (worker.getStderr()) worker.getStderr().pipe(process.stderr);
 
+// @ts-ignore
     const mutex = pLimit(this._globalConfig.maxWorkers);
 
     // Send test suites to workers continuously instead of all at once to track
@@ -170,8 +172,10 @@
     const runAllTests = Promise.all(
       tests.map(test =>
         runTestInWorker(test).then(
+// @ts-ignore
           result =>
             this.#eventEmitter.emit('test-file-success', [test, result]),
+// @ts-ignore
           error => this.#eventEmitter.emit('test-file-failure', [test, error]),
         ),
       ),
--- a/packages/jest-runner/src/runTest.ts
+++ b/packages/jest-runner/src/runTest.ts
@@ -353,7 +353,7 @@
     }
 
     if (globalConfig.logHeapUsage) {
-      // @ts-expect-error - doesn't exist on globalThis
+      // @ts-ignore - doesn't exist on globalThis
       globalThis.gc?.();
 
       result.memoryUsage = process.memoryUsage().heapUsed;
--- a/packages/jest-runtime/src/index.ts
+++ b/packages/jest-runtime/src/index.ts
@@ -10,12 +10,12 @@
 import {URL, fileURLToPath, pathToFileURL} from 'url';
 import {
   Script,
-  // @ts-expect-error: experimental, not added to the types
+  // @ts-ignore: experimental, not added to the types
   SourceTextModule,
-  // @ts-expect-error: experimental, not added to the types
+  // @ts-ignore: experimental, not added to the types
   SyntheticModule,
   Context as VMContext,
-  // @ts-expect-error: experimental, not added to the types
+  // @ts-ignore: experimental, not added to the types
   Module as VMModule,
 } from 'vm';
 import {parse as parseCjs} from 'cjs-module-lexer';
@@ -454,6 +454,7 @@
           context,
         );
 
+// @ts-ignore
         this._esmoduleRegistry.set(cacheKey, wasm);
 
         transformResolve();
@@ -462,6 +463,7 @@
 
       if (this._resolver.isCoreModule(modulePath)) {
         const core = this._importCoreModule(modulePath, context);
+// @ts-ignore
         this._esmoduleRegistry.set(cacheKey, core);
 
         transformResolve();
@@ -484,7 +486,7 @@
             ['default'],
             function () {
               const obj = JSON.parse(transformedCode);
-              // @ts-expect-error: TS doesn't know what `this` is
+              // @ts-ignore: TS doesn't know what `this` is
               this.setExport('default', obj);
             },
             {context, identifier: modulePath},
@@ -493,6 +495,7 @@
           module = new SourceTextModule(transformedCode, {
             context,
             identifier: modulePath,
+// @ts-ignore
             importModuleDynamically: async (
               specifier: string,
               referencingModule: VMModule,
@@ -507,8 +510,10 @@
                 referencingModule.context,
               );
 
+// @ts-ignore
               return this.linkAndEvaluateModule(module);
             },
+// @ts-ignore
             initializeImportMeta: (meta: JestImportMeta) => {
               meta.url = pathToFileURL(modulePath).href;
 
@@ -559,7 +564,7 @@
         'You are trying to `import` a file after the Jest environment has been torn down.',
       );
       process.exitCode = 1;
-      // @ts-expect-error - exiting
+      // @ts-ignore - exiting
       return;
     }
 
@@ -567,11 +572,14 @@
       const fromCache = this._esmoduleRegistry.get('@jest/globals');
 
       if (fromCache) {
+// @ts-ignore
         return fromCache;
       }
       const globals = this.getGlobalsForEsm(referencingIdentifier, context);
+// @ts-ignore
       this._esmoduleRegistry.set('@jest/globals', globals);
 
+// @ts-ignore
       return globals;
     }
 
@@ -589,6 +597,7 @@
       const fromCache = this._esmoduleRegistry.get(specifier);
 
       if (fromCache) {
+// @ts-ignore
         return fromCache;
       }
 
@@ -629,7 +638,7 @@
             ['default'],
             function () {
               const obj = JSON.parse(code);
-              // @ts-expect-error: TS doesn't know what `this` is
+              // @ts-ignore: TS doesn't know what `this` is
               this.setExport('default', obj);
             },
             {context, identifier: specifier},
@@ -638,6 +647,7 @@
           module = new SourceTextModule(code, {
             context,
             identifier: specifier,
+// @ts-ignore
             importModuleDynamically: async (
               specifier: string,
               referencingModule: VMModule,
@@ -652,6 +662,7 @@
                 referencingModule.context,
               );
 
+// @ts-ignore
               return this.linkAndEvaluateModule(module);
             },
             initializeImportMeta(meta: ImportMeta) {
@@ -663,6 +674,7 @@
       }
 
       this._esmoduleRegistry.set(specifier, module);
+// @ts-ignore
       return module;
     }
 
@@ -690,9 +702,11 @@
       this._resolver.isCoreModule(resolved) ||
       this.unstable_shouldLoadAsEsm(resolved)
     ) {
+// @ts-ignore
       return this.loadEsmModule(resolved, query);
     }
 
+// @ts-ignore
     return this.loadCjsAsEsm(referencingIdentifier, resolved, context);
   }
 
@@ -767,10 +781,10 @@
       [...cjsExports, 'default'],
       function () {
         cjsExports.forEach(exportName => {
-          // @ts-expect-error: TS doesn't know what `this` is
+          // @ts-ignore: TS doesn't know what `this` is
           this.setExport(exportName, cjs[exportName]);
         });
-        // @ts-expect-error: TS doesn't know what `this` is
+        // @ts-ignore: TS doesn't know what `this` is
         this.setExport('default', cjs);
       },
       {context, identifier: modulePath},
@@ -792,6 +806,7 @@
     );
 
     if (this._moduleMockRegistry.has(moduleID)) {
+// @ts-ignore
       return this._moduleMockRegistry.get(moduleID);
     }
 
@@ -805,7 +820,7 @@
         Object.keys(invokedFactory),
         function () {
           Object.entries(invokedFactory).forEach(([key, value]) => {
-            // @ts-expect-error: TS doesn't know what `this` is
+            // @ts-ignore: TS doesn't know what `this` is
             this.setExport(key, value);
           });
         },
@@ -814,6 +829,7 @@
 
       this._moduleMockRegistry.set(moduleID, module);
 
+// @ts-ignore
       return evaluateSyntheticModule(module);
     }
 
@@ -925,6 +941,7 @@
     // We must register the pre-allocated module object first so that any
     // circular dependencies that may arise while evaluating the module can
     // be satisfied.
+// @ts-ignore
     const localModule: InitialModule = {
       children: [],
       exports: {},
@@ -954,7 +971,9 @@
 
   requireInternalModule<T = unknown>(from: string, to?: string): T {
     if (to) {
+// @ts-ignore
       const require = (
+// @ts-ignore
         nativeModule.createRequire ?? nativeModule.createRequireFromPath
       )(from);
       if (INTERNAL_MODULE_REQUIRE_OUTSIDE_OPTIMIZED_MODULES.has(to)) {
@@ -1036,7 +1055,9 @@
         modulePath = potentialManualMock;
       }
     }
+// @ts-ignore
     if (isManualMock) {
+// @ts-ignore
       const localModule: InitialModule = {
         children: [],
         exports: {},
@@ -1111,7 +1132,7 @@
   requireModuleOrMock<T = unknown>(from: string, moduleName: string): T {
     // this module is unmockable
     if (moduleName === '@jest/globals') {
-      // @ts-expect-error: we don't care that it's not assignable to T
+      // @ts-ignore: we don't care that it's not assignable to T
       return this.getGlobalsForCjs(from);
     }
 
@@ -1655,7 +1676,7 @@
         columnOffset: this._fileTransforms.get(filename)?.wrapperLength,
         displayErrors: true,
         filename: scriptFilename,
-        // @ts-expect-error: Experimental ESM API
+        // @ts-ignore: Experimental ESM API
         importModuleDynamically: async (specifier: string) => {
           invariant(
             runtimeSupportsVmModules,
@@ -1672,6 +1693,7 @@
             context,
           );
 
+// @ts-ignore
           return this.linkAndEvaluateModule(module);
         },
       });
@@ -1703,10 +1725,10 @@
     const module = new SyntheticModule(
       ['default', ...Object.keys(required)],
       function () {
-        // @ts-expect-error: TS doesn't know what `this` is
+        // @ts-ignore: TS doesn't know what `this` is
         this.setExport('default', required);
         Object.entries(required).forEach(([key, value]) => {
-          // @ts-expect-error: TS doesn't know what `this` is
+          // @ts-ignore: TS doesn't know what `this` is
           this.setExport(key, value);
         });
       },
@@ -1736,6 +1758,7 @@
           context,
         );
 
+// @ts-ignore
         moduleLookup[module] = await this.linkAndEvaluateModule(resolvedModule);
       }
     }
@@ -1748,6 +1771,7 @@
           if (!importsObject[module]) {
             importsObject[module] = {};
           }
+// @ts-ignore
           importsObject[module][name] = moduleLookup[module].namespace[name];
         }
         const wasmInstance = new WebAssembly.Instance(
@@ -1755,7 +1779,7 @@
           importsObject,
         );
         for (const {name} of exports) {
-          // @ts-expect-error: TS doesn't know what `this` is
+          // @ts-ignore: TS doesn't know what `this` is
           this.setExport(name, wasmInstance.exports[name]);
         }
       },
@@ -1786,6 +1810,7 @@
         throw error;
       }
 
+// @ts-ignore
       return this._createRequireImplementation({
         children: [],
         exports: {},
@@ -1800,7 +1825,7 @@
     class Module extends nativeModule.Module {}
 
     Object.entries(nativeModule.Module).forEach(([key, value]) => {
-      // @ts-expect-error: no index signature
+      // @ts-ignore: no index signature
       Module[key] = value;
     });
 
@@ -1810,6 +1835,7 @@
       Module.createRequire = createRequire;
     }
     if ('createRequireFromPath' in nativeModule) {
+// @ts-ignore
       Module.createRequireFromPath = function createRequireFromPath(
         filename: string | URL,
       ) {
@@ -2477,7 +2503,7 @@
       Object.keys(globals),
       function () {
         Object.entries(globals).forEach(([key, value]) => {
-          // @ts-expect-error: TS doesn't know what `this` is
+          // @ts-ignore: TS doesn't know what `this` is
           this.setExport(key, value);
         });
       },
--- a/packages/jest-snapshot/src/printSnapshot.ts
+++ b/packages/jest-snapshot/src/printSnapshot.ts
@@ -27,6 +27,7 @@
   RECEIVED_COLOR,
   getLabelPrinter,
   matcherHint,
+// @ts-ignore
   replaceMatchedToAsymmetricMatcher,
 } from 'jest-matcher-utils';
 import {format as prettyFormat} from 'pretty-format';
--- a/packages/jest-snapshot/src/utils.ts
+++ b/packages/jest-snapshot/src/utils.ts
@@ -222,6 +222,7 @@
 
 const isAnyOrAnything = (input: object) =>
   '$$typeof' in input &&
+// @ts-ignore
   input.$$typeof === Symbol.for('jest.asymmetricMatcher') &&
   ['Any', 'Anything'].includes(input.constructor.name);
 
--- a/packages/jest-test-result/src/types.ts
+++ b/packages/jest-test-result/src/types.ts
@@ -197,6 +197,7 @@
   'test-file-start': [Test];
   'test-file-success': [Test, TestResult];
   'test-file-failure': [Test, SerializableError];
+// @ts-ignore
   'test-case-start': [string, Circus.TestCaseStartInfo];
   'test-case-result': [string, AssertionResult];
 };
--- a/packages/jest-validate/src/validateCLIOptions.ts
+++ b/packages/jest-validate/src/validateCLIOptions.ts
@@ -77,6 +77,7 @@
   );
   const unrecognizedOptions = Object.keys(argv).filter(
     arg =>
+// @ts-ignore
       !allowedOptions.has(camelcase(arg, {locale: 'en-US'})) &&
       !allowedOptions.has(arg) &&
       (!rawArgv.length || rawArgv.includes(arg)),
--- a/packages/jest-worker/src/index.ts
+++ b/packages/jest-worker/src/index.ts
@@ -6,7 +6,7 @@
  */
 
 import {
-  // @ts-expect-error - added in Node 19.4.0
+  // @ts-ignore - added in Node 19.4.0
   availableParallelism,
   cpus,
 } from 'os';
--- a/packages/jest-worker/src/workers/ChildProcessWorker.ts
+++ b/packages/jest-worker/src/workers/ChildProcessWorker.ts
@@ -486,6 +486,7 @@
    * @returns Process id.
    */
   getWorkerSystemId(): number {
+// @ts-ignore
     return this._child.pid;
   }
 
--- a/packages/test-utils/src/alignedAnsiStyleSerializer.ts
+++ b/packages/test-utils/src/alignedAnsiStyleSerializer.ts
@@ -14,29 +14,43 @@
     // Return the string itself, not escaped nor enclosed in double quote marks.
     return val.replace(ansiRegex(), match => {
       switch (match) {
+// @ts-ignore
         case style.inverse.open:
           return '<i>';
+// @ts-ignore
         case style.inverse.close:
           return '</i>';
 
+// @ts-ignore
         case style.bold.open:
           return '<b>';
+// @ts-ignore
         case style.dim.open:
           return '<d>';
+// @ts-ignore
         case style.green.open:
           return '<g>';
+// @ts-ignore
         case style.red.open:
           return '<r>';
+// @ts-ignore
         case style.yellow.open:
           return '<y>';
+// @ts-ignore
         case style.bgYellow.open:
           return '<Y>';
 
+// @ts-ignore
         case style.bold.close:
+// @ts-ignore
         case style.dim.close:
+// @ts-ignore
         case style.green.close:
+// @ts-ignore
         case style.red.close:
+// @ts-ignore
         case style.yellow.close:
+// @ts-ignore
         case style.bgYellow.close:
           return '</>';
 
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -11,6 +11,7 @@
     "stripInternal": true,
 
     "strict": true,
+    "ignoreDeprecations": "5.0", // needed for debian node-typescript
 
     /* Additional Checks */
     "noUnusedLocals": true,
@@ -20,12 +21,9 @@
     "noFallthroughCasesInSwitch": true,
 
     /* This needs to be false so our types are possible to consume without setting this */
-    "esModuleInterop": false,
+    "esModuleInterop": true,
     "isolatedModules": true,
     "skipLibCheck": false,
-    "resolveJsonModule": true,
-
-    // TODO: remove for Jest 30
-    "ignoreDeprecations": "5.0"
+    "resolveJsonModule": true
   }
 }
