AWS Builder Center

Zero any Types: JS to Strict TypeScript in One PR

Convert a React + Express JavaScript app to strict TypeScript with zero any types in one AWS Transform command. tsc --noEmit passes clean.

A JavaScript fullstack app, React frontend and Express backend. One ATX command. Strict TypeScript with zero  any  types, typed React hooks, typed Express handlers, and  tsc --noEmit  passing clean. Here's how.



Why Go Strict from the Start?

The gradual TypeScript adoption story has run its course. You know how it goes: you add TypeScript to the project, set  strict: false , sprinkle  any  wherever the compiler complains, and promise yourself you'll "fix the types later." Six months on, you have 200 files of TypeScript that provides roughly the same safety as JavaScript with extra syntax.
The data backs this up. Teams using strict TypeScript report significantly fewer runtime type errors compared to gradual adoption [1]. The TypeScript team themselves recommend starting strict: it's easier to relax constraints than to tighten them after the fact [2].
The challenge isn't convincing anyone that strict TypeScript is better. It's doing the conversion. A typical React + Express app has:
  • Express route handlers with untyped  req.body ,  req.params ,  req.query 
  • React components with untyped  useState , event handlers, and fetch responses
  • Shared data models duplicated (or worse, not defined at all) between client and server
  • CommonJS  require/module.exports  that needs to become ESM  import/export 
For a small app, that's a day of work. For a monorepo with 50 components and 30 API endpoints? That's where teams give up and add  // @ts-ignore .
AWS Transform Custom has a published transformation for this:  JavaScript-to-TypeScript-Migration . Combined with strict-mode context, it handles the mechanical conversion in minutes.

The Starting Point

A JavaScript fullstack task manager, Express API backend and React frontend. Standard patterns you'd find in any JS project:
Server ( server/index.js ):
const express = require("express");
const cors = require("cors");

const app = express();
app.use(cors());
app.use(express.json());

const tasks = [];
let nextId = 1;

app.get("/api/tasks", (req, res) => {
const status = req.query.status;
if (status) {
return res.json(tasks.filter((t) => t.status === status));
}
res.json(tasks);
});

app.post("/api/tasks", (req, res) => {
const { title, description, assignee } = req.body;
if (!title) return res.status(400).json({ error: "Title required" });

const task = {
id: nextId++,
title,
description: description || "",
assignee: assignee || null,
status: "todo",
createdAt: new Date().toISOString(),
};
tasks.push(task);
res.status(201).json(task);
});
Client ( client/src/App.jsx ):
import { useState, useEffect } from "react";

function App() {
const [tasks, setTasks] = useState([]);
const [newTitle, setNewTitle] = useState("");

async function addTask(e) {
e.preventDefault();
if (!newTitle.trim()) return;
const res = await fetch("/api/tasks", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ title: newTitle }),
});
if (res.ok) {
setNewTitle("");
fetchTasks();
}
}
// ...
}
No types. No interfaces. No safety.  req.body  is implicitly  any .  useState([])  is  never[] . Event handlers are untyped. The compiler can't help you here.

The Transformation Flow

ATX JS-to-TypeScript Transformation Flow


Running the Transformation

cd fullstack-app
git init && git add . && git commit -m "initial: JavaScript fullstack app"

aws configure # configure AWS credentials (or use env vars / a profile)
atx
I describe the requirements:
> Convert this JavaScript project to strict TypeScript with zero any types.
Rename .js to .ts and .jsx to .tsx. Add tsconfig.json with strict: true
and noImplicitAny: true. Add interfaces for all data models. Type all
function parameters and return types. Type React useState, event handlers,
and API responses. Replace require/module.exports with import/export.
Create a shared types file. Validation command: npx tsc --noEmit
ATX finds a matching transformation:
ATX: I found an existing transformation that's similar to what you're looking for:
153. JavaScript-to-TypeScript-Migration - "Convert JavaScript code to TypeScript
to provide static type checking, improved IDE tooling, and enhanced code quality
while maintaining the same functionality."

Would you like to:
1. Use the existing "JavaScript-to-TypeScript-Migration" transformation
2. Create a new transformation tailored to your exact specifications
I pick option 1 and pass the strict-mode requirements as additional context. ATX creates a branch, analyzes the code, and gets to work.
Note for readers:  JavaScript-to-TypeScript-Migration  is a custom transformation definition, not AWS-managed, and transformation definitions are account-specific. It won't be in your registry until you create and publish it — use the  SKILL.md  included with this post's demo ( atx custom def publish ), or pick option 2 to have ATX build it. The numbered "153." above is just how it appeared in this account's registry; your number will differ.

What ATX Produced

Server ( server/index.ts )

import express, { Request, Response } from "express";
import cors from "cors";

const app = express();
app.use(cors());
app.use(express.json());

