Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
shinokada committed Oct 17, 2024
1 parent 811e49f commit 4755557
Show file tree
Hide file tree
Showing 22 changed files with 30 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/lib/forms/Input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import type { InputType } from '../types';
import CloseButton from '$lib/utils/CloseButton.svelte';
/* eslint-disable @typescript-eslint/no-explicit-any */
interface $$Props extends Omit<HTMLInputAttributes,'size'> {
type?: InputType;
value?: any;
Expand Down
1 change: 1 addition & 0 deletions src/lib/forms/MultiSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import type { FormSizeType, SelectOptionType } from '../types';
import { createEventDispatcher } from 'svelte';
/* eslint-disable @typescript-eslint/no-explicit-any */
interface $$Props extends Omit<HTMLSelectAttributes,'size'> {
items?: SelectOptionType<any>[];
value?: (string | number)[];
Expand Down
1 change: 1 addition & 0 deletions src/lib/forms/Search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import Wrapper from '$lib/utils/Wrapper.svelte';
import Input from './Input.svelte';
/* eslint-disable @typescript-eslint/no-explicit-any */
interface $$Props extends ComponentProps<Input> {
size?: FormSizeType;
placeholder?: string;
Expand Down
1 change: 1 addition & 0 deletions src/lib/forms/Select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { twMerge } from 'tailwind-merge';
import type { SelectOptionType } from '../types';
/* eslint-disable @typescript-eslint/no-explicit-any */
interface $$Props extends Omit<HTMLSelectAttributes, 'size'> {
items?: SelectOptionType<any>[];
value?: any;
Expand Down
1 change: 1 addition & 0 deletions src/lib/list-group/ListgroupItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
export let focusClass: string = 'focus:z-40 focus:outline-none focus:ring-2 focus:ring-primary-700 focus:text-primary-700 dark:focus:ring-gray-500 dark:focus:text-white';
export let hoverClass: string = 'hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-600 dark:hover:text-white';
export let itemDefaultClass: string = 'py-2 px-4 w-full text-sm font-medium list-none first:rounded-t-lg last:rounded-b-lg';
/* eslint-disable @typescript-eslint/no-explicit-any */
export let attrs: any = undefined;
const states = {
Expand Down
1 change: 1 addition & 0 deletions src/lib/mega-menu/MegaMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
export let open: $$Props['open'] = false;
export let ulClass: $$Props['ulClass'] = 'grid grid-flow-row gap-y-4 md:gap-x-0 auto-col-max auto-row-max';
/* eslint-disable @typescript-eslint/no-explicit-any */
interface LinkTypeLike extends LinkType {
[propName: string]: any;
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/sidebar/SidebarDropdownWrapper.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
export let isOpen: $$Props['isOpen'] = false;
// make a custom transition function that returns the desired transition
/* eslint-disable @typescript-eslint/no-explicit-any */
const multiple = (node: HTMLElement, params: any) => {
switch (transitionType) {
case 'blur':
Expand Down
1 change: 1 addition & 0 deletions src/lib/sidebar/SidebarItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { twMerge } from 'tailwind-merge';
import type { SidebarType } from './Sidebar.svelte';
/* eslint-disable @typescript-eslint/no-explicit-any */
interface $$Props extends HTMLAnchorAttributes {
action?: Action<HTMLElement, any>;
params?: any;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/toast/Toast.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import { twMerge } from 'tailwind-merge';
import { CloseButton } from '$lib';
import type { ColorVariant, ToastPositionType } from '$lib/types';
/* eslint-disable @typescript-eslint/no-explicit-any */
type TransitionFunc = (node: HTMLElement, params: any) => TransitionConfig;
interface $$Props extends HTMLAttributes<HTMLDivElement> {
Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export interface GroupTimelineType {
comment?: string | HTMLElement;
}

/* eslint-disable @typescript-eslint/no-explicit-any */
export interface ListGroupItemType {
name?: string;
current?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/typography/A.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { HTMLAnchorAttributes } from 'svelte/elements';
import type { Action } from 'svelte/action';
import { twMerge } from 'tailwind-merge';
/* eslint-disable @typescript-eslint/no-explicit-any */
interface $$Props extends HTMLAnchorAttributes {
action?: Action<HTMLElement, any>;
params?: any;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/Frame.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const noop = () => {};
/* eslint-disable @typescript-eslint/no-explicit-any */
type TransitionFunc = (node: HTMLElement, params: any) => TransitionConfig;
interface $$Props extends HTMLAnchorAttributes {
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/Popper.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
}
onMount(() => {
/* eslint-disable @typescript-eslint/no-explicit-any */
const events: [string, any, boolean][] = [
['focusin', showHandler, focusable],
['focusout', hideHandler, focusable],
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/TransitionFrame.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { fade, type TransitionConfig } from 'svelte/transition';
import Frame from './Frame.svelte';
/* eslint-disable @typescript-eslint/no-explicit-any */
type TransitionFunc = (node: HTMLElement, params: any) => TransitionConfig;
// propagate props type from underying Frame
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/Wrapper.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export let tag: string = 'div';
export let show: boolean;
/* eslint-disable @typescript-eslint/no-explicit-any */
export let use: Action<HTMLElement, any> = () => {};
</script>

Expand Down
1 change: 1 addition & 0 deletions src/routes/landing/Contributors.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
export let data: PageData;
let name: string;
/* eslint-disable @typescript-eslint/no-explicit-any */
function on_show(e: CustomEvent<any>) {
if (e?.target instanceof HTMLElement) {
name = e?.target?.dataset.name ?? '';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/layouts/ComponentsLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { ChevronDownOutline, ChevronUpOutline } from 'flowbite-svelte-icons';
export let data;
/* eslint-disable @typescript-eslint/no-explicit-any */
const posts: Record<string, any[]> = data.posts || {};
const drawerHidden: Writable<boolean> = getContext('drawer');
Expand Down
2 changes: 1 addition & 1 deletion src/routes/utils/CompoAttributesViewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Split the components into an array
const componentArray = components.split(', ');
}
/* eslint-disable @typescript-eslint/no-explicit-any */
let importPromises: Promise<any>[] = [];
async function processComponents() {
Expand Down
1 change: 1 addition & 0 deletions src/routes/utils/ExampleWrapper.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
type NotificationDirection = 'ltr' | 'rtl' | 'auto';
/* eslint-disable @typescript-eslint/no-explicit-any */
// the source of the example, if you want it
export let src: any = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/utils/Toc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
export let headingSelector: string;
let headings: LinkType[] = [];
/* eslint-disable @typescript-eslint/no-explicit-any */
function init(_: any) {
const observer: MutationObserver = new MutationObserver(toc);
observer.observe(document.body, { childList: true, subtree: true });
Expand Down
3 changes: 2 additions & 1 deletion src/routes/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export { toKebabCase, getFilteredFileNames } from './helpers';

const basename = (path: string) => path.split('/').pop()?.split('.').shift() ?? '';
const filePath = (path: string) => '/' + basename(path);
const fileDir = (path: string) => '/' + path.split('/').slice(0, -1).pop();

/* eslint-disable @typescript-eslint/no-explicit-any */
const sortByList = (order: string[]) => (a: [string, any], b: [string, any]) => [a[0], b[0]].map((x) => order.indexOf(basename(x))).reduce((x, y) => (x < 0 ? 1 : y < 0 ? -1 : x - y));

export const fetchMarkdownPosts = async () => {
Expand Down
13 changes: 7 additions & 6 deletions src/routes/utils/mdsvex.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-empty-object-type */
declare module '*.md' {
import type { SvelteComponent } from 'svelte';

Expand All @@ -9,17 +10,17 @@ declare module '*.md' {
}

declare module '*.svx' {
import type { SvelteComponent } from 'svelte';
import type { SvelteComponent } from 'svelte';

export default class Comp extends SvelteComponent {}
export default class Comp extends SvelteComponent {}

export const metadata: Record<string, unknown>;
export const metadata: Record<string, unknown>;
}

declare module '*.svelte.md' {
import type { SvelteComponent } from 'svelte';
import type { SvelteComponent } from 'svelte';

export default class Comp extends SvelteComponent {}
export default class Comp extends SvelteComponent {}

export const metadata: Record<string, unknown>;
export const metadata: Record<string, unknown>;
}

0 comments on commit 4755557

Please sign in to comment.