From f80283a94f4fb08f1df7d2ad95848591420f8478 Mon Sep 17 00:00:00 2001 From: otofune Date: Tue, 7 Nov 2017 09:04:16 +0900 Subject: [PATCH] add 'format' script to use autofix w/ tslint --- gulpfile.ts | 9 +++++++++ package.json | 3 ++- src/file/server.ts | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gulpfile.ts b/gulpfile.ts index 448b6b7fef..04bd2b1c43 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -81,6 +81,15 @@ gulp.task('lint', () => .pipe(tslint.report()) ); +gulp.task('format', () => +gulp.src('./src/**/*.ts') + .pipe(tslint({ + formatter: 'verbose', + fix: true + })) + .pipe(tslint.report()) +); + gulp.task('mocha', () => gulp.src([]) .pipe(mocha({ diff --git a/package.json b/package.json index c384edb22b..1593cd7d00 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "clean": "gulp clean", "cleanall": "gulp cleanall", "lint": "gulp lint", - "test": "gulp test" + "test": "gulp test", + "format": "gulp format" }, "devDependencies": { "@types/bcryptjs": "2.4.1", diff --git a/src/file/server.ts b/src/file/server.ts index 375f29487d..39e21d10ec 100644 --- a/src/file/server.ts +++ b/src/file/server.ts @@ -110,7 +110,7 @@ app.get('/:id', async (req, res) => { const buffer = await ((id): Promise => new Promise((resolve, reject) => { const chunks = []; const readableStream = bucket.openDownloadStream(id); - readableStream.on('data', chunk => { + readableStream.on('data', chunk => { chunks.push(chunk); }); readableStream.on('end', () => { @@ -141,7 +141,7 @@ app.get('/:id/:name', async (req, res) => { const buffer = await ((id): Promise => new Promise((resolve, reject) => { const chunks = []; const readableStream = bucket.openDownloadStream(id); - readableStream.on('data', chunk => { + readableStream.on('data', chunk => { chunks.push(chunk); }); readableStream.on('end', () => {