client: fix various lint issues

Mostly adding in missing return types and removing unused imports.
This commit is contained in:
Norm 2022-09-26 15:14:09 -04:00
parent 1ed9b15342
commit 6e8dcc4599
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE
5 changed files with 11 additions and 11 deletions

View file

@ -50,7 +50,7 @@ os.api('endpoints').then(endpointResponse => {
endpoints.value = endpointResponse; endpoints.value = endpointResponse;
}); });
function send() { function send(): void {
sending.value = true; sending.value = true;
const requestBody = JSON5.parse(body.value); const requestBody = JSON5.parse(body.value);
os.api(endpoint.value as keyof Endpoints, requestBody, requestBody.i || (withCredential.value ? undefined : null)).then(resp => { os.api(endpoint.value as keyof Endpoints, requestBody, requestBody.i || (withCredential.value ? undefined : null)).then(resp => {
@ -62,7 +62,7 @@ function send() {
}); });
} }
function onEndpointChange() { function onEndpointChange(): void {
os.api('endpoint', { endpoint: endpoint.value }, withCredential.value ? undefined : null).then(resp => { os.api('endpoint', { endpoint: endpoint.value }, withCredential.value ? undefined : null).then(resp => {
const endpointBody = {}; const endpointBody = {};
for (const p of resp.params) { for (const p of resp.params) {

View file

@ -43,7 +43,7 @@ const props = defineProps<{
const app = props.session.app; const app = props.session.app;
function cancel() { function cancel(): void {
os.api('auth/deny', { os.api('auth/deny', {
token: props.session.token, token: props.session.token,
}).then(() => { }).then(() => {
@ -51,7 +51,7 @@ function cancel() {
}); });
} }
function accept() { function accept(): void {
os.api('auth/accept', { os.api('auth/accept', {
token: props.session.token, token: props.session.token,
}).then(() => { }).then(() => {

View file

@ -23,7 +23,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineComponent, inject } from 'vue'; import { computed } from 'vue';
import MkChannelPreview from '@/components/channel-preview.vue'; import MkChannelPreview from '@/components/channel-preview.vue';
import MkPagination from '@/components/ui/pagination.vue'; import MkPagination from '@/components/ui/pagination.vue';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
@ -48,7 +48,7 @@ const ownedPagination = {
limit: 5, limit: 5,
}; };
function create() { function create(): void {
router.push('/channels/new'); router.push('/channels/new');
} }

View file

@ -14,7 +14,7 @@ import { i18n } from '@/i18n';
let state: 'loading' | 'error' | 'done' = $ref('loading'); let state: 'loading' | 'error' | 'done' = $ref('loading');
let finalError: boolean = $ref(false); let finalError: boolean = $ref(false);
async function follow(user) { async function follow(user): Promise<void> {
const { canceled } = await os.confirm({ const { canceled } = await os.confirm({
type: 'question', type: 'question',
text: i18n.t('followConfirm', { name: user.name || user.username }), text: i18n.t('followConfirm', { name: user.name || user.username }),
@ -30,7 +30,7 @@ async function follow(user) {
}); });
} }
function doIt() { function doIt(): void {
// this might be a retry // this might be a retry
state = 'loading'; state = 'loading';

View file

@ -54,7 +54,7 @@ const props = defineProps<{
let state: 'waiting' | 'denied' | 'accepted' | 'initial' = $ref('initial'); let state: 'waiting' | 'denied' | 'accepted' | 'initial' = $ref('initial');
async function accept() { async function accept(): Promise<void> {
state = 'waiting'; state = 'waiting';
await os.api('miauth/gen-token', { await os.api('miauth/gen-token', {
session: props.session, session: props.session,
@ -71,11 +71,11 @@ async function accept() {
} }
} }
function deny() { function deny(): void {
state = 'denied'; state = 'denied';
} }
function onLogin(res) { function onLogin(res): void {
login(res.i); login(res.i);
} }
</script> </script>