All Projects → urish → Typewiz

urish / Typewiz

Automatically discover and add missing types in your TypeScript code

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Typewiz

Prettier action
GitHub action for running prettier on your projects pull requests
Stars: ✭ 77 (-92.5%)
Mutual labels:  automation, code-quality
Watchtower
A process for automating Docker container base image updates.
Stars: ✭ 9,526 (+828.46%)
Mutual labels:  automation
Phpcs Type Sniff
PHP CodeSniffer sniff to enforce PHP 7 types and documentation of array variables
Stars: ✭ 35 (-96.59%)
Mutual labels:  type-safety
Qvplugin Command
在 Qv2ray 状态改变时运行指定的程序!
Stars: ✭ 41 (-96%)
Mutual labels:  automation
Gsoc2018 3gm
💫 Automated codification of Greek Legislation with NLP
Stars: ✭ 36 (-96.49%)
Mutual labels:  automation
Ferrum
Headless Chrome Ruby API
Stars: ✭ 1,009 (-1.66%)
Mutual labels:  automation
Goapy
Goal-Oriented Action Planning implementation in Python
Stars: ✭ 33 (-96.78%)
Mutual labels:  automation
Automated Cloud Advisor
Automated Cloud Advisor is a extensible tool that aims at facilitating cost optimization in AWS, by collecting data for resources that are under utilized. In addition, this is a great learning tool for new DevOps/Cloud engineers that want to start automating things in AWS.
Stars: ✭ 44 (-95.71%)
Mutual labels:  automation
Hammerspoon
Staggeringly powerful macOS desktop automation with Lua
Stars: ✭ 8,540 (+732.36%)
Mutual labels:  automation
Terraform
Share Terraform best practices and custom modules with the community
Stars: ✭ 39 (-96.2%)
Mutual labels:  automation
Chef Plugin
This is jenkins plugin to run chef-client on remote host
Stars: ✭ 38 (-96.3%)
Mutual labels:  automation
Nettacker
Automated Penetration Testing Framework
Stars: ✭ 982 (-4.29%)
Mutual labels:  automation
Project Automation
Python script for creating new projects (React, Express.js, Vue, Laravel, etc.) in the desired local directory, with a GitHub origin.
Stars: ✭ 42 (-95.91%)
Mutual labels:  automation
Kafka Specs
Tool to ease and automate Apache Kafka cluster configuration management
Stars: ✭ 36 (-96.49%)
Mutual labels:  automation
Puphpeteer
A Puppeteer bridge for PHP, supporting the entire API.
Stars: ✭ 1,014 (-1.17%)
Mutual labels:  automation
Scheduler
Automates completion and emailing of .xlsx time sheet.
Stars: ✭ 34 (-96.69%)
Mutual labels:  automation
Hydroponic Automation
A program to monitor and control 8 variables of a hydroponic gardening system
Stars: ✭ 38 (-96.3%)
Mutual labels:  automation
Edge Selenium Tools
An updated EdgeDriver implementation for Selenium 3 with newly-added support for Microsoft Edge (Chromium).
Stars: ✭ 41 (-96%)
Mutual labels:  automation
Infra Personal
Terraform for setting up my personal infrastructure
Stars: ✭ 45 (-95.61%)
Mutual labels:  automation
Docker Swarm
🐳🐳🐳 This repository is part of a blog series on Docker Swarm example using VirtualBox, OVH Openstack, Azure and Amazon Web Services AWS
Stars: ✭ 43 (-95.81%)
Mutual labels:  automation

TypeWiz

Automatically discover and add missing types in your TypeScript code.

TypeWiz

Build Status Coverage Status code style: prettier

Introduction

TypeWiz monitors your variable types in runtime, and uses this information to add missing type annotations to your TypeScript code. For instance, given the following source code as input:

function add(a, b) {
    return a + b;
}
add(5, 6);

TypeWiz will automatically detect the types of a and b as number, and will rewrite to code to read:

function add(a: number, b: number) {
    return a + b;
}
add(5, 6);

You can learn more about the project in the blog posts:

Usage

For front-end code, please have a look at the TypeWiz WebPack Plugin.

For node.js code, please check out the typewiz-node Runner.

To use TypeWiz from the command line try the TypeWiz CLI.

If you are interested in creating your own custom integration, see the Integration Test for an example how to directly use the TypeWiz API. You can use the API directly by adding this library to your project:

yarn add -D typewiz-core

or

npm install --save-dev typewiz-core

Configuration options

Configuration options can be specified using the typewiz.json configuration file. This file is used by typewiz-node and typewiz-webpack and can be parsed using the ConfigurationParser class in typewiz-core for custom integrations.

The typewiz.json file has the following format:

{
    "common":{
        "rootDir":".",
        "tsConfig":"tsconfig.json"
    },
    "instrument":{
        "instrumentCallExpressions":true,
        "instrumentImplicitThis":true,
        "skipTwizDeclarations":true
    },
    "applyTypes":{
        "prefix":"TypeWiz |"
    }
}

Options:

  • rootDir: string (default: undefined) - If given, all the file paths in the collected type info will be resolved relative to this directory.

  • tsConfig: string (default: undefined) - The path to your project's tsconfig.json file. This is required for several other options, like instrumenting implicit this and type inference using static analysis.

  • instrumentCallExpressions: boolean (default: false) - Try to find even more types by combining static analysis with the runtime analysis. TypeWiz will try to use TypeScript's inferred types when determining the type of a function argument. See #27 for an example.

  • instrumentImplicitThis: boolean (default: false) - Find type of this in non-class member functions. See #33 for discussion.

  • skipTwizDeclarations: boolean (default: false) - Don't add a declaration of $_$twiz to instrumented files.

  • prefix: string (default: '') - A prefix to add before each type added by applyTypes(). See #11.

License

Copyright (C) 2018, Uri Shaked. Licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].