interface Task {
id: number;
title: string;
description: string;
assignee: string | null;
status: string;
createdAt: string;
}

const tasks: Task[] = [];
let nextId = 1;

app.get("/api/tasks", (req: Request, res: Response) => {
const status = req.query.status as string | undefined;
if (status) {
return res.json(tasks.filter((t) => t.status === status));
}
res.json(tasks);
});

app.get("/api/tasks/:id", (req: Request<{ id: string }>, res: Response) => {
const task = tasks.find((t) => t.id === parseInt(req.params.id));
if (!task) return res.status(404).json({ error: "Not found" });
res.json(task);
});

app.post("/api/tasks", (req: Request, res: Response) => {
const { title, description, assignee } = req.body;
if (!title) return res.status(400).json({ error: "Title required" });

const task: Task = {
id: nextId++,
title,
description: description || "",
assignee: assignee || null,
status: "todo",
createdAt: new Date().toISOString(),
};
tasks.push(task);
res.status(201).json(task);
});

app.patch("/api/tasks/:id", (req: Request<{ id: string }>, res: Response) => {
const task = tasks.find((t) => t.id === parseInt(req.params.id));
if (!task) return res.status(404).json({ error: "Not found" });

const { title, description, status, assignee } = req.body;
if (title) task.title = title;
if (description !== undefined) task.description = description;
if (status) task.status = status;
if (assignee !== undefined) task.assignee = assignee;

res.json(task);
});

app.delete("/api/tasks/:id", (req: Request<{ id: string }>, res: Response) => {
const idx = tasks.findIndex((t) => t.id === parseInt(req.params.id));
if (idx === -1) return res.status(404).json({ error: "Not found" });
tasks.splice(idx, 1);
res.status(204).send();
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => console.log(`Server on ${PORT}`));

export default app;

Client ( client/src/App.tsx )

import { useState, useEffect, FormEvent } from "react";

interface Task {
id: number;
title: string;
status: string;
}

function App() {
const [tasks, setTasks] = useState<Task[]>([]);
const [newTitle, setNewTitle] = useState("");
const [filter, setFilter] = useState("all");

useEffect(() => {
fetchTasks();
}, [filter]);

async function fetchTasks() {
const url = filter === "all" ? "/api/tasks" : `/api/tasks?status=${filter}`;
const res = await fetch(url);
const data: Task[] = await res.json();
setTasks(data);
}

async function addTask(e: FormEvent) {
e.preventDefault();
if (!newTitle.trim()) return;
const res = await fetch("/api/tasks", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ title: newTitle }),
});
if (res.ok) {
setNewTitle("");
fetchTasks();
}
}

async function toggleStatus(task: Task) {
const nextStatus = task.status === "todo" ? "done" : "todo";
await fetch(`/api/tasks/${task.id}`, {
method: "PATCH",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ status: nextStatus }),
});
fetchTasks();
}

async function deleteTask(id: number) {
await fetch(`/api/tasks/${id}`, { method: "DELETE" });
fetchTasks();
}

return (
<div className="app">
<h1>Tasks</h1>
<form onSubmit={addTask}>
<input
value={newTitle}
onChange={(e) => setNewTitle(e.target.value)}
placeholder="New task..."
/>
<button type="submit">Add</button>
</form>
<div className="filters">
{["all", "todo", "done"].map((f) => (
<button key={f} onClick={() => setFilter(f)} className={filter === f ? "active" : ""}>
{f}
</button>
))}
</div>
<ul>
{tasks.map((task) => (
<li key={task.id}>
<span className={task.status === "done" ? "done" : ""} onClick={() => toggleStatus(task)}>
{task.title}
</span>
<button onClick={() => deleteTask(task.id)}>×</button>
</li>
))}
</ul>
</div>
);
}

export default App;

The Transformation Breakdown

Before (JavaScript)
After (TypeScript)
 const tasks = [] 
 const tasks: Task[] = [] 
 (req, res) => {...} 
 (req: Request, res: Response) => {...} 
 req.params.id  (untyped)
 req: Request<{ id: string }>  (typed generic)
 req.query.status  (any)
 req.query.status as string | undefined 
 useState([]) 
 useState<Task[]>([]) 
 addTask(e)  (any event)
 addTask(e: FormEvent) 
 toggleStatus(task)  (any)
 toggleStatus(task: Task) 
 deleteTask(id)  (any)
 deleteTask(id: number) 
 require("express") 
 import express from "express" 
 module.exports = app 
 export default app 
No interface definitions
 interface Task { id: number; title: string; ... } 
 .js  /  .jsx  files
 .ts  /  .tsx  files
ATX also added:
  •  Task  interface defined in both server and client (matching the shape)
  •  Request<{ id: string }>  generics for path parameter typing
  •  FormEvent  import from React for form submission handler
  •  string | null  union type for nullable fields ( assignee )
  •  export default  replacing  module.exports 

