Skip to content

Commit

Permalink
npm lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Jan 29, 2023
1 parent 1262386 commit dfe8b8b
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 53 deletions.
3 changes: 1 addition & 2 deletions client/src/components/about.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import md, { HtmlOutputRule } from 'simple-markdown'
import { Component, Vue } from 'vue-property-decorator'
@Component({ name: 'neko-about' })
export default class extends Vue {
Expand Down
3 changes: 1 addition & 2 deletions client/src/components/connect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { get, set } from '~/utils/localstorage'
import { Component, Vue } from 'vue-property-decorator'
@Component({ name: 'neko-connect' })
export default class extends Vue {
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/context.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { Component, Ref, Vue } from 'vue-property-decorator'
import { Member } from '~/neko/types'
// @ts-ignore
Expand Down Expand Up @@ -229,11 +229,11 @@
}
}
adminRelease(member: Member) {
adminRelease() {
this.$accessor.remote.adminRelease()
}
adminControl(member: Member) {
adminControl() {
this.$accessor.remote.adminControl()
}
Expand Down
10 changes: 5 additions & 5 deletions client/src/components/emoji.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { Component, Ref, Vue } from 'vue-property-decorator'
import { directive as onClickaway } from 'vue-clickaway'
import { get, set } from '../utils/localstorage'
import { get } from '../utils/localstorage'
@Component({
name: 'neko-emoji',
Expand Down Expand Up @@ -356,7 +356,7 @@
this.waitingForPaint = false
let scrollTop = this._scroll.scrollTop
let active = 0
for (const [i, group] of this.groups.entries()) {
for (const [i] of this.groups.entries()) {
let component = this._groups[i]
if (component && component.offsetTop > scrollTop) {
break
Expand All @@ -368,7 +368,7 @@
}
}
onMouseExit(event: MouseEvent, emoji: string) {
onMouseExit() {
this.hovered = ''
}
Expand All @@ -382,7 +382,7 @@
this.$emit('picked', emoji)
}
onClickAway(event: MouseEvent) {
onClickAway() {
this.$emit('done')
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { Component, Vue } from 'vue-property-decorator'
import { AdminLockResource } from '~/neko/messages'
@Component({ name: 'neko-settings' })
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import md, { SingleNodeParserRule, HtmlOutputRule, defaultRules, State, Rules } from 'simple-markdown'
import { Component, Watch, Vue, Prop } from 'vue-property-decorator'
import { Component, Vue, Prop } from 'vue-property-decorator'

const { blockQuote, inlineCode, codeBlock, autolink, newline, escape, strong, text, link, url, em, u, br } =
defaultRules
Expand Down
3 changes: 1 addition & 2 deletions client/src/components/members.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { Member } from '~/neko/types'
import { Component, Ref, Vue } from 'vue-property-decorator'
import Content from './context.vue'
import Avatar from './avatar.vue'
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { Component, Vue } from 'vue-property-decorator'
import { messages } from '~/locale'
@Component({ name: 'neko-menu' })
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/resolution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { Component, Ref, Vue } from 'vue-property-decorator'
import { ScreenResolution } from '~/neko/types'
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { Component, Watch, Vue } from 'vue-property-decorator'
@Component({ name: 'neko-settings' })
export default class extends Vue {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/unsupported.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</style>

<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { Component, Vue } from 'vue-property-decorator'
@Component({ name: 'neko-unsupported' })
export default class extends Vue {}
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,12 @@
}
@Watch('width')
onWidthChanged(width: number) {
onWidthChanged() {
this.onResize()
}
@Watch('height')
onHeightChanged(height: number) {
onHeightChanged() {
this.onResize()
}
Expand Down Expand Up @@ -444,7 +444,7 @@
this.$accessor.video.setPlayable(false)
})
this._video.addEventListener('volumechange', (event) => {
this._video.addEventListener('volumechange', () => {
this.$accessor.video.setMuted(this._video.muted)
this.$accessor.video.setVolume(this._video.volume * 100)
})
Expand Down
10 changes: 5 additions & 5 deletions client/src/neko/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
this._ws = new WebSocket(`${url}?password=${encodeURIComponent(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 = () => this.onError.bind(this)
this._ws.onclose = () => this.onDisconnected.bind(this, new Error('websocket closed'))
this._timeout = window.setTimeout(this.onTimeout.bind(this), 15000)
} catch (err: any) {
this.onDisconnected(err)
Expand Down Expand Up @@ -210,15 +210,15 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
})
}

this._peer.onconnectionstatechange = (event) => {
this._peer.onconnectionstatechange = () => {
this.emit('debug', `peer connection state changed`, this._peer ? this._peer.connectionState : undefined)
}

this._peer.onsignalingstatechange = (event) => {
this._peer.onsignalingstatechange = () => {
this.emit('debug', `peer signaling state changed`, this._peer ? this._peer.signalingState : undefined)
}

this._peer.oniceconnectionstatechange = (event) => {
this._peer.oniceconnectionstatechange = () => {
this._state = this._peer!.iceConnectionState

this.emit('debug', `peer ice connection state changed: ${this._peer!.iceConnectionState}`)
Expand Down
4 changes: 1 addition & 3 deletions client/src/neko/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { accessor } from '~/store'

import {
SystemMessagePayload,
SignalProvidePayload,
MemberListPayload,
MemberDisconnectPayload,
MemberPayload,
Expand All @@ -19,7 +18,6 @@ import {
ScreenConfigurationsPayload,
ScreenResolutionPayload,
BroadcastStatusPayload,
AdminPayload,
AdminTargetPayload,
AdminLockMessage,
SystemInitPayload,
Expand Down Expand Up @@ -131,7 +129,7 @@ export class NekoClient extends BaseClient implements EventEmitter<NekoEvents> {
this.$accessor.video.setStream(0)
}

protected [EVENT.DATA](data: any) {}
protected [EVENT.DATA]() {}

/////////////////////////////
// System Events
Expand Down
2 changes: 1 addition & 1 deletion client/src/plugins/swal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare module 'vue/types/vue' {
$swal: VueSwalInstance
}

interface VueConstructor<V extends Vue = Vue> {
interface VueConstructor {
swal: VueSwalInstance
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const actions = actionTree(
accessor.chat.addEmote({ id, emote })
},

newMessage({ state }, message: Message) {
newMessage(store, message: Message) {
if (accessor.settings.chat_sound) {
new Audio('chat.mp3').play().catch(console.error)
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/store/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const actions = actionTree(
accessor.files._removeTransfer(transfer)
},

cancelAllTransfers(store) {
cancelAllTransfers() {
for (const t of accessor.files.transfers) {
if (t.status !== 'completed') {
t.abortController?.abort()
Expand All @@ -62,7 +62,7 @@ export const actions = actionTree(
}
},

refresh(store) {
refresh() {
if (!accessor.connected) {
return
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const getters = getterTree(state, {
export const actions = actionTree(
{ state, getters, mutations },
{
initialise(store) {
initialise() {
accessor.emoji.initialise()
accessor.settings.initialise()
},
Expand Down Expand Up @@ -92,12 +92,12 @@ export const actions = actionTree(
}
},

login({ state }, { displayname, password }: { displayname: string; password: string }) {
login(store, { displayname, password }: { displayname: string; password: string }) {
accessor.setLogin({ displayname, password })
$client.login(password, displayname)
},

logout({ state }) {
logout() {
accessor.setLogin({ displayname: '', password: '' })
set('displayname', '')
set('password', '')
Expand Down
6 changes: 3 additions & 3 deletions client/src/store/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getters = getterTree(state, {
hosting: (state, getters, root) => {
return root.user.id === state.id || state.implicitHosting
},
hosted: (state, getters, root) => {
hosted: (state) => {
return state.id !== '' || state.implicitHosting
},
host: (state, getters, root) => {
Expand Down Expand Up @@ -136,7 +136,7 @@ export const actions = actionTree(
$client.sendMessage(EVENT.ADMIN.RELEASE)
},

adminGive({ getters }, member: string | Member) {
adminGive(store, member: string | Member) {
if (!accessor.connected) {
return
}
Expand All @@ -160,7 +160,7 @@ export const actions = actionTree(
$client.sendMessage(EVENT.CONTROL.KEYBOARD, { layout: accessor.settings.keyboard_layout })
},

syncKeyboardModifierState({ state, getters }, { capsLock, numLock, scrollLock }) {
syncKeyboardModifierState({ state }, { capsLock, numLock, scrollLock }) {
if (state.keyboardModifierState === keyboardModifierState(capsLock, numLock, scrollLock)) {
return
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/store/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ export const actions = actionTree(
}
},

broadcastStatus({ getters }, { url, isActive }) {
broadcastStatus(store, { url, isActive }) {
accessor.settings.setBroadcastStatus({ url, isActive })
},
broadcastCreate({ getters }, url: string) {
broadcastCreate(store, url: string) {
$client.sendMessage(EVENT.BROADCAST.CREATE, { url })
},
broadcastDestroy({ getters }) {
broadcastDestroy() {
$client.sendMessage(EVENT.BROADCAST.DESTROY)
},
},
Expand Down
6 changes: 3 additions & 3 deletions client/src/store/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,23 @@ export const mutations = mutationTree(state, {
export const actions = actionTree(
{ state, getters, mutations },
{
screenConfiguations({ state }) {
screenConfiguations() {
if (!accessor.connected || !accessor.user.admin) {
return
}

$client.sendMessage(EVENT.SCREEN.CONFIGURATIONS)
},

screenGet({ state }) {
screenGet() {
if (!accessor.connected) {
return
}

$client.sendMessage(EVENT.SCREEN.RESOLUTION)
},

screenSet({ state }, resolution: ScreenResolution) {
screenSet(store, resolution: ScreenResolution) {
if (!accessor.connected || !accessor.user.admin) {
return
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/types/navigator.keyboard.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
// Type declarations for Keyboard API
// https://developer.mozilla.org/en-US/docs/Web/API/Keyboard_API
interface Keyboard {
lock(keyCodes?: array<string>): Promise<void>;
unlock(): void;
lock(keyCodes?: array<string>): Promise<void>
unlock(): void
}

interface NavigatorKeyboard {
// Only available in a secure context.
readonly keyboard?: Keyboard;
readonly keyboard?: Keyboard
}

interface Navigator extends NavigatorKeyboard {}
4 changes: 2 additions & 2 deletions client/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export function makeid(length: number) {

export function lockKeyboard() {
if (navigator && navigator.keyboard) {
navigator.keyboard.lock();
navigator.keyboard.lock()
}
}

export function unlockKeyboard() {
if (navigator && navigator.keyboard) {
navigator.keyboard.unlock();
navigator.keyboard.unlock()
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ module.exports = {
},
},
devServer: {
allowedHosts: "all",
allowedHosts: 'all',
},
}

0 comments on commit dfe8b8b

Please sign in to comment.