Giter Site home page Giter Site logo

declanvong / lazyscript Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 393.52 MB

When you're too lazy to change your code, so you change the compiler instead.

License: Apache License 2.0

TypeScript 99.98% JavaScript 0.01% Shell 0.01% Groovy 0.01% PowerShell 0.01% Batchfile 0.01% HTML 0.01%

lazyscript's Introduction

Instructions

  1. Clone this somewhere
  2. Install gulp if you don't have it already (npm install -g gulp)
  3. Compile the compiler with gulp local
  4. Point VSCode to this build of tsc by adding "typescript.tsdk": "<cloned directory>/built/local" to your VSCode user settings (or workspace settings)
  5. Make sure you have a tsconfig.json for your source directory
  6. Restart VSCode or relaunch the TSServer by running CMD+Shift+P => TypeScript: Restart TS Server

Additional functionality

  • Added support for .es6 file extensions as JS
  • Import paths that begin with leading slashes are interpreted as from the project root, not the disk root
  • Fixed type parser on JSDoc object literal types that spanned multiple lines
  • Added support for templated classes via JSDoc. Previously, @template could only be used for functions; they are now valid class declaration tags and will be an available type within the entire class scope
  • @typedef tags with no identifier names are now legal, if the JSDoc comment is attached to a variable declaration with no assigned expression or initializer (identifier is inferred from the variable name)
  • @return statements on constructors no longer throws an error if the return type is the containing class type
  • Mark JSDoc types that have type (...|undefined) as optional parameters
  • Add support for the @interface tag on classes
  • Interpret identifier statements as type definitions if they have a @typedef tag attached
  • Added support for the @enum tag

Todo

  • (Bug) Fix the symbol binding on enum declarations
  • Support for namespaced enum declarations, e.g. SomeClass.EnumName should emit SomeClass as a namespace declaration.
  • Variadic function parameters should be marked optional
  • Add support for the @inheritdoc and @private tags
  • Add a warning if an optional parameter is not supplied
  • Change the error message to be "Constructor return type does not match containing class type" if a return tag on a constructor does not match
  • Check for the diagnostic errors I removed in program.ts and add them back again with more constrained checks against NodeFlags.Hacked
  • Actually clean up my fixes and put them in functions so I can rebase against upstream and not die from all the conflicts
  • Rewrite all of my code as proper parse subtrees instead of rewriting nodes

lazyscript's People

Contributors

ahejlsberg avatar amcasey avatar aozgaa avatar armanio123 avatar billti avatar chrisbubernak avatar csigs avatar cyrusnajmabadi avatar danielrosenwasser avatar danquirk avatar declanvong avatar dickvdbrink avatar herringtondarkholme avatar ivogabe avatar jramsay avatar jsonfreeman avatar mhegazy avatar rbuckton avatar riknoll avatar ryancavanaugh avatar sandersn avatar saschanaz avatar sheetalkamat avatar steveluc avatar tinganho avatar uniqueiniquity avatar vladima avatar weswigham avatar yuichinukiyama avatar zhengbli avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.