Skip to content

Commit 398a54e

Browse files
committed
chore(usevisibletask$): remove warnings
1 parent 590e9ef commit 398a54e

File tree

21 files changed

+33
-9
lines changed

21 files changed

+33
-9
lines changed

CODING_STANDARDS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ export type TooltipProps = {
5050
};
5151
```
5252

53-
Note: if you want to include the HTML attributes, you can use the `QwikIntrinsicElements` type from `@builder.io/qwik` package and extend it with the [intersection type](https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types).
53+
Note: if you want to include the HTML attributes, you can use the `PropsOf` type.
5454

5555
Example:
5656

5757
```ts
58-
import { QwikIntrinsicElements } from '@builder.io/qwik';
58+
import { PropsOf } from '@builder.io/qwik';
5959

60-
export type TooltipProps = QwikIntrinsicElements['div'] & {
60+
export type TooltipProps = PropsOf<'div'> & {
6161
tip: string;
6262
type?: ColorTypes;
6363
position?: Positions;

apps/website/src/components/highlight/highlight.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const Highlight = component$(
2727
}: HighlightProps) => {
2828
const codeSig = useSignal('');
2929

30+
// eslint-disable-next-line qwik/no-use-visible-task
3031
useVisibleTask$(
3132
async function createHighlightedCode() {
3233
// eslint-disable-next-line @typescript-eslint/no-explicit-any

apps/website/src/root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default component$(() => {
3838

3939
useContextProvider(APP_STATE_CONTEXT_ID, appState);
4040

41+
// eslint-disable-next-line qwik/no-use-visible-task
4142
useVisibleTask$(async () => {
4243
const userStoredTheme = localStorage.getItem(THEME_STORAGE_KEY);
4344
if (userStoredTheme) {

apps/website/src/routes/docs/headless/introduction/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Qwik UI | Introduction
33
---
44

5-
import headlessHero from '../../../../../public/images/qwik-ui-headless-hero.webp';
5+
import headlessHero from '/public/images/qwik-ui-headless-hero.webp';
66
import { Note } from '~/components/note/note';
77
import { FeatureList } from '~/components/feature-list/feature-list';
88
import {

apps/website/src/routes/layout-landing.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { Footer } from '~/components/footer/footer';
66
import { DocsNavigation } from '~/components/navigation-docs/navigation-docs';
77

88
export default component$(() => {
9-
// useStyles$(globalStyles);
10-
119
const state = useContext(OLD_APP_STATE_CONTEXT_ID);
1210
const rootStore = useAppState();
11+
12+
// eslint-disable-next-line qwik/no-use-visible-task
1313
useVisibleTask$(() => {
1414
state.darkMode = localStorage.getItem('theme') === 'dark';
1515
});

packages/kit-headless/src/components/accordion/accordion-content.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const AccordionContent = component$(({ ...props }: ContentProps) => {
7070
});
7171

7272
/* calculates height of the content container based on children */
73+
// eslint-disable-next-line qwik/no-use-visible-task
7374
useVisibleTask$(function calculateHeightVisibleTask({ track }) {
7475
if (animated === false) {
7576
return;

packages/kit-headless/src/components/accordion/accordion-root.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
useSignal,
77
useTask$,
88
useVisibleTask$,
9-
type PropFunction,
109
type QwikIntrinsicElements,
1110
} from '@builder.io/qwik';
1211

@@ -18,8 +17,8 @@ export type AccordionRootProps = {
1817
animated?: boolean;
1918
enhance?: boolean;
2019
collapsible?: boolean;
21-
onSelectedIndexChange$?: PropFunction<(index: number) => void>;
22-
onFocusIndexChange$?: PropFunction<(index: number) => void>;
20+
onSelectedIndexChange$?: (index: number) => void;
21+
onFocusIndexChange$?: (index: number) => void;
2322
} & QwikIntrinsicElements['div'];
2423

2524
export const AccordionRoot = component$(
@@ -103,6 +102,7 @@ export const AccordionRoot = component$(
103102
});
104103

105104
// takes a role call of its children (reactive b/c it's a signal)
105+
// eslint-disable-next-line qwik/no-use-visible-task
106106
useVisibleTask$(function reIndexTriggers() {
107107
updateTriggers$();
108108
});

packages/kit-headless/src/components/accordion/accordion-trigger.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const AccordionTrigger = component$(
8383
}
8484
});
8585

86+
// eslint-disable-next-line qwik/no-use-visible-task
8687
useVisibleTask$(function navigateTriggerVisibleTask({ cleanup }) {
8788
if (!triggerElement) {
8889
return;
@@ -105,6 +106,7 @@ export const AccordionTrigger = component$(
105106
});
106107
});
107108

109+
// eslint-disable-next-line qwik/no-use-visible-task
108110
useVisibleTask$(
109111
function cleanupTriggersTask({ cleanup }) {
110112
cleanup(() => {

packages/kit-headless/src/components/carousel/use/use-items.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export const useItems = (
115115
active.isLast.value = index + 1 === getCount(ref);
116116
});
117117

118+
// eslint-disable-next-line qwik/no-use-visible-task
118119
useVisibleTask$(() => {
119120
total.value = getCount(ref);
120121
scrollAt(active.current.value);

packages/kit-headless/src/components/carousel/use/use-pages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export const usePages = (ref: Signal<HTMLElement | undefined>, params: Params):
113113
scrollAt(ranges.value.at(current.value + 1)?.[0] || 0);
114114
});
115115

116+
// eslint-disable-next-line qwik/no-use-visible-task
116117
useVisibleTask$(() => computePages());
117118
useOnWindow('resize', computePages);
118119

0 commit comments

Comments
 (0)