]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Speed up client lint
authorChocobozzz <me@florianbigard.com>
Wed, 18 Aug 2021 08:43:47 +0000 (10:43 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 18 Aug 2021 08:44:16 +0000 (10:44 +0200)
client/.eslintrc.json
client/src/standalone/videos/embed.ts
client/src/standalone/videos/test-embed.ts
client/tsconfig.eslint.json [new file with mode: 0644]

index 81b50378ad2c4c9480a6e14765d0996241759c57..cfa7584057b12c91411f77f1affdaa9282972f84 100644 (file)
       ],
       "parserOptions": {
         "project": [
-          "tsconfig.json",
-          "e2e/tsconfig.json"
+          "tsconfig.eslint.json"
         ],
-        "createDefaultProgram": true
+        "createDefaultProgram": false
       },
       "extends": [
         "../.eslintrc.json",
index dad717108e1b83ddc5185c104f1ec14f9eabec0d..f35f4a23abd33a7afe65ca577e78232555270ec7 100644 (file)
@@ -657,7 +657,7 @@ export class PeerTubeEmbed {
   }
 
   private handleError (err: Error, translations?: { [ id: string ]: string }) {
-    if (err.message.indexOf('from xs param') !== -1) {
+    if (err.message.includes('from xs param')) {
       this.player.dispose()
       this.playerElement = null
       this.displayError('This video is not available because the remote instance is not responding.', translations)
index 066b3e0246b68c8280877bb42d8003b30745eb24..a051f1f89d75974fbd6320b15e081738f73b4edb 100644 (file)
@@ -8,7 +8,7 @@ window.addEventListener('load', async () => {
 
   const isPlaylist = window.location.pathname.startsWith('/video-playlists/')
 
-  const elementId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[0]
+  const elementId = !lastPart.includes('?') ? lastPart : lastPart.split('?')[0]
 
   const iframe = document.createElement('iframe')
   iframe.src = isPlaylist
diff --git a/client/tsconfig.eslint.json b/client/tsconfig.eslint.json
new file mode 100644 (file)
index 0000000..a18c461
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "extends": "./tsconfig.json",
+  "include": [
+    // adjust "includes" to what makes sense for you and your project
+    "src/**/*.ts",
+    "e2e/**/*.ts"
+  ]
+}