]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Update tsconfig
authorChocobozzz <me@florianbigard.com>
Fri, 3 Jun 2022 14:17:28 +0000 (16:17 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 3 Jun 2022 14:17:28 +0000 (16:17 +0200)
server.ts
server/helpers/audit-logger.ts
tsconfig.base.json

index ad162832bce3f1796fb5eaa535415a521c0cf62c..559327f164b7fc5986b0830510e853c31d91b4bc 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -221,18 +221,18 @@ app.use('/', downloadRouter)
 app.use('/', lazyStaticRouter)
 
 // Client files, last valid routes!
-const cliOptions = cli.opts()
+const cliOptions = cli.opts<{ client: boolean, plugins: boolean }>()
 if (cliOptions.client) app.use('/', clientsRouter)
 
 // ----------- Errors -----------
 
 // Catch unmatched routes
-app.use((req, res: express.Response) => {
+app.use((_req, res: express.Response) => {
   res.status(HttpStatusCode.NOT_FOUND_404).end()
 })
 
 // Catch thrown errors
-app.use((err, req, res: express.Response, next) => {
+app.use((err, _req, res: express.Response, _next) => {
   // Format error to be logged
   let error = 'Unknown error.'
   if (err) {
index 79ef44be18bd490dda87a74718e30422de1ea524..076b7f11d60bccd34ce72fd4fc4c4b269c47603e 100644 (file)
@@ -120,7 +120,7 @@ const videoKeysToKeep = [
   'downloadEnabled'
 ]
 class VideoAuditView extends EntityAuditView {
-  constructor (private readonly video: VideoDetails) {
+  constructor (video: VideoDetails) {
     super(videoKeysToKeep, 'video', video)
   }
 }
@@ -131,7 +131,7 @@ const videoImportKeysToKeep = [
   'video-name'
 ]
 class VideoImportAuditView extends EntityAuditView {
-  constructor (private readonly videoImport: VideoImport) {
+  constructor (videoImport: VideoImport) {
     super(videoImportKeysToKeep, 'video-import', videoImport)
   }
 }
@@ -150,7 +150,7 @@ const commentKeysToKeep = [
   'account-name'
 ]
 class CommentAuditView extends EntityAuditView {
-  constructor (private readonly comment: VideoComment) {
+  constructor (comment: VideoComment) {
     super(commentKeysToKeep, 'comment', comment)
   }
 }
@@ -179,7 +179,7 @@ const userKeysToKeep = [
   'videoChannels'
 ]
 class UserAuditView extends EntityAuditView {
-  constructor (private readonly user: User) {
+  constructor (user: User) {
     super(userKeysToKeep, 'user', user)
   }
 }
@@ -205,7 +205,7 @@ const channelKeysToKeep = [
   'ownerAccount-displayedName'
 ]
 class VideoChannelAuditView extends EntityAuditView {
-  constructor (private readonly channel: VideoChannel) {
+  constructor (channel: VideoChannel) {
     super(channelKeysToKeep, 'channel', channel)
   }
 }
@@ -217,7 +217,7 @@ const abuseKeysToKeep = [
   'createdAt'
 ]
 class AbuseAuditView extends EntityAuditView {
-  constructor (private readonly abuse: AdminAbuse) {
+  constructor (abuse: AdminAbuse) {
     super(abuseKeysToKeep, 'abuse', abuse)
   }
 }
index b54d5a5565a87f3746e08790ff8c8128e86401c5..18ba8f06c8db39f69fcceba5c543760ee996dae1 100644 (file)
@@ -8,7 +8,6 @@
     "emitDecoratorMetadata": true,
     "importHelpers": true,
     "removeComments": true,
-    "strictBindCallApply": true,
     "esModuleInterop": true,
     "forceConsistentCasingInFileNames": true,
     "lib": [
     },
     "resolveJsonModule": true,
     "strict": false,
+    "strictBindCallApply": true,
+    "allowUnreachableCode": false,
+    "allowUnusedLabels": false,
+    "noFallthroughCasesInSwitch": true,
+    "noUnusedLocals": true,
     "skipLibCheck": true,
     "composite": true,
     "declarationMap": true