Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
twlite committed Jan 13, 2025
1 parent 7e476f7 commit e6c423b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/docs/components/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Accordions = forwardRef<
| Omit<AccordionMultipleProps, 'value' | 'onValueChange'>
>(({ type = 'single', className, defaultValue, ...props }, ref) => {
const [value, setValue] = useState<string | string[]>(
type === 'single' ? defaultValue ?? '' : defaultValue ?? [],
type === 'single' ? (defaultValue ?? '') : (defaultValue ?? []),
);

useEffect(() => {
Expand Down
5 changes: 3 additions & 2 deletions apps/docs/components/layout/language-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ export function LanguageToggleText(
props: HTMLAttributes<HTMLSpanElement>,
): React.ReactElement {
const context = useI18n();
const text = context.locales?.find((item) => item.locale === context.locale)
?.name;
const text = context.locales?.find(
(item) => item.locale === context.locale,
)?.name;

return <span {...props}>{text}</span>;
}
13 changes: 7 additions & 6 deletions packages/commandkit/bin/esbuild-plugins/use-cache.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const generate = _generate.default || _generate;

const IMPORT_PATH = 'commandkit';
const DIRECTIVE = 'use cache';
const CACHE_IDENTIFIER = 'unstable_super_duper_secret_internal_for_use_cache_directive_of_commandkit_cli_do_not_use_it_directly_or_you_will_be_fired_kthxbai';
const CACHE_IDENTIFIER =
'unstable_super_duper_secret_internal_for_use_cache_directive_of_commandkit_cli_do_not_use_it_directly_or_you_will_be_fired_kthxbai';

const generateRandomString = (length = 6) => {
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
Expand Down Expand Up @@ -115,11 +116,11 @@ export const cacheDirectivePlugin = () => {
// Create a new body without the 'use cache' directive
const newBody = t.isBlockStatement(path.node.body)
? t.blockStatement(
path.node.body.body,
path.node.body.directives.filter(
(d) => d.value.value !== DIRECTIVE,
),
)
path.node.body.body,
path.node.body.directives.filter(
(d) => d.value.value !== DIRECTIVE,
),
)
: path.node.body;

const wrapped = t.callExpression(
Expand Down

0 comments on commit e6c423b

Please sign in to comment.