mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
linting
This commit is contained in:
parent
fa64f930a9
commit
9d484a49d0
@ -148,18 +148,18 @@
|
||||
this.loading = true
|
||||
this.$http
|
||||
.get<string>('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))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,10 +39,10 @@
|
||||
<template v-if="admin">
|
||||
<li class="seperator" />
|
||||
<li>
|
||||
<span @click="kick(child.data.member)" style="color: #f04747">{{ $t('context.kick') }}</span>
|
||||
<span @click="kick(child.data.member)" style="color: #f04747;">{{ $t('context.kick') }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span @click="ban(child.data.member)" style="color: #f04747">{{ $t('context.ban') }}</span>
|
||||
<span @click="ban(child.data.member)" style="color: #f04747;">{{ $t('context.ban') }}</span>
|
||||
</li>
|
||||
</template>
|
||||
</template>
|
||||
|
@ -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)
|
||||
|
@ -150,7 +150,7 @@
|
||||
'cold',
|
||||
'blush',
|
||||
'sad',
|
||||
].filter(v => !this.recent.includes(v))
|
||||
].filter((v) => !this.recent.includes(v))
|
||||
}
|
||||
|
||||
get muted() {
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -62,8 +62,8 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
|
||||
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<BaseEvents> {
|
||||
|
||||
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<BaseEvents> {
|
||||
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<BaseEvents> {
|
||||
}),
|
||||
)
|
||||
})
|
||||
.catch(err => this.emit('error', err))
|
||||
.catch((err) => this.emit('error', err))
|
||||
}
|
||||
|
||||
private onMessage(e: MessageEvent) {
|
||||
|
@ -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)
|
||||
|
@ -61,7 +61,7 @@ export const actions = actionTree(
|
||||
initialise() {
|
||||
$http
|
||||
.get<Emojis>('/emoji.json')
|
||||
.then(req => {
|
||||
.then((req) => {
|
||||
for (const group of req.data.groups) {
|
||||
accessor.emoji.addGroup(group)
|
||||
}
|
||||
|
@ -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, {
|
||||
|
@ -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, {
|
||||
|
Loading…
Reference in New Issue
Block a user