diff --git a/code/lib/codemod/src/index.ts b/code/lib/codemod/src/index.ts index dafb69513fd5..0bc3f4d1b3db 100644 --- a/code/lib/codemod/src/index.ts +++ b/code/lib/codemod/src/index.ts @@ -47,6 +47,7 @@ export async function runCodemod(codemod: any, { glob, logger, dryRun, rename, p // jscodeshift/prettier know how to handle .ts/.tsx extensions, // so if the user uses one of those globs, we can auto-infer let inferredParser = parser; + if (!parser) { const extension = path.extname(glob).slice(1); const knownParser = jscodeshiftToPrettierParser(extension); @@ -54,7 +55,11 @@ export async function runCodemod(codemod: any, { glob, logger, dryRun, rename, p } const files = await globby([glob, '!**/node_modules', '!**/dist']); + const extensions = new Set(files.map((file) => path.extname(file).slice(1))); + const commaSeparatedExtensions = Array.from(extensions).join(','); + logger.log(`=> Applying ${codemod}: ${files.length} files`); + if (files.length === 0) { logger.log(`=> No matching files for glob: ${glob}`); return; @@ -70,6 +75,7 @@ export async function runCodemod(codemod: any, { glob, logger, dryRun, rename, p // which is faster, and also makes sure the user won't see babel messages such as: // [BABEL] Note: The code generator has deoptimised the styling of repo/node_modules/prettier/index.js as it exceeds the max of 500KB. '--no-babel', + `--extensions=${commaSeparatedExtensions}`, '--fail-on-error', '-t', `${TRANSFORM_DIR}/${codemod}.js`, diff --git a/code/ui/components/src/components/typography/link/link.tsx b/code/ui/components/src/components/typography/link/link.tsx index fb26a03a0df4..50a46440cbbd 100644 --- a/code/ui/components/src/components/typography/link/link.tsx +++ b/code/ui/components/src/components/typography/link/link.tsx @@ -184,12 +184,13 @@ export interface LinkProps extends LinkInnerProps, LinkStylesProps { } export const Link: FC = ({ - cancel, + cancel = true, children, - onClick, - withArrow, - containsIcon, - className, + onClick = undefined, + withArrow = false, + containsIcon = false, + className = undefined, + style = undefined, ...rest }) => ( = ({ ); - -Link.defaultProps = { - cancel: true, - className: undefined, - style: undefined, - onClick: undefined, - withArrow: false, - containsIcon: false, -}; diff --git a/docs/faq.md b/docs/faq.md index 5fff9ff77bfb..50ebca8baaf5 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -21,7 +21,7 @@ Here are some answers to frequently asked questions. If you have a question, you - [I see a "No Preview" error with a Storybook production build](#i-see-a-no-preview-error-with-a-storybook-production-build) - [Can I use Storybook with Vue 2?](#can-i-use-storybook-with-vue-2) - [Why aren't my code blocks highlighted with Storybook MDX](#why-arent-my-code-blocks-highlighted-with-storybook-mdx) -- [Why aren't my MDX 2 stories working in Storybook?](#why-arent-my-mdx-2-stories-working-in-storybook) +- [Why aren't my MDX stories working in Storybook?](#why-arent-my-mdx-stories-working-in-storybook) - [Why are my mocked GraphQL queries failing with Storybook's MSW addon?](#why-are-my-mocked-graphql-queries-failing-with-storybooks-msw-addon) - [Can I use other GraphQL providers with Storybook's MSW addon?](#can-i-use-other-graphql-providers-with-storybooks-msw-addon) - [Can I mock GraphQL mutations with Storybook's MSW addon?](#can-i-mock-graphql-mutations-with-storybooks-msw-addon) @@ -383,9 +383,9 @@ Vue 2 entered [End of Life](https://v2.vuejs.org/lts/) (EOL) on December 31, 202 Out of the box, Storybook provides syntax highlighting for a set of languages (e.g., Javascript, Markdown, CSS, HTML, Typescript, GraphQL) you can use with your code blocks. Currently, there's a known limitation when you try and register a custom language to get syntax highlighting. We're working on a fix for this And will update this section once it's available. -## Why aren't my MDX 2 stories working in Storybook? +## Why aren't my MDX stories working in Storybook? -MDX 2 introduced some changes to how the code is rendered. For example, if you enabled it in your Storybook and you have the following code block: +MDX can be picky about how your code is formatted with line breaks. This is especially true with code blocks. For example, this will break: ```