Skip to content

Commit

Permalink
Silence lint errors that aren't really errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed Dec 3, 2024
1 parent 5f37211 commit 7cac2bc
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function initI18n(event: RequestEvent): Promise<void> {
await loadI18n();
}

// eslint-disable-next-line func-style
// eslint-disable-next-line func-style, @typescript-eslint/unbound-method
export const handle: Handle = ({event, resolve}) => {
console.log(`HTTP request: ${event.request.method} ${event.request.url}`);
event.locals.getUser = () => getUser(event.cookies);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/error/UnexpectedErrorAlert.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
error.subscribe((e) => {
dialog = dialog ?? (browser ? document.querySelector('.error-alert') : undefined) ?? undefined;
if (!dialog) return;
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
e ? open() : close();
})
);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/forms/Form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
export let enhance: AnySuperForm['enhance'] | undefined = undefined;
function enhanceIfRequested(...args: Parameters<AnySuperForm['enhance']>): void {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
enhance && enhance(...args);
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/forms/FormField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
onMount(autofocusIfRequested);
function autofocusIfRequested(): void {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
autofocus && elem.querySelector<HTMLElement>('input, select, textarea')?.focus();
}
</script>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export function tScoped<Scope extends I18nScope>(scope: Scope): Readable<(key: D

export function tTypeScoped<Shape extends object>(scope: I18nShapeKey<Shape>): Readable<(key: DeepPathsToString<Shape>, values?: InterpolationValues) => string> {
return derived(t, tFunc => (key: DeepPathsToString<Shape>, values?: InterpolationValues) =>
// eslint-disable-next-line @typescript-eslint/no-base-to-string
tFunc(`${String(scope)}.${String(key)}` as I18nKey, values));
}

Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/layout/DevContent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
if (browser) {
globalThis.enableDevMode = (enable = true) => {
isDev.set(enable);
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
enable ? localStorage.setItem('devMode', 'true') : localStorage.removeItem('devMode');
};
isDev.set(localStorage.getItem('devMode') === 'true');
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ function stringToUuid(str: string): string {
}

export function logout(cookies?: Cookies): void {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
cookies && deleteCookie(AUTH_COOKIE_NAME, cookies);
if (browser && window.location.pathname !== '/login') {
redirect(307, '/login');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ export async function _refreshProjectRepoInfo(projectCode: string): Promise<void

if (result.error) {
// this should be meaningless, but just in case and it makes the linter happy
// eslint-disable-next-line @typescript-eslint/only-throw-error
throw result.error;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
});
if (response === DialogResponse.Submit) {
const notification = `project_page.notifications.role_change` as const;
const notification = `project_page.notifications.role_change`;
const role = formState.role.currentValue;
notifySuccess(
$t(notification, {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { LayoutServerLoadEvent } from './$types'
import { USER_LOAD_KEY } from '$lib/user';
import { getRootTraceparent } from '$lib/otel/otel.server'

// eslint-disable-next-line @typescript-eslint/unbound-method
export async function load({ locals, depends, fetch }: LayoutServerLoadEvent) {
const user = locals.getUser();
const traceParent = getRootTraceparent()
Expand Down

0 comments on commit 7cac2bc

Please sign in to comment.