Mohamed Hegazy a704915747 Port master into release-2.6 10/16 (#19237)
* unspoof call expression start in iife

* add test

* cleanup

* rename variables

* Use checkExpression to resolve symbols

* Actual fix + test

* revert method rename

* explain changes and remove spurious assignment

* add tests

* verified that new tests show no regressions against master

* remove newline

* Refactor JSDoc types to Typescript types

When the caret is on a Typescript declaration that has no type, but does
have a JSDoc annotation with a type, this refactor will add the
Typescript equivalent of the JSDoc type.

Notes:

1. This doesn't delete the JSDoc comment or delete parts of it. In fact,
due to bugs in trivia handling, it sometimes duplicates the comment.
These bugs are tracked in #18626.

2. As a bonus, when `noImplicitAny: true`, this shows up as a code fix in VS Code
whenever there is a no-implicit-any error. With `noImplicityAny: false`,
this code must be invoked via the refactoring command.

* Test:refactor JSDoc types to Typescript types

* Change refactoring name and description

* Move filenames to match refactoring rename

* Transform jsdoc types in the refactor, not emitter

The emitter now understands JSDoc types but emits them in the original
format.

* Correctly transform jsdoc parameter types

And give a better name for rest params

* Convert all JSDoc parameters and return types of functions

* Add and update jsdoc annotation refactoring tests

* Convert @template tag to type parameters in refactor

* Test refactor of JSDoc @template tag

* Fix duplicated JSDoc comments

Incorporate suppressLeadingAndTrailingTrivia just added by @amcasey.

* Create source files lazily in tests (#19143)

* LEGO: check in for master to temporary branch.

* JSDoc->type refactor:Renames+improve never handling

* return more Debug.fails instead of undefined.

* Fix spacing lint

* In getContextuallyTypedParameterType, skip a `this` parameter when counting parameter index (#19155)

* LEGO: check in for master to temporary branch.

* Added test case.

* Create truly unique names for tagged template strings.

* Accepted baselines.

* Update generated files (#19177)

* Properly handle mapped types with 'keyof any'

* LEGO: check in for master to temporary branch.

* Mapped type { [P in any]: T } should yield { [x: string]: T }

* Add tests

* Accept new baselines

* LEGO: check in for master to temporary branch.

* Add getCompilerOptions method to project
Fixes #19218

* In convertFunctionToEs6Class.ts, share code for getting symbol (#19160)

* Fix for-in emit under systemjs (#19223)

* Support 'package.json' not in package root (#19133)

* Support 'package.json' not in package root

* Test "foo/@bar"

* More tests, and don't use "types" from the root package.json if not loading the root module

* Add comments about why we need two methods that return compilerOptions

* Fix instantiated generic mixin declaration emit (#19144)

* Fix #18545, dont use declared type of class expression

* Accept API Baselines

* Add thus far unused flag from node builder

* Accept baseline update

* Do not reduce subtypes of awaited union type

* Fix generated name scope when emitting async functions

* LEGO: check in for master to temporary branch.

* Add release-2.6 to covered branches
2017-10-16 16:53:36 -07:00
2017-10-12 17:43:49 -07:00
2017-10-12 17:31:03 -07:00

Build Status npm version Downloads

TypeScript

Join the chat at https://gitter.im/Microsoft/TypeScript

TypeScript is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the playground, and stay up to date via our blog and Twitter account.

Installing

For the latest stable version:

npm install -g typescript

For our nightly builds:

npm install -g typescript@next

Contribute

There are many ways to contribute to TypeScript.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Building

In order to build the TypeScript compiler, ensure that you have Git and Node.js installed.

Clone a copy of the repo:

git clone https://github.com/Microsoft/TypeScript.git

Change to the TypeScript directory:

cd TypeScript

Install Gulp tools and dev dependencies:

npm install -g gulp
npm install

Use one of the following to build and test:

gulp local            # Build the compiler into built/local 
gulp clean            # Delete the built compiler 
gulp LKG              # Replace the last known good with the built one.
                      # Bootstrapping step to be executed when the built compiler reaches a stable state.
gulp tests            # Build the test infrastructure using the built compiler. 
gulp runtests         # Run tests using the built compiler and test infrastructure. 
                      # You can override the host or specify a test for this command. 
                      # Use host=<hostName> or tests=<testPath>. 
gulp runtests-browser # Runs the tests using the built run.js file. Syntax is gulp runtests. Optional
                        parameters 'host=', 'tests=[regex], reporter=[list|spec|json|<more>]'.
gulp baseline-accept  # This replaces the baseline test results with the results obtained from gulp runtests.
gulp lint             # Runs tslint on the TypeScript source.
gulp help             # List the above commands. 

Usage

node built/local/tsc.js hello.ts

Roadmap

For details on our planned features and future direction please refer to our roadmap.

Description
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
Readme 5 GiB
2025-07-30 13:28:01 -05:00
Languages
TypeScript 97.9%
jsonc 1.9%
JavaScript 0.2%