Validation

$ npx tsc --noEmit
# (no output, zero errors)
Clean. No errors. No  any  types. The TypeScript compiler is now your safety net, catching type mismatches, missing properties, and incorrect function signatures at build time rather than at 2am in production.

What You Get for Free

Beyond catching bugs earlier, strict TypeScript gives you:
IDE superpowers. Every function call now shows parameter types on hover. Every variable has autocomplete based on its interface. Rename a field in  Task  and your IDE highlights every file that needs updating.
Self-documenting code. The  Task  interface IS the documentation. New developers don't need to grep through handler code to understand the data shape. It's declared explicitly.
Refactoring confidence. Change  status  from a string to an enum? The compiler tells you exactly which lines break. No more "find and replace and hope."
API contract enforcement. The server's  Task  interface and the client's  Task  interface are now explicit contracts. If they drift out of sync, the compiler catches it (or better, extract them into a shared types package).

Scaling This Across Your Org

Fleet-Scale TypeScript Migration


Non-Interactive Mode

atx custom def exec \
--transformation-name "JavaScript-to-TypeScript-Migration" \
--code-repository-path /path/to/project \
--build-command "npx tsc --noEmit" \
--configuration "additionalPlanContext=strict: true, noImplicitAny: true, zero any types, type all React hooks and event handlers" \
--non-interactive --trust-all-tools

Batch Across Multiple Projects

#!/bin/bash
JS_PROJECTS=(
"/path/to/dashboard"
"/path/to/admin-panel"
"/path/to/api-gateway"
"/path/to/shared-components"
)

for project in "${JS_PROJECTS[@]}"; do
echo "=== Converting: $(basename $project) ==="
atx custom def exec \
-n "JavaScript-to-TypeScript-Migration" \
-p "$project" \
-c "npx tsc --noEmit" \
--configuration "additionalPlanContext=strict: true, zero any types" \
-x -t
echo "✅ Done"
done

Enterprise Scale

For large frontend monorepos or microservice fleets, use the  AWS Batch scaled execution infrastructure  to run conversions in parallel, 128 concurrent jobs, progress tracking via CloudWatch.
Cost: In one example run this took a few agent minutes at $0.035/agent-minute, on the order of ~$0.10. Agent-minutes are non-deterministic and vary per run, project size, and how many  tsc  validation cycles ATX needs to reach zero errors, so treat fleet totals as estimates and run a pilot to establish your own baseline. Either way it's a fraction of the cost of weeks of manual conversion work [3].

The Honest Caveats

ATX handled this conversion cleanly because the project used standard patterns. A few situations that need more attention:
Dynamic property access. If your code does  obj[someVariable] , TypeScript needs an index signature or type assertion. ATX will add  as  assertions where needed, but you may want to refactor those to be more type-safe.
Third-party libraries without types. If you use npm packages that don't ship type definitions (no  @types/  package available), ATX will add  // @ts-ignore  or a module declaration. Check these manually.
Complex React patterns. Higher-order components, render props, and complex generic components may need manual type refinement. Standard hooks and functional components (like this demo) convert cleanly.
Test files. This project had no tests. If yours does, ATX will convert test files too, but testing library types (Jest, Vitest, etc.) may need additional  @types/  packages.
For standard React + Express projects with common patterns, ATX handles the conversion end-to-end without manual intervention.

Getting Started

# Install ATX (requires Node.js 22+)
curl -fsSL https://transform-cli.awsstatic.com/install.sh | bash

# Authenticate (configure AWS credentials)
aws configure # or set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_REGION

# Run against your JS project
cd your-javascript-project
atx

# Type: Convert this JavaScript project to strict TypeScript...
Or non-interactively:
atx custom def exec \
--transformation-name "JavaScript-to-TypeScript-Migration" \
--code-repository-path . \
--build-command "npx tsc --noEmit" \
--configuration "additionalPlanContext=strict: true, noImplicitAny: true, zero any types" \
--non-interactive --trust-all-tools
The  JavaScript-to-TypeScript-Migration  transformation may already be in your registry (or you can create it). You don't need to build it from scratch. Just point it at your project, specify strict mode, and let it work.
The days of gradual TypeScript adoption are over. Go strict from day one.



Resources

References

[1] State of JavaScript 2025 Survey, "TypeScript Adoption and Impact."  https://stateofjs.com 
[2] TypeScript Documentation, "Migrating from JavaScript."  https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html 
[3] AWS, "AWS Transform pricing."  https://aws.amazon.com/transform/pricing/ 


Disclaimer: Opinions expressed are personal and do not represent the official position of any organization. All claims about ATX capabilities are verified against the  official documentation .
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article