]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix lint
authorChocobozzz <me@florianbigard.com>
Wed, 13 Jul 2022 09:58:01 +0000 (11:58 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 13 Jul 2022 10:14:26 +0000 (12:14 +0200)
44 files changed:
.eslintrc.json
client/.eslintrc.json
package.json
scripts/benchmark.ts
server/controllers/api/users/index.ts
server/controllers/api/videos/import.ts
server/controllers/api/videos/view.ts
server/controllers/services.ts
server/lib/activitypub/actors/shared/url-to-object.ts
server/lib/auth/external-auth.ts
server/lib/blocklist.ts
server/lib/moderation.ts
server/lib/opentelemetry/tracing.ts
server/lib/plugins/plugin-manager.ts
server/lib/plugins/video-constant-manager-factory.ts
server/lib/user.ts
server/lib/video.ts
server/models/actor/actor-follow.ts
server/models/oauth/oauth-client.ts
server/models/redundancy/video-redundancy.ts
server/models/user/user.ts
server/models/video/video-playlist.ts
server/models/video/video.ts
server/tests/api/check-params/abuses.ts
server/tests/api/check-params/live.ts
server/tests/api/check-params/users-admin.ts
server/tests/api/check-params/users.ts
server/tests/api/check-params/video-blacklist.ts
server/tests/api/check-params/video-imports.ts
server/tests/api/check-params/video-playlists.ts
server/tests/api/check-params/videos.ts
server/tests/api/check-params/views.ts
server/tests/api/notifications/admin-notifications.ts
server/tests/api/notifications/notifications-api.ts
server/tests/api/redundancy/redundancy.ts
server/tests/api/search/search-videos.ts
server/tests/api/server/handle-down.ts
server/tests/api/videos/video-nsfw.ts
server/tests/plugins/filter-hooks.ts
server/tests/shared/notifications.ts
shared/server-commands/requests/requests.ts
shared/server-commands/search/search-command.ts
shared/server-commands/users/login-command.ts
yarn.lock

index dd3821398021703a3e9a576c6f561ed012ca849a..c2dd2fc446c9c7483d6b26af20dc40af2e711c4b 100644 (file)
@@ -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": [
index 021de0118183395d2a9a08e1638c66d47e74a706..f9326acc86025cc586e730e8ff31c313c63cfffb 100644 (file)
@@ -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",
           {
index c9a5edb52678a2b19dc6fdadf0f388ff2ff58e45..add7b122ab40e0c6c92bde15c874e28a2372bb07 100644 (file)
     "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",
index 4a414a2fa1e734af0dc686e064235edc09db1896..f7f9ad1bf6c600ccb0da1d164c5e747683b7144e 100644 (file)
@@ -208,7 +208,7 @@ function runBenchmark (options: {
   return new Promise((res, rej) => {
     autocannon({
       url: server.url + path,
-      method: method,
+      method,
       body,
       connections: 20,
       headers,
index 46e80d56d17e4a148a6fc0c142a11cf89614d75b..7761ba6020c10ae941bd283c1019498d4bfb3909 100644 (file)
@@ -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
   })
index 44283e26674e4525127013127b37dcd8cf6c1734..7576e77e73808bc052ea82811dfecbabfee18937 100644 (file)
@@ -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
index dee1ec67cb3ac7fed158f8dc96ae3fc81429c9fc..a747fa334fcaf4521566f99d0ebd804e1cdcb9a6 100644 (file)
@@ -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)
index 70d08ab69088f187eeaff5771e092da8bc8245fe..cabcbc00b440efb8a2f0d18156561f3c3dbccc22 100644 (file)
@@ -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',
index 7bc37f1ff83ca18b45caf035141bf6f83eb2d3e4..12a121725bba8fa5014e747f92fed16e11fa2c00 100644 (file)
@@ -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 {
index 80f5064b68cd3764b28868efb166553fec843655..0531128016afbe7b8e8b51858daf80aa433328ce 100644 (file)
@@ -166,7 +166,7 @@ function getBypassFromExternalAuth (username: string, externalAuthToken: string)
   return {
     bypass: true,
     pluginName: npmName,
-    authName: authName,
+    authName,
     user
   }
 }
index 98273a6ea0de237842c3218eace53415a3df49ae..a11b717b548414daa8478fcd3ed6d73b5a4b2176 100644 (file)
@@ -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 })
   })
 }
