New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-tsfmt

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-tsfmt

A gulp plugin for formatting TypeScript files

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
146
decreased by-22.75%
Maintainers
2
Weekly downloads
 
Created
Source

gulp-tsfmt

Dependency status devDependency Status Build Status

A gulp plugin for formatting TypeScript files.

Installation

npm install gulp-tsfmt

TypeScript Version

gulp-tsfmt doesn't have own depency on TypeScript. You are expected to npm install typescript your own version. It's currently testes with version 1.7.5.

Usage

The snippet below formats and replaces in place each TypeScript file.

import tsfmt from 'gulp-tsfmt';

gulp.task('format', () => {
  gulp.src('**/*.ts')
    .pipe(tsfmt({ options: { ... }))
    .pipe(gulp.dest(file => path.dirname(file.path)));
});

You can also use gulp-changed-in-place plugin to prevent reformatting all files when only once changes.

import tsfmt from 'gulp-changed-in-place';
import tsfmt from 'gulp-tsfmt';

gulp.task('format', () => {
  gulp.src('**/*.ts')
    .pipe(changedInPlace())
    .pipe(tsfmt({ options: { ... }))
    .pipe(gulp.dest(file => path.dirname(file.path)));
});

Options

Here are the default values and available configuration options:

IndentSize: 2
TabSize: 2
NewLineCharacter: "\n"
ConvertTabsToSpaces: true
InsertSpaceAfterCommaDelimiter: true
InsertSpaceAfterSemicolonInForStatements: true
InsertSpaceBeforeAndAfterBinaryOperators: true
InsertSpaceAfterKeywordsInControlFlowStatements: true
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: false
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false
PlaceOpenBraceOnNewLineForFunctions: false
PlaceOpenBraceOnNewLineForControlBlocks: false

License

MIT

Keywords

FAQs

Package last updated on 19 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc