mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
36 lines
911 B
Plaintext
36 lines
911 B
Plaintext
```ts
|
|
// .storybook/preview.ts
|
|
|
|
// Replace your-framework with the framework you are using (e.g., react, vue3)
|
|
import { Preview } from '@storybook/your-framework';
|
|
|
|
const preview: Preview = {
|
|
parameters: {
|
|
a11y: {
|
|
// Optional selector to inspect
|
|
element: '#storybook-root',
|
|
config: {
|
|
rules: [
|
|
{
|
|
// The autocomplete rule will not run based on the CSS selector provided
|
|
id: 'autocomplete-valid',
|
|
selector: '*:not([autocomplete="nope"])',
|
|
},
|
|
{
|
|
// Setting the enabled option to false will disable checks for this particular rule on all stories.
|
|
id: 'image-alt',
|
|
enabled: false,
|
|
},
|
|
],
|
|
},
|
|
// Axe's options parameter
|
|
options: {},
|
|
// Optional flag to prevent the automatic check
|
|
manual: true,
|
|
},
|
|
},
|
|
};
|
|
|
|
export default preview;
|
|
```
|