Severity: LOW
Description
Running tsc --noEmit produces 40 errors about import paths ending with .ts extensions. While this doesn't break runtime (Node.js handles it), it indicates the tsconfig may need adjustment.
Sample Errors
src/agents.ts(4,23): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
src/daemon.ts(4,83): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
Root Cause
Imports like:
import { getDb } from "./state.ts";
TypeScript expects either:
- No extension:
import { getDb } from "./state";
- Or with
"allowImportingTsExtensions": true in tsconfig
Current State
- Project uses
"type": "module" in package.json
- Imports have
.ts extensions for ESM compatibility
- Node.js with
--experimental-strip-types handles this correctly at runtime
- But TypeScript compiler complains
Impact
- IDE errors/warnings (depending on editor)
tsc --noEmit returns non-zero exit code
- Could break CI if type checking is added
- Confusing for contributors
Recommendation
Add to tsconfig.json:
{
"compilerOptions": {
"allowImportingTsExtensions": true,
"noEmit": true,
// ... existing options
}
}
This tells TypeScript to allow .ts extensions in imports when noEmit is true (since we're using runtime stripping, not tsc for compilation).
Alternative
If you want tsc to compile (not just check), remove .ts extensions and use:
{
"compilerOptions": {
"module": "node16" or "nodenext",
"moduleResolution": "node16" or "nodenext"
}
}
Then imports would be from "./state.js" (note .js not .ts).
Related Files
All imports in:
- src/agents.ts
- src/daemon.ts
- src/index.ts
- src/ollama.ts
- src/runner.ts
- src/scheduler.ts
- src/server.ts
- src/state.ts
- src/tools/discovery.ts
- src/tools/registry.ts
- src/traces.ts
- All test files
Created by security audit
Severity: LOW
Description
Running
tsc --noEmitproduces 40 errors about import paths ending with.tsextensions. While this doesn't break runtime (Node.js handles it), it indicates the tsconfig may need adjustment.Sample Errors
Root Cause
Imports like:
TypeScript expects either:
import { getDb } from "./state";"allowImportingTsExtensions": truein tsconfigCurrent State
"type": "module"in package.json.tsextensions for ESM compatibility--experimental-strip-typeshandles this correctly at runtimeImpact
tsc --noEmitreturns non-zero exit codeRecommendation
Add to
tsconfig.json:{ "compilerOptions": { "allowImportingTsExtensions": true, "noEmit": true, // ... existing options } }This tells TypeScript to allow
.tsextensions in imports whennoEmitis true (since we're using runtime stripping, not tsc for compilation).Alternative
If you want
tscto compile (not just check), remove.tsextensions and use:{ "compilerOptions": { "module": "node16" or "nodenext", "moduleResolution": "node16" or "nodenext" } }Then imports would be
from "./state.js"(note.jsnot.ts).Related Files
All imports in:
Created by security audit