index c2565f86769601ab7d2bcfcb546252147b759d8d..c23f5b6a6cd51780cd98d8127b3ac64348bec958 100644 (file)
@@ -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
index 5358d04ded320a87ea31ce690dc015e4cf31b3e9..23764e9e49c01788e769e034e860579d395a6ca0 100644 (file)
@@ -47,7 +47,7 @@ function registerOpentelemetryTracing () {
   })
 
   registerInstrumentations({
-    tracerProvider: tracerProvider,
+    tracerProvider,
     instrumentations: [
       new PgInstrumentation({
         enhancedDatabaseReporting: true
index 1305f660ff3333ff1c0feec816dd8770c51a85c6..c21ebd0c5d83499a9129d3de607781a672b37380 100644 (file)
@@ -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
index f04dde29f2ed5f3c05047e66cc23076d211b9193..5f7edfbe2f8a1d7ff547b023d74830704839871a 100644 (file)
@@ -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
index 586fd0f128499929d45339af0fb569a790ec0049..f4ffae0e4178fa088d2e98fb3428d64189101977 100644 (file)
@@ -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'
   })
index 86718abbe85c3f2e3c03a9d3792ec5f21dff6977..b843b11bc4d65844710ac63a1eee2d595592293a 100644 (file)
@@ -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) {
index af1d85e9f8befbb44573edd2a8076452c898d83f..8870bec05b17ae8fcd0ebf3f55a96b025e71ccd9 100644 (file)
@@ -218,7 +218,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo
     const query = {
       where: {
         actorId,
-        targetActorId: targetActorId
+        targetActorId
       },
       include: [
         {
@@ -372,7 +372,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo
   }) {
     const { actorId, start, count, sort } = options
     const where = {
-      actorId: actorId
+      actorId
     }
 
     if (options.search) {
index 860fa6f53219a8465c05295d76c41cbf52da974a..457e846137f94a79f8a8dad70ae3c6e6e7e46a10 100644 (file)
@@ -53,8 +53,8 @@ export class OAuthClientModel extends Model<Partial<AttributesOnly<OAuthClientMo
   static getByIdAndSecret (clientId: string, clientSecret: string) {
     const query = {
       where: {
-        clientId: clientId,
-        clientSecret: clientSecret
+        clientId,
+        clientSecret
       }
     }
 
index 6f84747da7a69aa05a9741d4942c20bd3fad5307..b363afb2864f4a6621edfdcb787ec3de1e9c3346 100644 (file)
@@ -530,7 +530,7 @@ export class VideoRedundancyModel extends Model<Partial<AttributesOnly<VideoRedu
     }
 
     if (strategy) {
-      Object.assign(redundancyWhere, { strategy: strategy })
+      Object.assign(redundancyWhere, { strategy })
     }
 
     const videoFilterWhere = {
index dc260e512e2eec609473f506440cd3fc17579420..3fd359359c0364e327ab2db691511753206da49a 100644 (file)
@@ -488,9 +488,7 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> {
     }
 
     if (blocked !== undefined) {
-      Object.assign(where, {
-        blocked: blocked
-      })
+      Object.assign(where, { blocked })
     }
 
     const query: FindOptions = {
index 00cca054981db54e435fb12f90dace0df39fbf38..81ce3dc9eae2485941898cbc2430f1fb420a2efc 100644 (file)
@@ -423,7 +423,7 @@ export class VideoPlaylistModel extends Model<Partial<AttributesOnly<VideoPlayli
     ]).then(([ count, rows ]) => ({ total: count, data: rows }))
   }
 
-  static searchForApi (options: Pick<AvailableForListOptions, 'followerActorId' | 'search'| 'host'| 'uuids'> & {
+  static searchForApi (options: Pick<AvailableForListOptions, 'followerActorId' | 'search' | 'host' | 'uuids'> & {
     start: number
     count: number
     sort: string
index cdc1137be3af57190e3edda95acdc8e9f591297d..53328d31178eaa195492060337e9422a95c0f436 100644 (file)
@@ -949,7 +949,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
       const total = totalVideos + totalVideoShares
       return {
         data: rows,
-        total: total
+        total
       }
     })
   }
index bc2cc640fcdb8285020ea86c5648f95a93a7e667..7d8347412b077bef8cbb4c184742a630a7f270a3 100644 (file)
@@ -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 () {
index 29f847e51e1a0113b8f4f844aaac33401b1ddc7f..b092f16f9647122575cd236cbfe28d83506ca174 100644 (file)
@@ -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 })
 
     {
index d8353f83bd899ccfcbdd08f477187962cb561529..716c22556a8560c7e8ecc515e760c8fdd74ed8b6 100644 (file)
@@ -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
index 84254945c339e068e2f4d8244daa1d735d556215..4c4f54958483e6f99537f7562e92767995acb9cf 100644 (file)
@@ -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
       })
     })
index 1aab608268a31663914d69e00a8dfa655772339b..0ec3f49d5064ee611ca00460bb7a0804cbc75cfa 100644 (file)
@@ -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 })
     }
 
