From e5a818d3cb2c33f52715ace50e580ee899c9da94 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Aug 2021 10:43:47 +0200 Subject: Speed up client lint --- client/.eslintrc.json | 5 ++--- client/src/standalone/videos/embed.ts | 2 +- client/src/standalone/videos/test-embed.ts | 2 +- client/tsconfig.eslint.json | 8 ++++++++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 client/tsconfig.eslint.json diff --git a/client/.eslintrc.json b/client/.eslintrc.json index 81b50378a..cfa758405 100644 --- a/client/.eslintrc.json +++ b/client/.eslintrc.json @@ -11,10 +11,9 @@ ], "parserOptions": { "project": [ - "tsconfig.json", - "e2e/tsconfig.json" + "tsconfig.eslint.json" ], - "createDefaultProgram": true + "createDefaultProgram": false }, "extends": [ "../.eslintrc.json", diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index dad717108..f35f4a23a 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -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) diff --git a/client/src/standalone/videos/test-embed.ts b/client/src/standalone/videos/test-embed.ts index 066b3e024..a051f1f89 100644 --- a/client/src/standalone/videos/test-embed.ts +++ b/client/src/standalone/videos/test-embed.ts @@ -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 index 000000000..a18c461fe --- /dev/null +++ b/client/tsconfig.eslint.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "include": [ + // adjust "includes" to what makes sense for you and your project + "src/**/*.ts", + "e2e/**/*.ts" + ] +} -- cgit v1.2.3