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;
});
function send() {
function send(): void {
sending.value = true;
const requestBody = JSON5.parse(body.value);
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 => {
const endpointBody = {};
for (const p of resp.params) {

View file

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

View file

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

View file

@ -14,7 +14,7 @@ import { i18n } from '@/i18n';
let state: 'loading' | 'error' | 'done' = $ref('loading');
let finalError: boolean = $ref(false);
async function follow(user) {
async function follow(user): Promise<void> {
const { canceled } = await os.confirm({
type: 'question',
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
state = 'loading';

View file

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