fix eslint errors

This commit is contained in:
sam 2023-12-30 15:33:00 +01:00
parent ebc10d9558
commit 55479ae8da
No known key found for this signature in database
GPG key ID: B4EF20DDE721CAA1
16 changed files with 37 additions and 11 deletions

View file

@ -17,4 +17,15 @@ module.exports = {
es2017: true,
node: true,
},
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
},
};

View file

@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
import { PUBLIC_BASE_URL, PUBLIC_MEDIA_URL } from "$env/static/public";
export const MAX_MEMBERS = 500;

View file

@ -31,6 +31,8 @@
const resp = await apiFetchClient<Settings>(
"/users/@me/settings",
"PATCH",
// If this function is run, notice will always be non-null
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
{ read_global_notice: data.notice!.id },
2,
);

View file

@ -4,7 +4,6 @@
import {
Alert,
Badge,
Button,
ButtonGroup,
Icon,
@ -15,7 +14,7 @@
ModalFooter,
Tooltip,
} from "@sveltestrap/sveltestrap";
import { DateTime, Duration, FixedOffsetZone, Zone } from "luxon";
import { DateTime, FixedOffsetZone } from "luxon";
import FieldCard from "$lib/components/FieldCard.svelte";
import PronounLink from "$lib/components/PronounLink.svelte";
import PartialMemberCard from "$lib/components/PartialMemberCard.svelte";

View file

@ -1,6 +1,6 @@
import type { PrideFlag, APIError, MeUser, PronounsJson } from "$lib/api/entities";
import type { PrideFlag, MeUser, PronounsJson } from "$lib/api/entities";
import { apiFetchClient } from "$lib/api/fetch";
import { error, redirect, type Redirect } from "@sveltejs/kit";
import { error, redirect } from "@sveltejs/kit";
import pronounsRaw from "$lib/pronouns.json";
const pronouns = pronounsRaw as PronounsJson;

View file

@ -64,8 +64,10 @@
) => Promise<void>;
let captchaToken = "";
// svelte-hcaptcha doesn't have types, so we can't use anything except `any` here.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let captcha: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const captchaSuccess = (token: any) => {
captchaToken = token.detail.token;
};
@ -88,6 +90,8 @@
await fastFetch("/auth/force-delete", {
method: "GET",
headers: {
// We know for sure this value is non-null if this function is run at all
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
"X-Delete-Token": token!,
},
});
@ -105,6 +109,8 @@
await fastFetch("/auth/cancel-delete", {
method: "GET",
headers: {
// We know for sure this value is non-null if this function is run at all
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
"X-Delete-Token": token!,
},
});

View file

@ -10,7 +10,7 @@
export let data: PageData;
let callbackPage: any;
let callbackPage: CallbackPage;
const signupForm = async (username: string, invite: string, captchaToken: string) => {
try {

View file

@ -10,7 +10,7 @@
export let data: PageData;
let callbackPage: any;
let callbackPage: CallbackPage;
const signupForm = async (username: string, invite: string, captchaToken: string) => {
try {

View file

@ -10,7 +10,7 @@
export let data: PageData;
let callbackPage: any;
let callbackPage: CallbackPage;
const signupForm = async (username: string, invite: string, captchaToken: string) => {
try {

View file

@ -10,7 +10,7 @@
export let data: PageData;
let callbackPage: any;
let callbackPage: CallbackPage;
const signupForm = async (username: string, invite: string, captchaToken: string) => {
try {

View file

@ -10,7 +10,7 @@
export let data: PageData;
let callbackPage: any;
let callbackPage: CallbackPage;
const signupForm = async (username: string, invite: string, captchaToken: string) => {
try {

View file

@ -1,4 +1,6 @@
<script lang="ts">
// Ignoring the TS error here, because this file imports fine, typescript just chokes on markdown files
// eslint-disable-next-line
//@ts-ignore
import { html } from "./about.md";
</script>

View file

@ -1,5 +1,7 @@
<script lang="ts">
import { onMount } from "svelte";
// Ignoring the TS error here, because this file imports fine, typescript just chokes on markdown files
// eslint-disable-next-line
//@ts-ignore
import { html } from "./changelog.md";
import { CURRENT_CHANGELOG } from "$lib/store";

View file

@ -1,4 +1,6 @@
<script lang="ts">
// Ignoring the TS error here, because this file imports fine, typescript just chokes on markdown files
// eslint-disable-next-line
//@ts-ignore
import { html } from "./privacy.md";
</script>

View file

@ -1,4 +1,6 @@
<script lang="ts">
// Ignoring the TS error here, because this file imports fine, typescript just chokes on markdown files
// eslint-disable-next-line
//@ts-ignore
import { html } from "./terms.md";
</script>

View file

@ -25,7 +25,6 @@
Table,
} from "@sveltestrap/sveltestrap";
import type { PageData } from "./$types";
import { onMount } from "svelte";
import { DateTime } from "luxon";
export let data: PageData;