CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/typescript-project-structure

TypeScript project structure, strict tsconfig, module resolution, path aliases, shared types, and monorepo patterns

90

1.09x
Quality

84%

Does it follow best practices?

Impact

100%

1.09x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-4/

Fix Loose TypeScript Configuration

Problem/Feature Description

You've inherited a TypeScript project with a poorly configured setup. The project is a Node.js API service with the following issues:

  1. The tsconfig.json has strict: false and uses legacy "moduleResolution": "node" with "module": "commonjs"
  2. Source files are mixed at the project root alongside config files (no src/ directory)
  3. There is no .gitignore, and the dist/ folder has been committed
  4. Types are scattered — the same User interface is defined in three different files
  5. All imports use deep relative paths like ../../../utils/helpers
  6. There are no build/dev/typecheck scripts — developers run ts-node index.ts directly
  7. No ESLint configuration exists

The existing files are:

tsconfig.json:

{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "moduleResolution": "node",
    "strict": false,
    "esModuleInterop": true,
    "outDir": "dist"
  }
}

package.json:

{
  "name": "my-api",
  "scripts": {
    "start": "ts-node index.ts"
  },
  "dependencies": {
    "express": "^4.18.0",
    "ts-node": "^10.9.0",
    "typescript": "^5.0.0"
  }
}

Output Specification

Produce a migration plan and updated configuration files:

  • plan.md — Step-by-step migration plan explaining what changes are needed and why
  • tsconfig.json — Corrected TypeScript configuration with strict mode, proper module resolution, path aliases
  • package.json — Updated with proper scripts (build, dev, start, typecheck, lint), type: module, and updated dependencies
  • .gitignore — Proper ignores for a TypeScript/Node project
  • eslint.config.js — ESLint with typescript-eslint
  • A recommended directory structure showing where files should be moved (can be described in plan.md or shown as a file tree)

Do not produce the actual source files — focus on the configuration, migration plan, and recommended structure.

evals

tile.json