Skip to content

Commit d48409b

Browse files
committed
fix: resolve all storybook and react linting errors
1 parent deb7183 commit d48409b

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

apps/storybook/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import reactRefresh from 'eslint-plugin-react-refresh'
88
import tseslint from 'typescript-eslint'
99
import { defineConfig, globalIgnores } from 'eslint/config'
1010

11-
export default defineConfig([globalIgnores(['dist']), {
11+
export default defineConfig([globalIgnores(['dist', 'storybook-static']), {
1212
files: ['**/*.{ts,tsx}'],
1313
extends: [
1414
js.configs.recommended,

apps/storybook/src/stories/PipTrigger.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/react-vite';
22
import { PipTrigger, PipWrapper } from '@pip-it-up/react';
33
import { expect, within } from '@storybook/test';
44

@@ -46,6 +46,7 @@ export const AsChild: Story = {
4646
),
4747
},
4848
play: async ({ canvasElement }) => {
49+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4950
const canvas = within(canvasElement) as any;
5051
const button = canvas.getByRole('button', { name: /Custom Button Element/i });
5152
await expect(button).toBeInTheDocument();

apps/storybook/src/stories/PipWrapper.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/react-vite';
22
import { PipWrapper, PipTrigger } from '@pip-it-up/react';
33
import { expect, within } from '@storybook/test';
44

@@ -40,6 +40,7 @@ export const Default: Story = {
4040
),
4141
},
4242
play: async ({ canvasElement, step }) => {
43+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4344
const canvas = within(canvasElement) as any;
4445
const button = canvas.getByRole('button', { name: /Toggle PiP/i });
4546

apps/storybook/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference types="vitest/config" />
1+
22
import { defineConfig } from 'vitest/config';
33
import react from '@vitejs/plugin-react';
44

packages/react/tests/PipTrigger.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('PipTrigger', () => {
4141

4242
// The trigger might be in the main document, or the wrapper's content moved
4343
// Let's check both
44-
const pipWin = (window as any).documentPictureInPicture.window;
44+
4545
const { findByRole } = within(document.body);
4646
// Since trigger is outside the wrapper here, it stays in main document
4747
expect(await findByRole('button', { name: '⊠ Close' })).toBeInTheDocument();

0 commit comments

Comments
 (0)