Skip to content

A quite delectable Gulp plugin to format and lint TypeScript code.

License

Notifications You must be signed in to change notification settings

plgregoire/pretty-typescript

Repository files navigation

✨pretty-typescript✨

Build Status npm version dependency status dev dependency status

A quite delectable Gulp plugin to format and lint TypeScript code.

Example

Turn this:

var heyo:     number

class incrediblybad
   {
private horrible_FielD: number
     dogedoge: () => any = () =>
   {
     return null      ;
  }
}

Into this:

var heyo: number

class incrediblybad {
  private horrible_FielD: number
  dogedoge: () => any = () => {
    return null;
  }
}

In bonus, you get this error:

[13:30:47] [gulp-tslint] error verybad.ts[3, 7]: name must be in pascal case

Usage

Step 1. Install :

npm install --save-dev pretty-typescript

Step 2. Use :

const prettyTypescript = require('pretty-typescript');

gulp.task('prettify', function () {
  gulp.src('src/**/*.ts')
    .pipe(prettyTypescript())
    .pipe(gulp.dest('src'));
});

Step 3. Profit !

Made with <3 by Coveo

About

A quite delectable Gulp plugin to format and lint TypeScript code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%