no-class and
no-throw require architectural rewrites, not
search-and-replace. /shotscript-migrate handles the
rewrite, including updating every call site.
Runs the linter against your source files, reads every
flagged file, and rewrites violations in-place. Re-runs
until zero violations remain. Pass a glob to target specific
files, or omit it to let the command infer from
package.json.
npx shotscript 'src/**/*.ts' and parses
the output — one violation per line in
file:line:col [rule] message
format.
interface → type,
T[] → readonly T[],
throw →
return [null, err], and all others.
Never introduces new violations while fixing.
Best for: day-to-day use when you wrote something that triggered a rule and want it fixed without looking up the correct form.
Staged migration for an existing TypeScript codebase. Audits violations first, then works through them in two phases — mechanical fixes before structural rewrites — to avoid cascading breakage.
interface → type, optional
properties → | null, T[] →
readonly T[], let →
const, == →
===, enum →
as const, and more.
function declarations, classes → plain
types + functions, throw/try
→ Result tuple returns with
toResult/safeFetch from
shotscript/std. Updates every call
site.
Best for: onboarding an existing TypeScript project to ShotScript. The structural phase handles the rewrites that would otherwise require days of manual work.
Explains any ShotScript rule or violation. Pass a rule name or paste a full violation line from the linter output — the command returns what's banned, why, and a before/after example.
no-arrow-functions),
or a pasted violation line (e.g.
src/api.ts:12:5 [no-throw] Use return instead
of throw.)
Best for: onboarding new team members to the dialect, or quickly looking up the correct form for an unfamiliar rule.