From ba2684ceddf9b76312635b9cddc6bf6975ce436a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 13 Jul 2022 11:58:01 +0200 Subject: Fix lint --- .eslintrc.json | 4 ++- client/.eslintrc.json | 2 +- package.json | 1 + scripts/benchmark.ts | 2 +- server/controllers/api/users/index.ts | 2 +- server/controllers/api/videos/import.ts | 2 +- server/controllers/api/videos/view.ts | 2 +- server/controllers/services.ts | 2 +- .../lib/activitypub/actors/shared/url-to-object.ts | 4 +-- server/lib/auth/external-auth.ts | 2 +- server/lib/blocklist.ts | 2 +- server/lib/moderation.ts | 4 +-- server/lib/opentelemetry/tracing.ts | 2 +- server/lib/plugins/plugin-manager.ts | 2 +- .../lib/plugins/video-constant-manager-factory.ts | 2 +- server/lib/user.ts | 6 ++--- server/lib/video.ts | 4 +-- server/models/actor/actor-follow.ts | 4 +-- server/models/oauth/oauth-client.ts | 4 +-- server/models/redundancy/video-redundancy.ts | 2 +- server/models/user/user.ts | 4 +-- server/models/video/video-playlist.ts | 2 +- server/models/video/video.ts | 2 +- server/tests/api/check-params/abuses.ts | 6 ++--- server/tests/api/check-params/live.ts | 2 +- server/tests/api/check-params/users-admin.ts | 2 +- server/tests/api/check-params/users.ts | 2 +- server/tests/api/check-params/video-blacklist.ts | 4 +-- server/tests/api/check-params/video-imports.ts | 2 +- server/tests/api/check-params/video-playlists.ts | 2 +- server/tests/api/check-params/videos.ts | 2 +- server/tests/api/check-params/views.ts | 12 ++++----- .../tests/api/notifications/admin-notifications.ts | 2 +- .../tests/api/notifications/notifications-api.ts | 2 +- server/tests/api/redundancy/redundancy.ts | 2 +- server/tests/api/search/search-videos.ts | 6 ++--- server/tests/api/server/handle-down.ts | 2 +- server/tests/api/videos/video-nsfw.ts | 2 +- server/tests/plugins/filter-hooks.ts | 4 +-- server/tests/shared/notifications.ts | 2 +- shared/server-commands/requests/requests.ts | 2 +- shared/server-commands/search/search-command.ts | 2 +- shared/server-commands/users/login-command.ts | 2 +- yarn.lock | 31 +++++++++++++++++++++- 44 files changed, 93 insertions(+), 63 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index dd3821398..c2dd2fc44 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -43,7 +43,9 @@ 2, { "SwitchCase": 1, - "MemberExpression": "off" + "MemberExpression": "off", + // https://github.com/eslint/eslint/issues/15299 + "ignoredNodes": ["PropertyDefinition"] } ], "@typescript-eslint/consistent-type-assertions": [ diff --git a/client/.eslintrc.json b/client/.eslintrc.json index 021de0118..f9326acc8 100644 --- a/client/.eslintrc.json +++ b/client/.eslintrc.json @@ -29,7 +29,7 @@ "arrow-body-style": "off", "import/no-webpack-loader-syntax": "off", "no-underscore-dangle": "off", - "node/no-callback-literal": "off", + "n/no-callback-literal": "off", "@angular-eslint/component-selector": [ "error", { diff --git a/package.json b/package.json index c9a5edb52..add7b122a 100644 --- a/package.json +++ b/package.json @@ -220,6 +220,7 @@ "eslint": "^8.0.0", "eslint-config-standard-with-typescript": "^22.0.0", "eslint-plugin-import": "^2.20.1", + "eslint-plugin-n": "^15.2.4", "eslint-plugin-node": "^11.0.0", "eslint-plugin-promise": "^6.0.0", "fast-xml-parser": "^4.0.0-beta.8", diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts index 4a414a2fa..f7f9ad1bf 100644 --- a/scripts/benchmark.ts +++ b/scripts/benchmark.ts @@ -208,7 +208,7 @@ function runBenchmark (options: { return new Promise((res, rej) => { autocannon({ url: server.url + path, - method: method, + method, body, connections: 20, headers, diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 46e80d56d..7761ba602 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts @@ -226,7 +226,7 @@ async function registerUser (req: express.Request, res: express.Response) { }) const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({ - userToCreate: userToCreate, + userToCreate, userDisplayName: body.displayName || undefined, channelNames: body.channel }) diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 44283e266..7576e77e7 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts @@ -274,7 +274,7 @@ async function buildVideo (channelId: number, body: VideoImportCreate, importDat support: body.support || null, privacy: body.privacy || VideoPrivacy.PRIVATE, duration: 0, // duration will be set by the import job - channelId: channelId, + channelId, originallyPublishedAt: body.originallyPublishedAt ? new Date(body.originallyPublishedAt) : importData.originallyPublishedAt diff --git a/server/controllers/api/videos/view.ts b/server/controllers/api/videos/view.ts index dee1ec67c..a747fa334 100644 --- a/server/controllers/api/videos/view.ts +++ b/server/controllers/api/videos/view.ts @@ -39,7 +39,7 @@ async function viewVideo (req: express.Request, res: express.Response) { }) if (successView) { - Hooks.runAction('action:api.video.viewed', { video: video, ip, req, res }) + Hooks.runAction('action:api.video.viewed', { video, ip, req, res }) } await updateUserHistoryIfNeeded(body, video, res) diff --git a/server/controllers/services.ts b/server/controllers/services.ts index 70d08ab69..cabcbc00b 100644 --- a/server/controllers/services.ts +++ b/server/controllers/services.ts @@ -141,7 +141,7 @@ function buildOEmbed (options: { html, width: embedWidth, height: embedHeight, - title: title, + title, author_name: channel.name, author_url: channel.Actor.url, provider_name: 'PeerTube', diff --git a/server/lib/activitypub/actors/shared/url-to-object.ts b/server/lib/activitypub/actors/shared/url-to-object.ts index 7bc37f1ff..12a121725 100644 --- a/server/lib/activitypub/actors/shared/url-to-object.ts +++ b/server/lib/activitypub/actors/shared/url-to-object.ts @@ -11,12 +11,12 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode: number if (sanitizeAndCheckActorObject(body) === false) { logger.debug('Remote actor JSON is not valid.', { actorJSON: body }) - return { actorObject: undefined, statusCode: statusCode } + return { actorObject: undefined, statusCode } } if (checkUrlsSameHost(body.id, actorUrl) !== true) { logger.warn('Actor url %s has not the same host than its AP id %s', actorUrl, body.id) - return { actorObject: undefined, statusCode: statusCode } + return { actorObject: undefined, statusCode } } return { diff --git a/server/lib/auth/external-auth.ts b/server/lib/auth/external-auth.ts index 80f5064b6..053112801 100644 --- a/server/lib/auth/external-auth.ts +++ b/server/lib/auth/external-auth.ts @@ -166,7 +166,7 @@ function getBypassFromExternalAuth (username: string, externalAuthToken: string) return { bypass: true, pluginName: npmName, - authName: authName, + authName, user } } diff --git a/server/lib/blocklist.ts b/server/lib/blocklist.ts index 98273a6ea..a11b717b5 100644 --- a/server/lib/blocklist.ts +++ b/server/lib/blocklist.ts @@ -8,7 +8,7 @@ function addAccountInBlocklist (byAccountId: number, targetAccountId: number) { return sequelizeTypescript.transaction(async t => { return AccountBlocklistModel.upsert({ accountId: byAccountId, - targetAccountId: targetAccountId + targetAccountId }, { transaction: t }) }) } diff --git a/server/lib/moderation.ts b/server/lib/moderation.ts index c2565f867..c23f5b6a6 100644 --- a/server/lib/moderation.ts +++ b/server/lib/moderation.ts @@ -115,8 +115,8 @@ async function createVideoAbuse (options: { const videoAbuseInstance: MVideoAbuseVideoFull = await VideoAbuseModel.create({ abuseId: abuseInstance.id, videoId: videoInstance.id, - startAt: startAt, - endAt: endAt + startAt, + endAt }, { transaction }) videoAbuseInstance.Video = videoInstance diff --git a/server/lib/opentelemetry/tracing.ts b/server/lib/opentelemetry/tracing.ts index 5358d04de..23764e9e4 100644 --- a/server/lib/opentelemetry/tracing.ts +++ b/server/lib/opentelemetry/tracing.ts @@ -47,7 +47,7 @@ function registerOpentelemetryTracing () { }) registerInstrumentations({ - tracerProvider: tracerProvider, + tracerProvider, instrumentations: [ new PgInstrumentation({ enhancedDatabaseReporting: true diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index 1305f660f..c21ebd0c5 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts @@ -563,7 +563,7 @@ export class PluginManager implements ServerHook { if (!this.hooks[options.target]) this.hooks[options.target] = [] this.hooks[options.target].push({ - npmName: npmName, + npmName, pluginName: plugin.name, handler: options.handler, priority: options.priority || 0 diff --git a/server/lib/plugins/video-constant-manager-factory.ts b/server/lib/plugins/video-constant-manager-factory.ts index f04dde29f..5f7edfbe2 100644 --- a/server/lib/plugins/video-constant-manager-factory.ts +++ b/server/lib/plugins/video-constant-manager-factory.ts @@ -97,7 +97,7 @@ export class VideoConstantManagerFactory { } } - this.updatedVideoConstants[type][npmName].added.push({ key: key, label } as VideoConstant) + this.updatedVideoConstants[type][npmName].added.push({ key, label } as VideoConstant) obj[key] = label return true diff --git a/server/lib/user.ts b/server/lib/user.ts index 586fd0f12..f4ffae0e4 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts @@ -64,8 +64,8 @@ function buildUser (options: { emailVerified, adminFlags, - videoQuota: videoQuota, - videoQuotaDaily: videoQuotaDaily, + videoQuota, + videoQuotaDaily, pluginAuth }) @@ -147,7 +147,7 @@ async function createApplicationActor (applicationId: number) { const accountCreated = await createLocalAccountWithoutKeys({ name: SERVER_ACTOR_NAME, userId: null, - applicationId: applicationId, + applicationId, t: undefined, type: 'Application' }) diff --git a/server/lib/video.ts b/server/lib/video.ts index 86718abbe..b843b11bc 100644 --- a/server/lib/video.ts +++ b/server/lib/video.ts @@ -26,7 +26,7 @@ function buildLocalVideoFromReq (videoInfo: VideoCreate, channelId: number): Fil description: videoInfo.description, support: videoInfo.support, privacy: videoInfo.privacy || VideoPrivacy.PRIVATE, - channelId: channelId, + channelId, originallyPublishedAt: videoInfo.originallyPublishedAt ? new Date(videoInfo.originallyPublishedAt) : null @@ -122,7 +122,7 @@ async function addOptimizeOrMergeAudioJob (options: { async function addTranscodingJob (payload: VideoTranscodingPayload, options: CreateJobOptions = {}) { await VideoJobInfoModel.increaseOrCreate(payload.videoUUID, 'pendingTranscode') - return JobQueue.Instance.createJobWithPromise({ type: 'video-transcoding', payload: payload }, options) + return JobQueue.Instance.createJobWithPromise({ type: 'video-transcoding', payload }, options) } async function getTranscodingJobPriority (user: MUserId) { diff --git a/server/models/actor/actor-follow.ts b/server/models/actor/actor-follow.ts index af1d85e9f..8870bec05 100644 --- a/server/models/actor/actor-follow.ts +++ b/server/models/actor/actor-follow.ts @@ -218,7 +218,7 @@ export class ActorFollowModel extends Model>> { } if (blocked !== undefined) { - Object.assign(where, { - blocked: blocked - }) + Object.assign(where, { blocked }) } const query: FindOptions = { diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.ts index 00cca0549..81ce3dc9e 100644 --- a/server/models/video/video-playlist.ts +++ b/server/models/video/video-playlist.ts @@ -423,7 +423,7 @@ export class VideoPlaylistModel extends Model ({ total: count, data: rows })) } - static searchForApi (options: Pick & { + static searchForApi (options: Pick & { start: number count: number sort: string diff --git a/server/models/video/video.ts b/server/models/video/video.ts index cdc1137be..53328d311 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -949,7 +949,7 @@ export class VideoModel extends Model>> { const total = totalVideos + totalVideoShares return { data: rows, - total: total + total } }) } diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts index bc2cc640f..7d8347412 100644 --- a/server/tests/api/check-params/abuses.ts +++ b/server/tests/api/check-params/abuses.ts @@ -163,7 +163,7 @@ describe('Test abuses API validators', function () { it('Should fail with a wrong video', async function () { const fields = { video: { id: 'blabla' }, reason: 'my super reason' } - await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) + await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) }) it('Should fail with an unknown video', async function () { @@ -179,7 +179,7 @@ describe('Test abuses API validators', function () { it('Should fail with a wrong comment', async function () { const fields = { comment: { id: 'blabla' }, reason: 'my super reason' } - await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) + await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) }) it('Should fail with an unknown comment', async function () { @@ -195,7 +195,7 @@ describe('Test abuses API validators', function () { it('Should fail with a wrong account', async function () { const fields = { account: { id: 'blabla' }, reason: 'my super reason' } - await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) + await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) }) it('Should fail with an unknown account', async function () { diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts index 29f847e51..b092f16f9 100644 --- a/server/tests/api/check-params/live.ts +++ b/server/tests/api/check-params/live.ts @@ -51,7 +51,7 @@ describe('Test video lives API validator', function () { const username = 'user1' const password = 'my super password' - await server.users.create({ username: username, password: password }) + await server.users.create({ username, password }) userAccessToken = await server.login.getAccessToken({ username, password }) { diff --git a/server/tests/api/check-params/users-admin.ts b/server/tests/api/check-params/users-admin.ts index d8353f83b..716c22556 100644 --- a/server/tests/api/check-params/users-admin.ts +++ b/server/tests/api/check-params/users-admin.ts @@ -175,7 +175,7 @@ describe('Test users admin API validators', function () { await makePostBodyRequest({ url: server.url, - path: path, + path, token: server.accessToken, fields, expectedStatus: HttpStatusCode.OK_200 diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 84254945c..4c4f54958 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -163,7 +163,7 @@ describe('Test users API validators', function () { url: server.url, path: registrationPath, token: server.accessToken, - fields: fields, + fields, expectedStatus: HttpStatusCode.NO_CONTENT_204 }) }) diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts index 1aab60826..0ec3f49d5 100644 --- a/server/tests/api/check-params/video-blacklist.ts +++ b/server/tests/api/check-params/video-blacklist.ts @@ -37,14 +37,14 @@ describe('Test video blacklist API validators', function () { { const username = 'user1' const password = 'my super password' - await servers[0].users.create({ username: username, password: password }) + await servers[0].users.create({ username, password }) userAccessToken1 = await servers[0].login.getAccessToken({ username, password }) } { const username = 'user2' const password = 'my super password' - await servers[0].users.create({ username: username, password: password }) + await servers[0].users.create({ username, password }) userAccessToken2 = await servers[0].login.getAccessToken({ username, password }) } diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index da9d0826a..4439810e8 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts @@ -35,7 +35,7 @@ describe('Test video imports API validator', function () { const username = 'user1' const password = 'my super password' - await server.users.create({ username: username, password: password }) + await server.users.create({ username, password }) userAccessToken = await server.login.getAccessToken({ username, password }) { diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts index 4b17ce7db..8db91a3f9 100644 --- a/server/tests/api/check-params/video-playlists.ts +++ b/server/tests/api/check-params/video-playlists.ts @@ -209,7 +209,7 @@ describe('Test video playlists API validator', function () { } } const getUpdate = (params: any, playlistId: number | string) => { - return { ...params, playlistId: playlistId } + return { ...params, playlistId } } it('Should fail with an unauthenticated user', async function () { diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 5ff51d1ff..e5c9b90c4 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts @@ -205,7 +205,7 @@ describe('Test videos API validator', function () { support: 'my super support text', tags: [ 'tag1', 'tag2' ], privacy: VideoPrivacy.PUBLIC, - channelId: channelId, + channelId, originallyPublishedAt: new Date().toISOString() } }) diff --git a/server/tests/api/check-params/views.ts b/server/tests/api/check-params/views.ts index 8f1fa796b..9bf1ef6c3 100644 --- a/server/tests/api/check-params/views.ts +++ b/server/tests/api/check-params/views.ts @@ -64,12 +64,12 @@ describe('Test videos views', function () { }) it('Should fail without token', async function () { - await servers[0].videoStats.getOverallStats({ videoId: videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) + await servers[0].videoStats.getOverallStats({ videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) }) it('Should fail with another token', async function () { await servers[0].videoStats.getOverallStats({ - videoId: videoId, + videoId, token: userAccessToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) @@ -114,7 +114,7 @@ describe('Test videos views', function () { it('Should fail without token', async function () { await servers[0].videoStats.getTimeserieStats({ - videoId: videoId, + videoId, token: null, metric: 'viewers', expectedStatus: HttpStatusCode.UNAUTHORIZED_401 @@ -123,7 +123,7 @@ describe('Test videos views', function () { it('Should fail with another token', async function () { await servers[0].videoStats.getTimeserieStats({ - videoId: videoId, + videoId, token: userAccessToken, metric: 'viewers', expectedStatus: HttpStatusCode.FORBIDDEN_403 @@ -198,7 +198,7 @@ describe('Test videos views', function () { it('Should fail without token', async function () { await servers[0].videoStats.getRetentionStats({ - videoId: videoId, + videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) @@ -206,7 +206,7 @@ describe('Test videos views', function () { it('Should fail with another token', async function () { await servers[0].videoStats.getRetentionStats({ - videoId: videoId, + videoId, token: userAccessToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) diff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.ts index f037e7aae..1501f9227 100644 --- a/server/tests/api/notifications/admin-notifications.ts +++ b/server/tests/api/notifications/admin-notifications.ts @@ -51,7 +51,7 @@ describe('Test admin notifications', function () { adminNotifications = res.adminNotifications baseParams = { - server: server, + server, emails, socketNotifications: adminNotifications, token: server.accessToken diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts index 78864c8a0..e2b4777c0 100644 --- a/server/tests/api/notifications/notifications-api.ts +++ b/server/tests/api/notifications/notifications-api.ts @@ -99,7 +99,7 @@ describe('Test notifications API', function () { before(() => { baseParams = { - server: server, + server, emails, socketNotifications: userNotifications, token: userToken diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index 0f7ffcb4c..9887d2535 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts @@ -53,7 +53,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition strategies.push( { min_lifetime: '1 hour', - strategy: strategy, + strategy, size: '400KB', ...additionalParams diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index ff4c3c161..b1ebc855c 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts @@ -106,7 +106,7 @@ describe('Test videos search', function () { licence: 2, language: 'en' } - await server.videos.upload({ attributes: attributes }) + await server.videos.upload({ attributes }) await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) } @@ -119,7 +119,7 @@ describe('Test videos search', function () { licence: 3, language: 'pl' } - await server.videos.upload({ attributes: attributes }) + await server.videos.upload({ attributes }) } { @@ -210,7 +210,7 @@ describe('Test videos search', function () { const search = { categoryOneOf: [ 3 ] } - const body = await command.advancedVideoSearch({ search: search }) + const body = await command.advancedVideoSearch({ search }) expect(body.total).to.equal(1) diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts index 3dcd076f5..c45d3ea60 100644 --- a/server/tests/api/server/handle-down.ts +++ b/server/tests/api/server/handle-down.ts @@ -162,7 +162,7 @@ describe('Test handle downs', function () { for (const state of states) { const body = await servers[0].jobs.list({ - state: state, + state, start: 0, count: 50, sort: '-createdAt' diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts index 99ea67a0f..34713025d 100644 --- a/server/tests/api/videos/video-nsfw.ts +++ b/server/tests/api/videos/video-nsfw.ts @@ -136,7 +136,7 @@ describe('Test video NSFW policy', function () { it('Should create a user having the default nsfw policy', async function () { const username = 'user1' const password = 'my super password' - await server.users.create({ username: username, password: password }) + await server.users.create({ username, password }) userAccessToken = await server.login.getAccessToken({ username, password }) diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index e0f25ca26..b1f83d201 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts @@ -395,7 +395,7 @@ describe('Test plugin filter hooks', function () { const uuids: string[] = [] for (const name of [ 'bad torrent', 'bad file', 'bad playlist file' ]) { - const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid + const uuid = (await servers[0].videos.quickUpload({ name })).uuid uuids.push(uuid) } @@ -446,7 +446,7 @@ describe('Test plugin filter hooks', function () { for (const name of [ 'bad embed', 'good embed' ]) { { - const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid + const uuid = (await servers[0].videos.quickUpload({ name })).uuid embedVideos.push(await servers[0].videos.get({ id: uuid })) } diff --git a/server/tests/shared/notifications.ts b/server/tests/shared/notifications.ts index 09bc8da03..ee15e2b09 100644 --- a/server/tests/shared/notifications.ts +++ b/server/tests/shared/notifications.ts @@ -780,7 +780,7 @@ async function checkNotification (options: CheckerBaseParams & { const check = options.check || { web: true, mail: true } if (check.web) { - const notification = await server.notifications.getLatest({ token: token }) + const notification = await server.notifications.getLatest({ token }) if (notification || checkType !== 'absence') { notificationChecker(notification, checkType) diff --git a/shared/server-commands/requests/requests.ts b/shared/server-commands/requests/requests.ts index 95e4fe6b1..a08a6e0b9 100644 --- a/shared/server-commands/requests/requests.ts +++ b/shared/server-commands/requests/requests.ts @@ -52,7 +52,7 @@ function makeActivityPubGetRequest (url: string, path: string, expectedStatus = return makeGetRequest({ url, path, - expectedStatus: expectedStatus, + expectedStatus, accept: 'application/activity+json,text/html;q=0.9,\\*/\\*;q=0.8' }) } diff --git a/shared/server-commands/search/search-command.ts b/shared/server-commands/search/search-command.ts index 0fbbcd6ef..a5b498b66 100644 --- a/shared/server-commands/search/search-command.ts +++ b/shared/server-commands/search/search-command.ts @@ -74,7 +74,7 @@ export class SearchCommand extends AbstractCommand { ...options, search: { - search: search, + search, sort: sort ?? '-publishedAt' } }) diff --git a/shared/server-commands/users/login-command.ts b/shared/server-commands/users/login-command.ts index 143f72a59..54070e426 100644 --- a/shared/server-commands/users/login-command.ts +++ b/shared/server-commands/users/login-command.ts @@ -60,7 +60,7 @@ export class LoginCommand extends AbstractCommand { const body = { client_id: this.server.store.client.id, client_secret: this.server.store.client.secret, - username: username, + username, response_type: 'code', grant_type: 'password', scope: 'upload', diff --git a/yarn.lock b/yarn.lock index e73c78f63..2a42fc428 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3157,6 +3157,13 @@ bufrw@^1.3.0: hexer "^1.5.0" xtend "^4.0.0" +builtins@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-5.0.1.tgz#87f6db9ab0458be728564fa81d876d8d74552fa9" + integrity sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ== + dependencies: + semver "^7.0.0" + bull@^4.1.0: version "4.8.4" resolved "https://registry.yarnpkg.com/bull/-/bull-4.8.4.tgz#c538610492050d5160dbd9180704145f135a0aa9" @@ -4350,6 +4357,14 @@ eslint-plugin-es@^3.0.0: eslint-utils "^2.0.0" regexpp "^3.0.0" +eslint-plugin-es@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz#f0822f0c18a535a97c3e714e89f88586a7641ec9" + integrity sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ== + dependencies: + eslint-utils "^2.0.0" + regexpp "^3.0.0" + eslint-plugin-import@^2.20.1: version "2.26.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" @@ -4369,6 +4384,20 @@ eslint-plugin-import@^2.20.1: resolve "^1.22.0" tsconfig-paths "^3.14.1" +eslint-plugin-n@^15.2.4: + version "15.2.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-n/-/eslint-plugin-n-15.2.4.tgz#d62021a0821ae650701ed459756aaf478a9b6056" + integrity sha512-tjnVMv2fiXYMnuiIFI8QMtyUFI42SckEEWvi8h68SWGWshfqO6SSCASy24dGMGAiy7NUk6DZt90DM0iNUsmQ5w== + dependencies: + builtins "^5.0.1" + eslint-plugin-es "^4.1.0" + eslint-utils "^3.0.0" + ignore "^5.1.1" + is-core-module "^2.9.0" + minimatch "^3.1.2" + resolve "^1.10.1" + semver "^7.3.7" + eslint-plugin-node@^11.0.0: version "11.1.0" resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" @@ -8005,7 +8034,7 @@ semver@^6.0.0, semver@^6.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.2, semver@^7.3.5, semver@^7.3.7: +semver@^7.0.0, semver@^7.3.2, semver@^7.3.5, semver@^7.3.7: version "7.3.7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== -- cgit v1.2.3