Registry / devops / gulp-typescript-formatter

gulp-typescript-formatter

JSON →
library0.1.3jsnpmunverified

Gulp plugin wrapping typescript-formatter to format TypeScript files as part of a Gulp build pipeline. Current version 0.1.3, last updated 2017-11-16. No known release cadence; appears unmaintained since 2017. It accepts the same root options as typescript-formatter (baseDir, tslint, tsfmt, editorconfig). Key differentiator: allows integration of TypeScript formatting into Gulp streams, but the underlying typescript-formatter has been superseded by prettier and deprecated by its author.

npm install gulp-typescript-formatter
INSTALL
IMPORT
SIG · GULP-TYPESCRIPT-FO
G
gulp-typescript-formatter
devopsjavascriptv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import tsfmt from 'gulp-typescript-formatter'
const tsfmt = require('gulp-typescript-formatter')
Default export is the plugin function; works with both ESM and CJS, but ESM is preferred.
gulp-typescript-formatter (CommonJS)
const typescriptFormatter = require('gulp-typescript-formatter')
const { typescriptFormatter } = require('gulp-typescript-formatter')
The package exports a single function; named destructuring will fail.
typescript-formatter RootOptions
import { RootOptions } from 'typescript-formatter'
Options are defined in the typescript-formatter package, not in gulp-typescript-formatter.

Basic Gulp task to format all TypeScript files in src/ using tslint, tsfmt, and editorconfig settings.

const gulp = require('gulp'); const typescriptFormatter = require('gulp-typescript-formatter'); gulp.task('format', function () { return gulp.src('src/**/*.ts') .pipe(typescriptFormatter({ baseDir: '.', tslint: true, tsfmt: true, editorconfig: true })) .pipe(gulp.dest('.')); });
Debug
Known issues
deprecatedThe underlying typescript-formatter package is deprecated (last updated 2019). Consider using prettier instead.
fix
Switch to gulp-prettier or gulp-format with prettier.
affects: >=0.0.0
gotchaOptions object is passed directly to typescript-formatter; refer to its RootOptions interface.
fix
Check https://github.com/vvakame/typescript-formatter for valid options.
affects: >=0.0.0
gotchaThis plugin does not support the latest TypeScript syntax (e.g., decorators, namespace). Use prettier for modern TS.
fix
Replace with gulp-prettier.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'typescript-formatter'
Missing peer dependency typescript-formatter.
fix
Run: npm install --save-dev typescript-formatter
TypeError: typescriptFormatter is not a function
Incorrect import: using named destructuring on CommonJS require.
fix
Use const typescriptFormatter = require('gulp-typescript-formatter');
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
typescript-formatterrequiredpeer dependency providing the actual formatting logic; must be installed separately
Agent activity
4 hits · last 30 days
node
4
Resources
gulp-typescript-formatter — npm install gulp-typescript-formatter · libregistry