Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix lint

Chocobozzzd412e80e5f74
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index a7528328ad..b49d37d4e7 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 7ebbf4d6eb..9e233a8cc3 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 47f0243e7e..fbc3bdcc2c 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 ade72b62f0..b410b0c180 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 f46682824b..08e371a027 100644
--- a/server/lib/request/abstract-request-scheduler.ts
+++ b/server/lib/request/abstract-request-scheduler.ts
@@ -146,7 +146,7 @@ abstract class AbstractRequestScheduler <T> {
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 a54efc111b..24ee59d298 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<RequestsVideoQa
default:
logger.error('Unknown request video QADU type %s.', request.type)
- return
+ return undefined
}
// Do not forget the uuid so the remote pod can identify the video
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts
index 8a9b383b88..a032d14ce5 100644
--- a/server/middlewares/validators/videos.ts
+++ b/server/middlewares/validators/videos.ts
@@ -79,7 +79,7 @@ const videosAddValidator = [
})
.then(duration => {
// 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 4b5ae08c20..dd457bb006 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 b99b5eda8b..b46b90c146 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 95b202e2f6..601b527ef7 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 6e982ca85d..9acb246304 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"],