chore(test): load Vitest config as native ESM to drop configLoader warning (#42266)

* chore(test): load Vitest config as native ESM to drop configLoader warning

* chore(test): use rewriteRelativeImportExtensions so type-aware lint accepts .ts imports
This commit is contained in:
Neil
2026-11-13 20:12:19 -08:00
committed by GitHub
parent 98d73ddcae
commit 4dbfc70cb4
6 changed files with 13 additions and 6 deletions
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
@@ -4,7 +4,7 @@ import {
REACT_COMPILER_OPTIONS,
isReactCompilerEnabled,
reactCompilerExcludePattern
} from './react-compiler'
} from './react-compiler.ts'
const rendererSource = /\/src\/renderer\/src\/.*\.tsx?$/
// Only shipped code is compiled; tests, fixtures, mocks and harnesses run as written.
+3
View File
@@ -0,0 +1,3 @@
{
"type": "module"
}
+1
View File
@@ -42,6 +42,7 @@
],
"compilerOptions": {
"composite": true,
"rewriteRelativeImportExtensions": true,
"types": ["electron-vite/node"]
}
}
+3 -3
View File
@@ -13,11 +13,11 @@ import { filesSafeToShareWorker } from './scripts/test-runtime/execution-policy/
import { gitSigningOffEnv } from './scripts/test-runtime/environment/vitest-git-signing-env.mjs'
import RuntimeSequencer from './scripts/test-runtime/execution-policy/vitest-runtime-sequencer.mjs'
import { getNodeRuntimeInclude } from './scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs'
import { nodeRuntimePool } from './scripts/test-runtime/node-worker/vitest-node-runtime-pool'
import { nodeRuntimePool } from './scripts/test-runtime/node-worker/vitest-node-runtime-pool.ts'
import { readRunFilters } from './scripts/test-runtime/execution-policy/vitest-run-filters.mjs'
import { createWorkspaceSourceResolver } from './scripts/workspace/source-exports/workspace-source-exports.mjs'
import { moduleCacheResolutionKey } from './scripts/test-runtime/module-cache/vitest-module-cache-resolution-key'
import { vitestReactCompiler } from './build-plugins/vitest-react-compiler'
import { moduleCacheResolutionKey } from './scripts/test-runtime/module-cache/vitest-module-cache-resolution-key.ts'
import { vitestReactCompiler } from './build-plugins/vitest-react-compiler.ts'
const nodeRuntimeInclude = process.versions.bun
? getNodeRuntimeInclude({ filters: readRunFilters() })
+2 -2
View File
@@ -1,8 +1,8 @@
import { existsSync } from 'node:fs'
import { resolve } from 'node:path'
import { defineConfig } from 'vitest/config'
import baseConfig from './vitest.config'
import { nodeRuntimePool } from './scripts/test-runtime/node-worker/vitest-node-runtime-pool'
import baseConfig from './vitest.config.ts'
import { nodeRuntimePool } from './scripts/test-runtime/node-worker/vitest-node-runtime-pool.ts'
const contracts = [
'src/main/runtime/session-tabs/session-tabs-phone-layout-moves.test.ts',