TypeStat
TypeStat copied to clipboard
Converts JavaScript to TypeScript and TypeScript to better TypeScript. 🧫
`postProcess` as an option is not yet documented. It should be!
Might be easier than doing it within here...! https://www.npmjs.com/package/typesync
How interesting! Idea courtesy of @sqs (superset of #34). Could TypeStat be used to _remove_ unused types across a code base instead of adding missing ones in?
Following #178, let's add this: ```diff class Component { state: TState; } + type ClickableState = { + clicks: number, + }; - class Clickable extends Component { + class...
Continuation of #180 for React's `setState` pattern: ```diff class Component { state: TState; setState(newState: TState): void; } + type ClickableState = { + clicks: number, + }; - class Clickable...
The root README.md indicates it'll explain how TypeStat works... but the file does not.
If a large node is printed then the console spew gets pretty massive... let's cap node text to an arbitrary 5 lines, with `...` as a 6th line there are...
When creating an interface for a React component that has `propTypes`, it's assumed the names will be something like `MyClassProps`. This likely isn't idiomatic for all consumers. Maybe folks will...
Similar to #180, but with function parameters of the generic type: ```diff class Component { setState(newState: Partial | ((oldState: TState) => TState)) { } } + type ClickableState = {...
Given this React component: ```ts const MyComponent = ({ greeting, name }) => return `${greeting}, ${name}!`; ``` Should the `MyComponentProps` be added as... * `{ greeting, name }: My ComponentProps`...