Skip to content

interop

Files under @repobuddy/typescript/tsconfig/interop/ match the Interop Constraints category of the TSConfig reference.

File Sets
interop/buddy forceConsistentCasingInFileNames, isolatedModules
interop/esm esModuleInterop

The recommended interop settings. Used by tsconfig/monorepo.

{
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"isolatedModules": true
}
}
  • forceConsistentCasingInFileNames rejects an import whose casing differs from the file name on disk.
  • isolatedModules reports code that a single-file transpiler (esbuild, SWC, Babel) cannot compile.
  • tsc --showConfig (TypeScript 7.0.2) also lists preserveConstEnums: true, which TypeScript derives from isolatedModules.
{
"compilerOptions": {
"esModuleInterop": true
}
}

Use it with module set to an ES* value or CommonJS. Do not use it with Node16 or NodeNext (the file’s own comment says so).

modules/buddy-commonjs already sets esModuleInterop, so you do not need this file with it.