repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/src/babel/plugins/optimize-hook-destructuring.ts
code/frameworks/nextjs/src/babel/plugins/optimize-hook-destructuring.ts
/** * Source: * https://github.com/vercel/next.js/blob/canary/packages/next/src/build/babel/plugins/optimize-hook-destructuring.ts */ import type { types as BabelTypes, NodePath, PluginObj } from '@babel/core'; // matches any hook-like (the default) const isHook = /^use[A-Z]/; // matches only built-in hooks provid...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/src/babel/plugins/jsx-pragma.ts
code/frameworks/nextjs/src/babel/plugins/jsx-pragma.ts
/** * Source: * https://github.com/vercel/next.js/blob/canary/packages/next/src/build/babel/plugins/jsx-pragma.ts */ import type { types as BabelTypes, NodePath, PluginObj } from '@babel/core'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error import jsx from 'next/dist/compiled/babel...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/typings.d.ts
code/frameworks/nextjs/template/typings.d.ts
declare module '*.svg' { const content: string; export default content; } declare module '*.avif' { const content: string; export default content; } declare module '*.png' { const content: string; export default content; }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/next-env.d.ts
code/frameworks/nextjs/template/next-env.d.ts
// Reference necessary since Next.js 13.2.0, because types in `next/navigation` are not exported per default, but // type references are dynamically created during Next.js start up. // See https://github.com/vercel/next.js/commit/cdf1d52d9aed42d01a46539886a4bda14cb77a99 // for more insights. /// <reference types="next...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/ImageLegacy.stories.tsx
code/frameworks/nextjs/template/stories/ImageLegacy.stories.tsx
import type { Meta, StoryObj } from '@storybook/nextjs'; import Image from 'next/legacy/image'; import Accessibility from '../../assets/accessibility.svg'; export default { component: Image, args: { src: Accessibility, alt: 'Accessibility', }, } as Meta<typeof Image>; type Story = StoryObj<typeof Imag...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/dynamic-component.tsx
code/frameworks/nextjs/template/stories/dynamic-component.tsx
import React from 'react'; export default function DynamicComponent() { return <div>I am a dynamically loaded component</div>; }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/Link.stories.tsx
code/frameworks/nextjs/template/stories/Link.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import Link from 'next/link'; import style from './Link.stories.module.css'; // `onClick`, `href`, and `ref` need to be passed to the DOM element // for proper handling const MyButton = React.forwardRef< HTMLAnchorElement, React...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/Font.stories.tsx
code/frameworks/nextjs/template/stories/Font.stories.tsx
import type { Meta, StoryObj } from '@storybook/nextjs'; import Font from './Font'; export default { component: Font, } as Meta<typeof Font>; type Story = StoryObj<typeof Font>; export const WithClassName: Story = { args: { variant: 'className', }, }; export const WithStyle: Story = { args: { varia...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/StyledJsx.stories.tsx
code/frameworks/nextjs/template/stories/StyledJsx.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; const Component = () => ( <div> <style jsx>{` .main p { color: #ff4785; } `}</style> <main className="main"> <p>This is styled using Styled JSX</p> </main> </div> ); export default { co...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/Navigation.stories.tsx
code/frameworks/nextjs/template/stories/Navigation.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { getRouter } from '@storybook/nextjs/navigation.mock'; import { useParams, usePathname, useRouter, useSearchParams, useSelectedLayoutSegment, useSelectedLayoutSegments, } from 'next/navigation'; import { expect, us...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/RSC.stories.tsx
code/frameworks/nextjs/template/stories/RSC.stories.tsx
/* eslint-disable local-rules/no-uncategorized-errors */ import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { Nested, RSC } from './RSC'; export default { component: RSC, args: { label: 'label' }, parameters: { react: { rsc: true, }, }, } as Meta<typeof R...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/DynamicImport.stories.tsx
code/frameworks/nextjs/template/stories/DynamicImport.stories.tsx
import React, { Suspense } from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import dynamic from 'next/dynamic'; const DynamicComponent = dynamic(() => import('./dynamic-component'), { ssr: false, }); function Component() { return ( <Suspense fallback="Loading..."> <DynamicCompone...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/Image.stories.tsx
code/frameworks/nextjs/template/stories/Image.stories.tsx
import React, { useState } from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import Image from 'next/image'; import Accessibility from '../../assets/accessibility.svg'; import AvifImage from '../../assets/avif-test-image.avif'; export default { component: Image, args: { src: Accessibili...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/RSC.tsx
code/frameworks/nextjs/template/stories/RSC.tsx
import React from 'react'; import 'server-only'; export const RSC = async ({ label }: { label: string }) => <>RSC {label}</>; export const Nested = async ({ children }: any) => <>Nested {children}</>;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/Head.stories.tsx
code/frameworks/nextjs/template/stories/Head.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import Head from 'next/head'; import { expect, waitFor } from 'storybook/test'; function Component() { return ( <div> <Head> <title>Next.js Head Title</title> <meta property="og:title" content="My page tit...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/Font.tsx
code/frameworks/nextjs/template/stories/Font.tsx
import React from 'react'; import { Rubik_Puddles } from 'next/font/google'; import localFont from 'next/font/local'; const rubik = Rubik_Puddles({ subsets: ['latin'], variable: '--font-latin-rubik', weight: '400', }); export const localRubikStorm = localFont({ src: '/fonts/RubikStorm-Regular.ttf', variabl...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories/Router.stories.tsx
code/frameworks/nextjs/template/stories/Router.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { getRouter } from '@storybook/nextjs/router.mock'; import Router, { useRouter } from 'next/router'; import { expect, userEvent, within } from 'storybook/test'; function Component() { const router = useRouter(); const sear...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-prerelease/GetImageProps.stories.tsx
code/frameworks/nextjs/template/stories_nextjs-prerelease/GetImageProps.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { getImageProps } from 'next/image'; import Accessibility from '../../assets/accessibility.svg'; import Testing from '../../assets/testing.png'; // referenced from https://nextjs.org/docs/pages/api-reference/components/image#...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-prerelease/NextHeader.stories.tsx
code/frameworks/nextjs/template/stories_nextjs-prerelease/NextHeader.stories.tsx
import type { Meta, StoryObj } from '@storybook/nextjs'; import { cookies, headers } from '@storybook/nextjs/headers.mock'; import { expect, userEvent, within } from 'storybook/test'; import NextHeader from './NextHeader'; export default { component: NextHeader, parameters: { react: { rsc: true, },...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-prerelease/server-actions.tsx
code/frameworks/nextjs/template/stories_nextjs-prerelease/server-actions.tsx
'use server'; import { revalidatePath } from 'next/cache'; import { cookies } from 'next/headers'; import { redirect } from 'next/navigation'; export async function accessRoute() { const user = (await cookies()).get('user'); if (!user) { redirect('/'); } revalidatePath('/'); redirect(`/protected`); } ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-prerelease/ServerActions.stories.tsx
code/frameworks/nextjs/template/stories_nextjs-prerelease/ServerActions.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { revalidatePath } from '@storybook/nextjs/cache.mock'; import { cookies } from '@storybook/nextjs/headers.mock'; import { getRouter, redirect } from '@storybook/nextjs/navigation.mock'; import { expect, userEvent, waitFor, wit...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-prerelease/NextHeader.tsx
code/frameworks/nextjs/template/stories_nextjs-prerelease/NextHeader.tsx
import React from 'react'; import { cookies, headers } from 'next/headers'; export default async function Component() { async function handleClick() { 'use server'; (await cookies()).set('user-id', 'encrypted-id'); } return ( <> <h3>Cookies:</h3> {(await cookies()).getAll().map(({ name,...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-prerelease/Redirect.stories.tsx
code/frameworks/nextjs/template/stories_nextjs-prerelease/Redirect.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { redirect } from 'next/navigation'; import { userEvent, within } from 'storybook/test'; let state = 'Bug! Not invalidated'; export default { render() { return ( <div> <div>{state}</div> <form ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/cli/ts/Button.stories.ts
code/frameworks/nextjs/template/cli/ts/Button.stories.ts
import type { Meta, StoryObj } from '@storybook/nextjs'; import { fn } from 'storybook/test'; import { Button } from './Button'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export const meta = { title: 'Example/Button', component: Button, parameters: { // Opti...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/cli/ts/Page.stories.ts
code/frameworks/nextjs/template/cli/ts/Page.stories.ts
import type { Meta, StoryObj } from '@storybook/nextjs'; import { expect, userEvent, within } from 'storybook/test'; import { Page } from './Page'; const meta = { title: 'Example/Page', component: Page, parameters: { // More on how to position stories at: https://storybook.js.org/docs/configure/story-layou...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/cli/ts/Button.tsx
code/frameworks/nextjs/template/cli/ts/Button.tsx
import './button.css'; export interface ButtonProps { /** Is this the principal call to action on the page? */ primary?: boolean; /** What background color to use */ backgroundColor?: string; /** How large should the button be? */ size?: 'small' | 'medium' | 'large'; /** Button contents */ label: strin...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/cli/ts/Header.stories.ts
code/frameworks/nextjs/template/cli/ts/Header.stories.ts
import type { Meta, StoryObj } from '@storybook/nextjs'; import { fn } from 'storybook/test'; import { Header } from './Header'; const meta = { title: 'Example/Header', component: Header, // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/cli/ts/Page.tsx
code/frameworks/nextjs/template/cli/ts/Page.tsx
import React from 'react'; import { Header } from './Header'; import './page.css'; type User = { name: string; }; export const Page: React.FC = () => { const [user, setUser] = React.useState<User>(); return ( <article> <Header user={user} onLogin={() => setUser({ name: 'Jane Doe' })}...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/cli/ts/Header.tsx
code/frameworks/nextjs/template/cli/ts/Header.tsx
import { Button } from './Button'; import './header.css'; type User = { name: string; }; export interface HeaderProps { user?: User; onLogin?: () => void; onLogout?: () => void; onCreateAccount?: () => void; } export const Header = ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => ( <header>...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-default-ts/GetImageProps.stories.tsx
code/frameworks/nextjs/template/stories_nextjs-default-ts/GetImageProps.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { getImageProps } from 'next/image'; import Accessibility from '../../assets/accessibility.svg'; import Testing from '../../assets/testing.png'; // referenced from https://nextjs.org/docs/pages/api-reference/components/image#...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-default-ts/NextHeader.stories.tsx
code/frameworks/nextjs/template/stories_nextjs-default-ts/NextHeader.stories.tsx
import type { Meta, StoryObj } from '@storybook/nextjs'; import { cookies, headers } from '@storybook/nextjs/headers.mock'; import { expect, userEvent, within } from 'storybook/test'; import NextHeader from './NextHeader'; export default { component: NextHeader, parameters: { react: { rsc: true, },...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-default-ts/server-actions.tsx
code/frameworks/nextjs/template/stories_nextjs-default-ts/server-actions.tsx
'use server'; import { revalidatePath } from 'next/cache'; import { cookies } from 'next/headers'; import { redirect } from 'next/navigation'; export async function accessRoute() { const user = (await cookies()).get('user'); if (!user) { redirect('/'); } revalidatePath('/'); redirect(`/protected`); } ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx
code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { revalidatePath } from '@storybook/nextjs/cache.mock'; import { cookies } from '@storybook/nextjs/headers.mock'; import { getRouter, redirect } from '@storybook/nextjs/navigation.mock'; import { expect, userEvent, waitFor, wit...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-default-ts/NextHeader.tsx
code/frameworks/nextjs/template/stories_nextjs-default-ts/NextHeader.tsx
import React from 'react'; import { cookies, headers } from 'next/headers'; export default async function Component() { async function handleClick() { 'use server'; (await cookies()).set('user-id', 'encrypted-id'); } return ( <> <h3>Cookies:</h3> {(await cookies()).getAll().map(({ name,...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx
code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/nextjs'; import { redirect } from 'next/navigation'; import { userEvent, within } from 'storybook/test'; let state = 'Bug! Not invalidated'; export default { render() { return ( <div> <div>{state}</div> <form ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/server-webpack5/vitest.config.ts
code/frameworks/server-webpack5/vitest.config.ts
import { defineConfig, mergeConfig } from 'vitest/config'; import { vitestCommonConfig } from '../../vitest.shared'; export default mergeConfig( vitestCommonConfig, defineConfig({ // Add custom config here }) );
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/server-webpack5/build-config.ts
code/frameworks/server-webpack5/build-config.ts
import type { BuildEntries } from '../../../scripts/build/utils/entry-utils'; const config: BuildEntries = { entries: { browser: [ { exportEntries: ['.'], entryPoint: './src/index.ts', }, ], node: [ { exportEntries: ['./preset'], entryPoint: './src/preset...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/server-webpack5/src/preset.ts
code/frameworks/server-webpack5/src/preset.ts
import type { PresetProperty } from 'storybook/internal/types'; export const addons: PresetProperty<'addons'> = [ import.meta.resolve('@storybook/preset-server-webpack'), ]; export const core: PresetProperty<'core'> = async (config, options) => { const framework = await options.presets.apply('framework'); retu...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/server-webpack5/src/types.ts
code/frameworks/server-webpack5/src/types.ts
import type { CompatibleString } from 'storybook/internal/types'; import type { BuilderOptions, StorybookConfigWebpack, TypescriptOptions as TypescriptOptionsBuilder, } from '@storybook/builder-webpack5'; import type { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact, } fro...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/server-webpack5/src/index.ts
code/frameworks/server-webpack5/src/index.ts
export * from '@storybook/server'; export * from './types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/server-webpack5/src/node/index.ts
code/frameworks/server-webpack5/src/node/index.ts
import type { StorybookConfig } from '../types'; export function defineMain(config: StorybookConfig) { return config; } export type { StorybookConfig };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/build-config.ts
code/frameworks/html-vite/build-config.ts
import type { BuildEntries } from '../../../scripts/build/utils/entry-utils'; const config: BuildEntries = { entries: { browser: [ { exportEntries: ['.'], entryPoint: './src/index.ts', }, ], node: [ { exportEntries: ['./preset'], entryPoint: './src/preset...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/src/preset.ts
code/frameworks/html-vite/src/preset.ts
import type { PresetProperty } from 'storybook/internal/types'; export const core: PresetProperty<'core'> = { builder: import.meta.resolve('@storybook/builder-vite'), renderer: import.meta.resolve('@storybook/html/preset'), };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/src/types.ts
code/frameworks/html-vite/src/types.ts
import type { CompatibleString, StorybookConfig as StorybookConfigBase, } from 'storybook/internal/types'; import type { BuilderOptions, StorybookConfigVite } from '@storybook/builder-vite'; type FrameworkName = CompatibleString<'@storybook/html-vite'>; type BuilderName = CompatibleString<'@storybook/builder-vite...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/src/index.ts
code/frameworks/html-vite/src/index.ts
export * from '@storybook/html'; export * from './types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/src/node/index.ts
code/frameworks/html-vite/src/node/index.ts
import type { StorybookConfig } from '../types'; export function defineMain(config: StorybookConfig) { return config; } export type { StorybookConfig };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/template/cli/ts/Button.stories.ts
code/frameworks/html-vite/template/cli/ts/Button.stories.ts
import type { Meta, StoryObj } from '@storybook/html-vite'; import { fn } from 'storybook/test'; import type { ButtonProps } from './Button'; import { createButton } from './Button'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export const meta = { title: 'Example/But...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/template/cli/ts/Page.stories.ts
code/frameworks/html-vite/template/cli/ts/Page.stories.ts
import type { Meta, StoryObj } from '@storybook/html-vite'; import { expect, userEvent, within } from 'storybook/test'; import { createPage } from './Page'; const meta = { title: 'Example/Page', render: () => createPage(), parameters: { // More on how to position stories at: https://storybook.js.org/docs/c...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/template/cli/ts/Header.ts
code/frameworks/html-vite/template/cli/ts/Header.ts
import { createButton } from './Button'; import './header.css'; export interface HeaderProps { user?: { name: string }; onLogin?: () => void; onLogout?: () => void; onCreateAccount?: () => void; } export const createHeader = ({ user, onLogout, onLogin, onCreateAccount }: HeaderProps) => { const header = doc...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/template/cli/ts/Button.ts
code/frameworks/html-vite/template/cli/ts/Button.ts
import './button.css'; export interface ButtonProps { /** Is this the principal call to action on the page? */ primary?: boolean; /** What background color to use */ backgroundColor?: string; /** How large should the button be? */ size?: 'small' | 'medium' | 'large'; /** Button contents */ label: strin...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/template/cli/ts/Header.stories.ts
code/frameworks/html-vite/template/cli/ts/Header.stories.ts
import type { Meta, StoryObj } from '@storybook/html-vite'; import { fn } from 'storybook/test'; import type { HeaderProps } from './Header'; import { createHeader } from './Header'; const meta = { title: 'Example/Header', // This component will have an automatically generated Autodocs entry: https://storybook.j...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/frameworks/html-vite/template/cli/ts/Page.ts
code/frameworks/html-vite/template/cli/ts/Page.ts
import { createHeader } from './Header'; import './page.css'; type User = { name: string; }; export const createPage = () => { const article = document.createElement('article'); let user: User | undefined; let header: HTMLElement | null = null; const rerenderHeader = () => { const wrapper = document.ge...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/vitest.config.ts
code/lib/eslint-plugin/vitest.config.ts
import { defineConfig, mergeConfig } from 'vitest/config'; import { vitestCommonConfig } from '../../vitest.shared'; export default mergeConfig( vitestCommonConfig, defineConfig({ test: { setupFiles: ['./vitest-setup.ts'], }, }) );
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/vitest.integration.config.ts
code/lib/eslint-plugin/vitest.integration.config.ts
import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { include: ['**/tests/**/*.spec.ts'], environment: 'node', globals: true, testTimeout: 60000, }, });
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/vitest-setup.ts
code/lib/eslint-plugin/vitest-setup.ts
import * as vitest from 'vitest'; import { RuleTester } from '@typescript-eslint/rule-tester'; // https://typescript-eslint.io/packages/rule-tester/#vitest RuleTester.afterAll = vitest.afterAll; RuleTester.it = vitest.it; RuleTester.itOnly = vitest.it.only; RuleTester.describe = vitest.describe;
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/build-config.ts
code/lib/eslint-plugin/build-config.ts
import path from 'node:path'; import { x as exec } from 'tinyexec'; import type { BuildEntries } from '../../../scripts/build/utils/entry-utils'; const config: BuildEntries = { prebuild: async (cwd) => { await exec('jiti', [path.join(import.meta.dirname, 'scripts', 'update-all.ts')], { nodeOptions: { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/update-lib-index.ts
code/lib/eslint-plugin/scripts/update-lib-index.ts
'use strict'; /* This script updates `src/index.js` file from rule's meta data. */ import fs from 'fs/promises'; import path from 'path'; import type { Options } from 'prettier'; import { format } from 'prettier'; // @ts-expect-error this file has no types import prettierConfig from '../../../../prettier.config.mjs';...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/update-lib-configs.ts
code/lib/eslint-plugin/scripts/update-lib-configs.ts
/* This script updates `lib/configs/*.js` files from rule's meta data. */ import fs from 'node:fs/promises'; import path from 'node:path'; import type { Options } from 'prettier'; import { format } from 'prettier'; // @ts-expect-error this file has no types import prettierConfig from '../../../../prettier.config.mjs'...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/generate-rule.ts
code/lib/eslint-plugin/scripts/generate-rule.ts
import cp from 'node:child_process'; import fs from 'node:fs/promises'; import path from 'node:path'; import type { PromptObject } from 'prompts'; import prompts from 'prompts'; import { dedent } from 'ts-dedent'; const logger = console; type Answers = { authorName: string; ruleId: string; ruleDescription: str...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/update-lib-flat-configs.ts
code/lib/eslint-plugin/scripts/update-lib-flat-configs.ts
/* This script updates `lib/configs/flat/*.js` files from rule's meta data. */ import fs from 'node:fs/promises'; import path from 'node:path'; import type { Options } from 'prettier'; import { format } from 'prettier'; // @ts-expect-error this file has no types import prettierConfig from '../../../../prettier.config...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/update-configs.ts
code/lib/eslint-plugin/scripts/update-configs.ts
/* This script updates `lib/*.js` files from rule's meta data. */ import fs from 'fs/promises'; import path from 'path'; import { update as updateLegacyConfigs } from './update-lib-configs'; import { update as updateFlatConfigs } from './update-lib-flat-configs'; import { update as updateIndex } from './update-lib-ind...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/update-rules-list.ts
code/lib/eslint-plugin/scripts/update-rules-list.ts
import { emojiKey, updateRulesDocs, writeRulesListInReadme } from './utils/docs'; import rules from './utils/rules'; import { extendsCategories } from './utils/updates'; /* This script updates the rules table in `README.md`from rule's meta data. */ export type TRulesList = readonly [ ruleName: string, ruleLink: s...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/update-all.ts
code/lib/eslint-plugin/scripts/update-all.ts
async function run() { await import('./update-configs'); await import('./update-rules-list'); } run().catch((error) => { console.error(error); process.exit(1); });
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/utils/rules.ts
code/lib/eslint-plugin/scripts/utils/rules.ts
import fs from 'fs'; import path from 'path'; import type { StorybookRuleMeta } from '../../src/types'; import type { createStorybookRule } from '../../src/utils/create-storybook-rule'; const ROOT = path.resolve(__dirname, '../../src/rules'); export type TRule = ReturnType<typeof createStorybookRule> & { meta: Sto...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/utils/updates.ts
code/lib/eslint-plugin/scripts/utils/updates.ts
import type { CategoryId } from '../../src/utils/constants'; import type { TCategory } from './categories'; export const extendsCategories: Partial<Record<CategoryId, string | null>> = { csf: null, recommended: null, 'csf-strict': 'csf', }; const externalRuleOverrides: { [key: string]: string } = { 'react-hoo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/utils/categories.ts
code/lib/eslint-plugin/scripts/utils/categories.ts
import { CategoryId } from '../../src/utils/constants'; import type { TRules } from './rules'; import rules from './rules'; type TCategoriesConfig = Record<string, { text: string; rules: TRules }>; const categoriesConfig: TCategoriesConfig = { [CategoryId.CSF]: { text: 'CSF Rules', rules: [], }, [Catego...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/scripts/utils/docs.ts
code/lib/eslint-plugin/scripts/utils/docs.ts
import { readFile, writeFile } from 'fs/promises'; import { resolve } from 'path'; import { format, resolveConfig } from 'prettier'; import type { TRuleListWithoutName, TRulesList } from '../update-rules-list'; import { categoryIds } from './categories'; const prettierConfig = resolveConfig(__dirname); const readmePa...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/test-utils.ts
code/lib/eslint-plugin/src/test-utils.ts
import { RuleTester } from '@typescript-eslint/rule-tester'; import type { TSESLint } from '@typescript-eslint/utils'; const DEFAULT_TEST_CASE_CONFIG = { filename: 'MyComponent.stories.js', }; class StorybookRuleTester extends RuleTester { run<TMessageIds extends string, TOptions extends Readonly<unknown[]>>( ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/index.ts
code/lib/eslint-plugin/src/index.ts
/* * IMPORTANT! * This file has been automatically generated, * in order to update its content execute "yarn update" */ // configs import addonInteractions from './configs/addon-interactions'; import csf from './configs/csf'; import csfStrict from './configs/csf-strict'; import flatAddonInteractions from './configs...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/await-interactions.test.ts
code/lib/eslint-plugin/src/rules/await-interactions.test.ts
/** * @file Interactions should be awaited * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { dedent } from 'ts-dedent'; import rule from '../rules/await-in...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-redundant-story-name.test.ts
code/lib/eslint-plugin/src/rules/no-redundant-story-name.test.ts
/** * @file Named exports should not use the name annotation if it is redundant to the name that would * be generated by the export name * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/meta-inline-properties.ts
code/lib/eslint-plugin/src/rules/meta-inline-properties.ts
/** * @file Meta should have inline properties * @author Yann Braga */ import type { TSESTree } from '@typescript-eslint/utils'; import { getMetaObjectExpression } from '../utils'; import { CategoryId } from '../utils/constants'; import { createStorybookRule } from '../utils/create-storybook-rule'; type TDynamicPr...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/csf-component.test.ts
code/lib/eslint-plugin/src/rules/csf-component.test.ts
/** * @file Component property should be set * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rul...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/use-storybook-testing-library.test.ts
code/lib/eslint-plugin/src/rules/use-storybook-testing-library.test.ts
/** * @file Do not testing library directly on stories * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-redundant-story-name.ts
code/lib/eslint-plugin/src/rules/no-redundant-story-name.ts
/** * @file Named exports should not use the name annotation if it is redundant to the name that would * be generated by the export name * @author Yann Braga */ import { storyNameFromExport } from 'storybook/internal/csf'; import { isExpressionStatement, isIdentifier, isLiteral, isMetaProperty, isObjec...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/meta-satisfies-type.ts
code/lib/eslint-plugin/src/rules/meta-satisfies-type.ts
/** * @file Meta should be followed by `satisfies Meta` * @author Tiger Oakes */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ASTUtils, AST_NODE_TYPES } from '@typescript-eslint/utils'; import { getMetaObjectExpression } from '../utils'; import { isTSSatisfiesExpression } from '../ut...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-uninstalled-addons.ts
code/lib/eslint-plugin/src/rules/no-uninstalled-addons.ts
/** * @file This rule identifies storybook addons that are invalid because they are either not * installed or contain a typo in their name. * @author Andre "andrelas1" Santos */ import type { TSESTree } from '@typescript-eslint/utils'; import { readFileSync } from 'fs'; import { relative, resolve, sep } from 'pat...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-title-property-in-meta.ts
code/lib/eslint-plugin/src/rules/no-title-property-in-meta.ts
/** * @file No title property in meta * @author Yann Braga */ import type { TSESTree } from '@typescript-eslint/utils'; import { getMetaObjectExpression } from '../utils'; import { isSpreadElement } from '../utils/ast'; import { CategoryId } from '../utils/constants'; import { createStorybookRule } from '../utils/c...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/use-storybook-expect.test.ts
code/lib/eslint-plugin/src/rules/use-storybook-expect.test.ts
/** * @file Use expect from '@storybook/jest' * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { d...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/await-interactions.ts
code/lib/eslint-plugin/src/rules/await-interactions.ts
/** * @file Interactions should be awaited * @author Yann Braga */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { isArrowFunctionExpression, isAwaitExpression, isCallExpression, isFunctionDeclaration, isFunctionExpression, isIdentifier, isImportSpecifier, isMemberExpres...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/prefer-pascal-case.ts
code/lib/eslint-plugin/src/rules/prefer-pascal-case.ts
/** * @file Prefer pascal case * @author Yann Braga */ import type { IncludeExcludeOptions } from 'storybook/internal/csf'; import { isExportStory } from 'storybook/internal/csf'; import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ASTUtils } from '@typescript-eslint/utils'; import { getDe...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/meta-inline-properties.test.ts
code/lib/eslint-plugin/src/rules/meta-inline-properties.test.ts
/** * @file Meta should have inline properties * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-title-property-in-meta.test.ts
code/lib/eslint-plugin/src/rules/no-title-property-in-meta.test.ts
/** * @file No title property in meta * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { dedent } ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/default-exports.ts
code/lib/eslint-plugin/src/rules/default-exports.ts
/** * @file Story files should have a default export * @author Yann Braga */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import path from 'path'; import { isIdentifier, isImportDeclaration, isLiteral } from '../utils/ast'; import { CategoryId } from '../utils/constants'; import { createStory...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/use-storybook-expect.ts
code/lib/eslint-plugin/src/rules/use-storybook-expect.ts
/** * @file Use expect from '@storybook/jest' * @author Yann Braga */ import type { TSESTree } from '@typescript-eslint/utils'; import { isIdentifier, isImportSpecifier } from '../utils/ast'; import { CategoryId } from '../utils/constants'; import { createStorybookRule } from '../utils/create-storybook-rule'; //--...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/context-in-play-function.ts
code/lib/eslint-plugin/src/rules/context-in-play-function.ts
/** * @file Pass a context object when invoking a play function * @author Yann Braga */ import type { TSESTree } from '@typescript-eslint/utils'; import { isArrowFunctionExpression, isIdentifier, isMemberExpression, isObjectExpression, isObjectPattern, isRestElement, isSpreadElement, isTSNonNullExpr...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/prefer-pascal-case.test.ts
code/lib/eslint-plugin/src/rules/prefer-pascal-case.test.ts
/** * @file Prefer pascal case * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { dedent } from 't...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-stories-of.test.ts
code/lib/eslint-plugin/src/rules/no-stories-of.test.ts
/** * @file StoriesOf is deprecated and should not be used * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-eslint/utils...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/hierarchy-separator.ts
code/lib/eslint-plugin/src/rules/hierarchy-separator.ts
/** * @file Deprecated hierarchy separator * @author Yann Braga */ import type { TSESTree } from '@typescript-eslint/utils'; import { getMetaObjectExpression } from '../utils'; import { isLiteral, isSpreadElement } from '../utils/ast'; import { CategoryId } from '../utils/constants'; import { createStorybookRule } ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/story-exports.ts
code/lib/eslint-plugin/src/rules/story-exports.ts
/** * @file A story file must contain at least one story export * @author Yann Braga */ import type { IncludeExcludeOptions } from 'storybook/internal/csf'; import type { TSESTree } from '@typescript-eslint/utils'; import { getAllNamedExports, getDescriptor, getMetaObjectExpression, isValidStoryExport, } f...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/hierarchy-separator.test.ts
code/lib/eslint-plugin/src/rules/hierarchy-separator.test.ts
/** * @file Deprecated hierarchy separator * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { dede...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-renderer-packages.ts
code/lib/eslint-plugin/src/rules/no-renderer-packages.ts
/** * @file Do not import renderer packages directly in stories * @author Norbert De Langen */ import type { TSESTree } from '@typescript-eslint/utils'; import { CategoryId } from '../utils/constants'; import { createStorybookRule } from '../utils/create-storybook-rule'; type RendererPackage = | '@storybook/html...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-stories-of.ts
code/lib/eslint-plugin/src/rules/no-stories-of.ts
/** * @file StoriesOf is deprecated and should not be used * @author Yann Braga */ import { CategoryId } from '../utils/constants'; import { createStorybookRule } from '../utils/create-storybook-rule'; //------------------------------------------------------------------------------ // Rule Definition //------------...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/default-exports.test.ts
code/lib/eslint-plugin/src/rules/default-exports.test.ts
/** * @file Story files should have a default export * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { dedent } from 'ts-dedent'; import ruleTester from '....
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-uninstalled-addons.test.ts
code/lib/eslint-plugin/src/rules/no-uninstalled-addons.test.ts
/** * @file This rule identifies storybook addons that are invalid because they are either not * installed or contain a typo in their name. * @author Andre "andrelas1" Santos */ //------------------------------------------------------------------------------ // Requirements //-------------------------------------...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/no-renderer-packages.test.ts
code/lib/eslint-plugin/src/rules/no-renderer-packages.test.ts
/** * @file Do not import renderer packages directly in stories * @author Norbert De Langen */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { AST_NODE_TYPES } from '@typescript-...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/use-storybook-testing-library.ts
code/lib/eslint-plugin/src/rules/use-storybook-testing-library.ts
/** * @file Do not use testing library directly on stories * @author Yann Braga */ import type { TSESTree } from '@typescript-eslint/utils'; import { isImportDefaultSpecifier } from '../utils/ast'; import { CategoryId } from '../utils/constants'; import { createStorybookRule } from '../utils/create-storybook-rule';...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/csf-component.ts
code/lib/eslint-plugin/src/rules/csf-component.ts
/** * @file Component property should be set * @author Yann Braga */ import type { TSESTree } from '@typescript-eslint/utils'; import { getMetaObjectExpression } from '../utils'; import { isSpreadElement } from '../utils/ast'; import { CategoryId } from '../utils/constants'; import { createStorybookRule } from '../...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/story-exports.test.ts
code/lib/eslint-plugin/src/rules/story-exports.test.ts
/** * @file A story file must contain at least one story export * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { dedent } from 'ts-dedent'; import ruleTes...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/lib/eslint-plugin/src/rules/context-in-play-function.test.ts
code/lib/eslint-plugin/src/rules/context-in-play-function.test.ts
/** * @file Pass a context object when invoking a play function * @author Yann Braga */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ import { dedent } from 'ts-dedent'; import ruleTes...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false