aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-18 10:43:47 +0200
committerChocobozzz <me@florianbigard.com>2021-08-18 10:44:16 +0200
commite5a818d3cb2c33f52715ace50e580ee899c9da94 (patch)
tree9b956fb0e300d840a10e457c119f62ec482923ff
parent33a53638c2b7a41a4e39558582f604d3036d4fa3 (diff)
downloadPeerTube-e5a818d3cb2c33f52715ace50e580ee899c9da94.tar.gz
PeerTube-e5a818d3cb2c33f52715ace50e580ee899c9da94.tar.zst
PeerTube-e5a818d3cb2c33f52715ace50e580ee899c9da94.zip
Speed up client lint
-rw-r--r--client/.eslintrc.json5
-rw-r--r--client/src/standalone/videos/embed.ts2
-rw-r--r--client/src/standalone/videos/test-embed.ts2
-rw-r--r--client/tsconfig.eslint.json8
4 files changed, 12 insertions, 5 deletions
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 @@
11 ], 11 ],
12 "parserOptions": { 12 "parserOptions": {
13 "project": [ 13 "project": [
14 "tsconfig.json", 14 "tsconfig.eslint.json"
15 "e2e/tsconfig.json"
16 ], 15 ],
17 "createDefaultProgram": true 16 "createDefaultProgram": false
18 }, 17 },
19 "extends": [ 18 "extends": [
20 "../.eslintrc.json", 19 "../.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 {
657 } 657 }
658 658
659 private handleError (err: Error, translations?: { [ id: string ]: string }) { 659 private handleError (err: Error, translations?: { [ id: string ]: string }) {
660 if (err.message.indexOf('from xs param') !== -1) { 660 if (err.message.includes('from xs param')) {
661 this.player.dispose() 661 this.player.dispose()
662 this.playerElement = null 662 this.playerElement = null
663 this.displayError('This video is not available because the remote instance is not responding.', translations) 663 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 () => {
8 8
9 const isPlaylist = window.location.pathname.startsWith('/video-playlists/') 9 const isPlaylist = window.location.pathname.startsWith('/video-playlists/')
10 10
11 const elementId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[0] 11 const elementId = !lastPart.includes('?') ? lastPart : lastPart.split('?')[0]
12 12
13 const iframe = document.createElement('iframe') 13 const iframe = document.createElement('iframe')
14 iframe.src = isPlaylist 14 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 @@
1{
2 "extends": "./tsconfig.json",
3 "include": [
4 // adjust "includes" to what makes sense for you and your project
5 "src/**/*.ts",
6 "e2e/**/*.ts"
7 ]
8}