diff --git a/client/src/components/about.vue b/client/src/components/about.vue index 1449ef5e..0673217d 100644 --- a/client/src/components/about.vue +++ b/client/src/components/about.vue @@ -148,18 +148,18 @@ this.loading = true this.$http .get('https://raw.githubusercontent.com/nurdism/neko/master/docs/README.md') - .then(res => { + .then((res) => { return this.$http.post('https://api.github.com/markdown', { text: res.data, mode: 'gfm', context: 'github/gollum', }) }) - .then(res => { + .then((res) => { this.$accessor.client.setAbout(res.data) this.loading = false }) - .catch(err => console.error(err)) + .catch((err) => console.error(err)) } } diff --git a/client/src/components/context.vue b/client/src/components/context.vue index 07705ce4..af4a4476 100644 --- a/client/src/components/context.vue +++ b/client/src/components/context.vue @@ -39,10 +39,10 @@ diff --git a/client/src/components/emoji.vue b/client/src/components/emoji.vue index 3073346b..1e3c18e5 100644 --- a/client/src/components/emoji.vue +++ b/client/src/components/emoji.vue @@ -329,7 +329,7 @@ for (const emoji of this.list) { if ( emoji.includes(this.search) || typeof this.keywords[emoji] !== 'undefined' - ? this.keywords[emoji].some(keyword => keyword.includes(this.search)) + ? this.keywords[emoji].some((keyword) => keyword.includes(this.search)) : false ) { filtered.push(emoji) diff --git a/client/src/components/emotes.vue b/client/src/components/emotes.vue index 19558e83..f8bedec3 100644 --- a/client/src/components/emotes.vue +++ b/client/src/components/emotes.vue @@ -150,7 +150,7 @@ 'cold', 'blush', 'sad', - ].filter(v => !this.recent.includes(v)) + ].filter((v) => !this.recent.includes(v)) } get muted() { diff --git a/client/src/components/markdown.ts b/client/src/components/markdown.ts index 6ea5bd17..f8934f33 100644 --- a/client/src/components/markdown.ts +++ b/client/src/components/markdown.ts @@ -64,7 +64,7 @@ function htmlTag( if (attributes.class && state.cssModuleNames) { attributes.class = attributes.class .split(' ') - .map(cl => state.cssModuleNames[cl] || cl) + .map((cl) => state.cssModuleNames[cl] || cl) .join(' ') } @@ -199,7 +199,7 @@ const rules: MarkdownRules = { }, text: { ...text, - match: source => /^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff-]|\n\n|\n|\w+:\S|$)/.exec(source), + match: (source) => /^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff-]|\n\n|\n|\w+:\S|$)/.exec(source), html(node, output, state) { if (state.escapeHTML) { return md.sanitizeText(node.content) @@ -214,7 +214,7 @@ const rules: MarkdownRules = { }, emoji: { order: md.defaultRules.strong.order, - match: source => /^:([a-zA-z_-]*):/.exec(source), + match: (source) => /^:([a-zA-z_-]*):/.exec(source), parse(capture) { return { id: capture[1], @@ -235,7 +235,7 @@ const rules: MarkdownRules = { }, emoticon: { order: md.defaultRules.text.order, - match: source => /^(¯\\_\(ツ\)_\/¯)/.exec(source), + match: (source) => /^(¯\\_\(ツ\)_\/¯)/.exec(source), parse(capture) { return { type: 'text', @@ -248,7 +248,7 @@ const rules: MarkdownRules = { }, spoiler: { order: 0, - match: source => /^\|\|([\s\S]+?)\|\|/.exec(source), + match: (source) => /^\|\|([\s\S]+?)\|\|/.exec(source), parse(capture, parse, state) { return { content: parse(capture[1], state), diff --git a/client/src/components/video.vue b/client/src/components/video.vue index ef3cc3c0..2d35b30c 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -327,7 +327,7 @@ this.$accessor.video.setPlayable(false) }) - this._video.addEventListener('error', event => { + this._video.addEventListener('error', (event) => { this.$log.error(event.error) this.$accessor.video.setPlayable(false) }) @@ -352,7 +352,7 @@ .then(() => { this.onResise() }) - .catch(err => this.$log.error) + .catch((err) => this.$log.error) } catch (err) { this.$log.error(err) } @@ -391,7 +391,7 @@ if (this.hosting && navigator.clipboard && typeof navigator.clipboard.readText === 'function') { navigator.clipboard .readText() - .then(text => { + .then((text) => { if (this.clipboard !== text) { this.$accessor.remote.setClipboard(text) this.$accessor.remote.sendClipboard(text) diff --git a/client/src/main.ts b/client/src/main.ts index 2fc2c243..ffcb2a90 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -27,7 +27,7 @@ Vue.use(Client) new Vue({ i18n, store, - render: h => h(app), + render: (h) => h(app), created() { const click = () => { this.$accessor.setActive() diff --git a/client/src/neko/base.ts b/client/src/neko/base.ts index eca6ee66..d9cda1c6 100644 --- a/client/src/neko/base.ts +++ b/client/src/neko/base.ts @@ -62,8 +62,8 @@ export abstract class BaseClient extends EventEmitter { this._ws = new WebSocket(`${url}ws?password=${password}`) this.emit('debug', `connecting to ${this._ws.url}`) this._ws.onmessage = this.onMessage.bind(this) - this._ws.onerror = event => this.onError.bind(this) - this._ws.onclose = event => this.onDisconnected.bind(this, new Error('websocket closed')) + this._ws.onerror = (event) => this.onError.bind(this) + this._ws.onclose = (event) => this.onDisconnected.bind(this, new Error('websocket closed')) this._timeout = setTimeout(this.onTimeout.bind(this), 15000) } catch (err) { this.onDisconnected(err) @@ -174,15 +174,15 @@ export abstract class BaseClient extends EventEmitter { this._peer = new RTCPeerConnection() - this._peer.onconnectionstatechange = event => { + this._peer.onconnectionstatechange = (event) => { this.emit('debug', `peer connection state changed`, this._peer ? this._peer.connectionState : undefined) } - this._peer.onsignalingstatechange = event => { + this._peer.onsignalingstatechange = (event) => { this.emit('debug', `peer signaling state changed`, this._peer ? this._peer.signalingState : undefined) } - this._peer.oniceconnectionstatechange = event => { + this._peer.oniceconnectionstatechange = (event) => { this._state = this._peer!.iceConnectionState this.emit('debug', `peer ice connection state changed: ${this._peer!.iceConnectionState}`) @@ -217,7 +217,7 @@ export abstract class BaseClient extends EventEmitter { this._peer.setRemoteDescription({ type: 'offer', sdp }) this._peer .createAnswer() - .then(d => { + .then((d) => { this._peer!.setLocalDescription(d) this._ws!.send( JSON.stringify({ @@ -227,7 +227,7 @@ export abstract class BaseClient extends EventEmitter { }), ) }) - .catch(err => this.emit('error', err)) + .catch((err) => this.emit('error', err)) } private onMessage(e: MessageEvent) { diff --git a/client/src/plugins/swal.ts b/client/src/plugins/swal.ts index 1906fe6b..3546c5f5 100644 --- a/client/src/plugins/swal.ts +++ b/client/src/plugins/swal.ts @@ -37,7 +37,7 @@ class VueSweetalert2 { // @ts-ignore if (Object.prototype.hasOwnProperty.call(Swal, methodName) && typeof Swal[methodName] === 'function') { // @ts-ignore - swalFunction[methodName] = (method => { + swalFunction[methodName] = ((method) => { return (...args: any[]) => { // @ts-ignore return Swal[method].apply(Swal, args) diff --git a/client/src/store/emoji.ts b/client/src/store/emoji.ts index 11a64391..0fafa9be 100644 --- a/client/src/store/emoji.ts +++ b/client/src/store/emoji.ts @@ -61,7 +61,7 @@ export const actions = actionTree( initialise() { $http .get('/emoji.json') - .then(req => { + .then((req) => { for (const group of req.data.groups) { accessor.emoji.addGroup(group) } diff --git a/client/src/store/user.ts b/client/src/store/user.ts index 34955ed9..c4964ebc 100644 --- a/client/src/store/user.ts +++ b/client/src/store/user.ts @@ -16,9 +16,9 @@ export const state = () => ({ }) export const getters = getterTree(state, { - member: state => state.members[state.id] || null, - admin: state => (state.members[state.id] ? state.members[state.id].admin : false), - muted: state => (state.members[state.id] ? state.members[state.id].muted : false), + member: (state) => state.members[state.id] || null, + admin: (state) => (state.members[state.id] ? state.members[state.id].admin : false), + muted: (state) => (state.members[state.id] ? state.members[state.id].muted : false), }) export const mutations = mutationTree(state, { diff --git a/client/src/store/video.ts b/client/src/store/video.ts index 21c28834..23583fd2 100644 --- a/client/src/store/video.ts +++ b/client/src/store/video.ts @@ -23,9 +23,9 @@ export const state = () => ({ }) export const getters = getterTree(state, { - stream: state => state.streams[state.index], - track: state => state.tracks[state.index], - resolution: state => ({ w: state.width, h: state.height }), + stream: (state) => state.streams[state.index], + track: (state) => state.tracks[state.index], + resolution: (state) => ({ w: state.width, h: state.height }), }) export const mutations = mutationTree(state, {