index da9d0826a1729b1475a168fdc38031c0717472aa..4439810e82cef7d75cf574f34a94a26fb130bced 100644 (file)
@@ -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 })
 
     {
index 4b17ce7db6114eb2fb44f757149c46258b66f6d6..8db91a3f9821a6f1eddfbf70c45cbf226fe43d54 100644 (file)
@@ -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 () {
index 5ff51d1ff46f8055ae054669bf88d448fb2df948..e5c9b90c40651aafd2da5dd6ebe85898078dbc1f 100644 (file)
@@ -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()
       }
     })
index 8f1fa796bc1487db334fbce5c0e6e20c33a7320d..9bf1ef6c3cf3f4a5312a5ead2a09382410c42de5 100644 (file)
@@ -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
       })
index f037e7aaec29ceb2487b6b7da7e0862328e5ed77..1501f9227a0b5433eabb9e2894de75354f572383 100644 (file)
@@ -51,7 +51,7 @@ describe('Test admin notifications', function () {
     adminNotifications = res.adminNotifications
 
     baseParams = {
-      server: server,
+      server,
       emails,
       socketNotifications: adminNotifications,
       token: server.accessToken
index 78864c8a04f8f9782e67c80798e14fcc63825ba3..e2b4777c0ef71876a3847f018301a3a3f11b1847 100644 (file)
@@ -99,7 +99,7 @@ describe('Test notifications API', function () {
 
     before(() => {
       baseParams = {
-        server: server,
+        server,
         emails,
         socketNotifications: userNotifications,
         token: userToken
index 0f7ffcb4c7ef950af63b13f93e6e67859250a2ae..9887d25354a89d1101b7af428e40e40f020a2693 100644 (file)
@@ -53,7 +53,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition
     strategies.push(
       {
         min_lifetime: '1 hour',
-        strategy: strategy,
+        strategy,
         size: '400KB',
 
         ...additionalParams
index ff4c3c161897699469134979f00aec247f058d95..b1ebc855c65e5ad92c93dca9807be44f1deff6c2 100644 (file)
@@ -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)
 
index 3dcd076f599df0be92bea341f95374e872129b62..c45d3ea60d7c1ba79f88033064ee17dabc9a6a17 100644 (file)
@@ -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'
index 99ea67a0fe1644d61ec31f6c2889adc84779f58e..34713025df3c25530da264a71125947d1593046b 100644 (file)
@@ -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 })
 
index e0f25ca26429245d8cbd220d05886e93a505f39a..b1f83d201750b208f38d4d57f0a9fc3ff0d2b7a6 100644 (file)
@@ -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 }))
         }
 
index 09bc8da03ac88ca6d25fe60b5a8c8301cdde2560..ee15e2b098da2b2ac91ab4c59d06100173ca9400 100644 (file)
@@ -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)
index 95e4fe6b1eb0cb1e69cded49ad33d8389b68832e..a08a6e0b9b5b7fe3a7ab070b203fd7eeadedb42e 100644 (file)
@@ -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'
   })
 }
index 0fbbcd6efe41e68fadade9754407860232a092e6..a5b498b664d3fef49c98072a65bec22299548e21 100644 (file)
@@ -74,7 +74,7 @@ export class SearchCommand extends AbstractCommand {
       ...options,
 
       search: {
-        search: search,
+        search,
         sort: sort ?? '-publishedAt'
       }
     })
index 143f72a59c0e994bebfe4d4115257b26819afce7..54070e4261f6642f69c23187175ca909853a436b 100644 (file)
@@ -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',
index e73c78f63ba0e6c4c839d941701ed7b4ea1ebaf3..2a42fc4287c7f276003db2b321141d798aa668b5 100644 (file)
--- 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==