From 4aa4d25cb0e77b579af06da41c3ba24e06c8b8ed Mon Sep 17 00:00:00 2001 From: Tyler <26290074+tylersayshi@users.noreply.github.com> Date: Thu, 14 Aug 2025 20:42:09 -0700 Subject: [PATCH] research and new todo made --- README.md | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6b01f30..6266b6f 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,45 @@ flag. The assumptions and opinions related to the changes that will be made are described in [assumptions.md](./docs/assumptions.md). +## Not supported + +I'm personally unaware of scenarios where either of these would be intentionally +included patterns, so am taking the approach of leaving them for typescript to +error on. If however you'll need a codemod from one of these, please feel free +to [make an issue](https://github.com/tylersayshi/tsec/issues/new). + +- namespaces and modules with runtime code +- Non-ECMAScript import = and export = assignments + +```ts +// ❌ error: An `import ... = require(...)` alias +import foo = require("foo"); +// ❌ error: A namespace with runtime code. +namespace container { + foo.method(); + export type Bar = string; +} +// ❌ error: An `import =` alias +import Bar = container.Bar; +``` + ## TODO **Additional mods** -- [ ] namespaces and modules with runtime code -- [x] parameter properties in classes -- [ ] Non-ECMAScript import = and export = assignments -- [x] (insufficient) check support needed for import rewrites: - [docs](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-7.html#path-rewriting-for-relative-paths) -- [ ] update tsconfig.json (maybe this can just be instructions logged from - cli): [docs](https://nodejs.org/api/typescript.html#type-stripping) +- [ ] path alias rewrite +- [ ] relativePath rewrite from .js, .cjs, .mjs, or from no extension (.ts, + .cts, and .mts can stay the same) **Ready for migrating repo's** - [ ] Handle multiple files with glob input - [ ] Write a cli for running the codemod with options for picking which transformations to run on +- [ ] CLI should warn about tsconfig updates and docs to be aware of + - https://nodejs.org/api/typescript.html#type-stripping +- [ ] CLI about how to fix imports for `verbatimModuleSyntax` + - opting not to support this to encourage the use of auto-fixing lint rules + - https://typescript-eslint.io/rules/consistent-type-imports + - https://biomejs.dev/linter/rules/use-import-type/ - [ ] Support monorepos -- 2.51.2