From d412e80e5f748f92118541a5334c14ebd4a90881 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 25 Oct 2017 16:52:01 +0200 Subject: [PATCH] Fix lint --- server/controllers/api/users.ts | 2 +- server/controllers/api/videos/index.ts | 2 +- server/helpers/peertube-crypto.ts | 4 ++-- server/initializers/database.ts | 2 +- server/lib/request/abstract-request-scheduler.ts | 2 +- server/lib/request/request-video-qadu-scheduler.ts | 2 +- server/middlewares/validators/videos.ts | 2 +- server/models/video/video-interface.ts | 1 - server/tests/api/check-params/video-channels.ts | 1 - server/tests/api/video-channels.ts | 2 -- tslint.json | 1 + 11 files changed, 9 insertions(+), 12 deletions(-) diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts index a7528328a..b49d37d4e 100644 --- a/server/controllers/api/users.ts +++ b/server/controllers/api/users.ts @@ -196,7 +196,7 @@ async function updateMe (req: express.Request, res: express.Response, next: expr await user.save() - return await res.sendStatus(204) + return res.sendStatus(204) } async function updateUser (req: express.Request, res: express.Response, next: express.NextFunction) { diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 7ebbf4d6e..9e233a8cc 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -41,7 +41,7 @@ import { getVideoFileHeight, resetSequelizeInstance } from '../../../helpers' -import { TagInstance, VideoInstance } from '../../../models' +import { VideoInstance } from '../../../models' import { VideoCreate, VideoUpdate } from '../../../../shared' import { abuseVideoRouter } from './abuse' diff --git a/server/helpers/peertube-crypto.ts b/server/helpers/peertube-crypto.ts index 47f0243e7..fbc3bdcc2 100644 --- a/server/helpers/peertube-crypto.ts +++ b/server/helpers/peertube-crypto.ts @@ -58,7 +58,7 @@ async function sign (data: string|Object) { sign.update(dataString, 'utf8') const myKey = await getMyPrivateCert() - return await sign.sign(myKey, SIGNATURE_ENCODING) + return sign.sign(myKey, SIGNATURE_ENCODING) } function comparePassword (plainPassword: string, hashPassword: string) { @@ -68,7 +68,7 @@ function comparePassword (plainPassword: string, hashPassword: string) { async function createCertsIfNotExist () { const exist = await certsExist() if (exist === true) { - return undefined + return } return await createCerts() diff --git a/server/initializers/database.ts b/server/initializers/database.ts index ade72b62f..b410b0c18 100644 --- a/server/initializers/database.ts +++ b/server/initializers/database.ts @@ -96,7 +96,7 @@ database.init = async (silent: boolean) => { if (!silent) logger.info('Database %s is ready.', dbname) - return undefined + return } // --------------------------------------------------------------------------- diff --git a/server/lib/request/abstract-request-scheduler.ts b/server/lib/request/abstract-request-scheduler.ts index f46682824..08e371a02 100644 --- a/server/lib/request/abstract-request-scheduler.ts +++ b/server/lib/request/abstract-request-scheduler.ts @@ -146,7 +146,7 @@ abstract class AbstractRequestScheduler { this.afterRequestsHook() // All the requests were made, we update the pods score - await db.Pod.updatePodsScore(goodPods, badPods) + db.Pod.updatePodsScore(goodPods, badPods) } protected afterRequestHook () { diff --git a/server/lib/request/request-video-qadu-scheduler.ts b/server/lib/request/request-video-qadu-scheduler.ts index a54efc111..24ee59d29 100644 --- a/server/lib/request/request-video-qadu-scheduler.ts +++ b/server/lib/request/request-video-qadu-scheduler.ts @@ -95,7 +95,7 @@ class RequestVideoQaduScheduler extends AbstractRequestScheduler { // Previous test failed, abort - if (duration === undefined) return + if (duration === undefined) return undefined if (!isVideoDurationValid('' + duration)) { return res.status(400) diff --git a/server/models/video/video-interface.ts b/server/models/video/video-interface.ts index 4b5ae08c2..dd457bb00 100644 --- a/server/models/video/video-interface.ts +++ b/server/models/video/video-interface.ts @@ -1,7 +1,6 @@ import * as Sequelize from 'sequelize' import * as Promise from 'bluebird' -import { AuthorInstance } from './author-interface' import { TagAttributes, TagInstance } from './tag-interface' import { VideoFileAttributes, VideoFileInstance } from './video-file-interface' diff --git a/server/tests/api/check-params/video-channels.ts b/server/tests/api/check-params/video-channels.ts index b99b5eda8..b46b90c14 100644 --- a/server/tests/api/check-params/video-channels.ts +++ b/server/tests/api/check-params/video-channels.ts @@ -1,7 +1,6 @@ /* tslint:disable:no-unused-expression */ import * as request from 'supertest' -import { join } from 'path' import 'mocha' import * as chai from 'chai' const expect = chai.expect diff --git a/server/tests/api/video-channels.ts b/server/tests/api/video-channels.ts index 95b202e2f..601b527ef 100644 --- a/server/tests/api/video-channels.ts +++ b/server/tests/api/video-channels.ts @@ -1,7 +1,5 @@ /* tslint:disable:no-unused-expression */ -import { keyBy } from 'lodash' -import { join } from 'path' import 'mocha' import * as chai from 'chai' const expect = chai.expect diff --git a/tslint.json b/tslint.json index 6e982ca85..9acb24630 100644 --- a/tslint.json +++ b/tslint.json @@ -1,6 +1,7 @@ { "extends": "tslint-config-standard", "rules": { + "await-promise": [true, "Bluebird"], "no-inferrable-types": true, "eofline": true, "indent": ["spaces"],