ActivityPub-federated video streaming platform using P2P directly in your web browser
Use single quotes in server/ and update eslint rules
Florent7e0f50d6e0c7
diff --git a/.eslintrc.json b/.eslintrc.jsonindex c2dd2fc446..770913bf10 100644--- a/.eslintrc.json+++ b/.eslintrc.json@@ -38,6 +38,7 @@}}],+ "quotes": "off","@typescript-eslint/indent": ["error",2,@@ -78,7 +79,14 @@"@typescript-eslint/dot-notation": "off","@typescript-eslint/method-signature-style": "off","@typescript-eslint/no-base-to-string": "off",- "@typescript-eslint/quotes": "off",+ "@typescript-eslint/quotes": [+ "error",+ "single",+ {+ "avoidEscape": true,+ "allowTemplateLiterals": true+ }+ ],"@typescript-eslint/no-var-requires": "off","@typescript-eslint/explicit-function-return-type": "off","@typescript-eslint/promise-function-async": "off",diff --git a/server/lib/activitypub/activity.ts b/server/lib/activitypub/activity.tsindex ba2967ce97..1f6ec221e5 100644--- a/server/lib/activitypub/activity.ts+++ b/server/lib/activitypub/activity.ts@@ -1,4 +1,4 @@-import { ActivityType } from "@shared/models"+import { ActivityType } from '@shared/models'function getAPId (object: string | { id: string }) {if (typeof object === 'string') return objectdiff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.tsindex 1e839d577f..a44fcb854d 100644--- a/server/middlewares/validators/config.ts+++ b/server/middlewares/validators/config.ts@@ -30,7 +30,7 @@ const customConfigUpdateValidator = [body('signup.enabled').isBoolean().withMessage('Should have a valid signup enabled boolean'),body('signup.limit').isInt().withMessage('Should have a valid signup limit'),body('signup.requiresEmailVerification').isBoolean().withMessage('Should have a valid requiresEmailVerification boolean'),- body('signup.minimumAge').isInt().withMessage("Should have a valid minimum age required"),+ body('signup.minimumAge').isInt().withMessage('Should have a valid minimum age required'),body('admin.email').isEmail().withMessage('Should have a valid administrator email'),body('contactForm.enabled').isBoolean().withMessage('Should have a valid contact form enabled boolean'),@@ -38,7 +38,7 @@ const customConfigUpdateValidator = [body('user.videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid video quota'),body('user.videoQuotaDaily').custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily video quota'),- body('videoChannels.maxPerUser').isInt().withMessage("Should have a valid maximum amount of video channels per user"),+ body('videoChannels.maxPerUser').isInt().withMessage('Should have a valid maximum amount of video channels per user'),body('transcoding.enabled').isBoolean().withMessage('Should have a valid transcoding enabled boolean'),body('transcoding.allowAdditionalExtensions').isBoolean().withMessage('Should have a valid additional extensions boolean'),diff --git a/server/tests/api/moderation/abuses.ts b/server/tests/api/moderation/abuses.tsindex 568fbefcf0..0a656b41f3 100644--- a/server/tests/api/moderation/abuses.ts+++ b/server/tests/api/moderation/abuses.ts@@ -260,12 +260,12 @@ describe('Test abuses', function () {await waitJobs(servers)const body = await commands[1].getAdminList()- expect(body.total).to.equal(2, "wrong number of videos returned")- expect(body.data).to.have.lengthOf(2, "wrong number of videos returned")+ expect(body.total).to.equal(2, 'wrong number of videos returned')+ expect(body.data).to.have.lengthOf(2, 'wrong number of videos returned')const abuse = body.data[0]- expect(abuse.id).to.equal(abuseServer2.id, "wrong origin server id for first video")- expect(abuse.video.id).to.equal(abuseServer2.video.id, "wrong video id")+ expect(abuse.id).to.equal(abuseServer2.id, 'wrong origin server id for first video')+ expect(abuse.video.id).to.equal(abuseServer2.video.id, 'wrong video id')expect(abuse.video.channel).to.existexpect(abuse.video.deleted).to.be.true})@@ -299,13 +299,13 @@ describe('Test abuses', function () {const abuseVideo3 = body.data.find(a => a.video.id === video3Id)expect(abuseVideo3).to.not.be.undefined- expect(abuseVideo3.video.countReports).to.equal(1, "wrong reports count for video 3")- expect(abuseVideo3.video.nthReport).to.equal(1, "wrong report position in report list for video 3")- expect(abuseVideo3.countReportsForReportee).to.equal(1, "wrong reports count for reporter on video 3 abuse")- expect(abuseVideo3.countReportsForReporter).to.equal(3, "wrong reports count for reportee on video 3 abuse")+ expect(abuseVideo3.video.countReports).to.equal(1, 'wrong reports count for video 3')+ expect(abuseVideo3.video.nthReport).to.equal(1, 'wrong report position in report list for video 3')+ expect(abuseVideo3.countReportsForReportee).to.equal(1, 'wrong reports count for reporter on video 3 abuse')+ expect(abuseVideo3.countReportsForReporter).to.equal(3, 'wrong reports count for reportee on video 3 abuse')const abuseServer1 = abuses.find(a => a.video.id === servers[0].store.videoCreated.id)- expect(abuseServer1.countReportsForReportee).to.equal(3, "wrong reports count for reporter on video 1 abuse")+ expect(abuseServer1.countReportsForReportee).to.equal(3, 'wrong reports count for reporter on video 1 abuse')}})@@ -327,7 +327,7 @@ describe('Test abuses', function () {{const abuse = body.data.find(a => a.id === createRes.abuse.id)expect(abuse.reason).to.equals(reason5)- expect(abuse.predefinedReasons).to.deep.equals(predefinedReasons5, "predefined reasons do not match the one reported")+ expect(abuse.predefinedReasons).to.deep.equals(predefinedReasons5, 'predefined reasons do not match the one reported')expect(abuse.video.startAt).to.equal(1, "starting timestamp doesn't match the one reported")expect(abuse.video.endAt).to.equal(5, "ending timestamp doesn't match the one reported")}diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.tsindex c7331d544a..67a9ed8e0e 100644--- a/server/tests/feeds/feeds.ts+++ b/server/tests/feeds/feeds.ts@@ -433,7 +433,7 @@ describe('Test syndication feeds', () => {{const body = await servers[0].subscriptions.listVideos({ token: userAccessToken })- expect(body.total).to.equal(2, "there should be 2 videos part of the subscription")+ expect(body.total).to.equal(2, 'there should be 2 videos part of the subscription')const query = { accountId: userAccountId, token: userFeedToken }const json = await servers[0].feed.getJSON({ feed: 'subscriptions', query, ignoreCache: true })diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.tsindex 661a4cf35c..e2f80c703c 100644--- a/server/tools/peertube-import-videos.ts+++ b/server/tools/peertube-import-videos.ts@@ -37,7 +37,7 @@ command.option('--last <last>', 'Process last n elements of returned playlist').option('--wait-interval <waitInterval>', 'Duration between two video imports (in seconds)', convertIntoMs).option('-T, --tmpdir <tmpdir>', 'Working directory', __dirname)- .usage("[global options] [ -- youtube-dl options]")+ .usage('[global options] [ -- youtube-dl options]').parse(process.argv)const options = command.opts()@@ -97,7 +97,7 @@ async function run (url: string, username: string, password: string) {for (const [ index, info ] of infoArray.entries()) {try {if (index > 0 && options.waitInterval && !skipInterval) {- log.info("Wait for %d seconds before continuing.", options.waitInterval / 1000)+ log.info('Wait for %d seconds before continuing.', options.waitInterval / 1000)await wait(options.waitInterval)}