mirror of
https://github.com/evroon/bracket.git
synced 2026-07-31 02:10:50 -04:00
This PR migrates formatting in `frontend/` from Prettier to `oxfmt`,
including script wiring and dependency cleanup. It removes the Prettier
plugin/config path so formatting is handled by a single tool.
- **Script migration**
- Renamed/rewired formatting scripts in `frontend/package.json`:
- `prettier:check` → `format:check` (`oxfmt --check .`)
- `prettier:write` → `format:write` (`oxfmt .`)
- Updated dependent scripts:
- `test` now runs `pnpm run format:write`
- `openapi-ts` now runs `pnpm run format:write` after generation
- **Dependency cleanup**
- Removed `prettier-plugin-organize-imports` from `dependencies`
- Removed `prettier` from `devDependencies`
- Added `oxfmt` (latest stable at update time)
- **Config removal**
- Deleted `frontend/.prettierrc.js` (no longer used after migration)
- **Lockfile alignment**
- Updated `frontend/pnpm-lock.yaml` to reflect the dependency and script
ecosystem change
```json
{
"scripts": {
"format:check": "oxfmt --check .",
"format:write": "oxfmt .",
"openapi-ts": "openapi-ts && pnpm run format:write",
"test": "tsc && pnpm run format:write"
}
}
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Erik Vroon <11857441+evroon@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
57 lines
2.0 KiB
TypeScript
57 lines
2.0 KiB
TypeScript
import * as React from "react";
|
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
import { ChevronDown } from "lucide-react";
|
|
|
|
import { cn } from "lib/utils";
|
|
|
|
const Accordion = AccordionPrimitive.Root;
|
|
|
|
const AccordionItem = React.forwardRef<
|
|
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
>(({ className, ...props }, ref) => (
|
|
<AccordionPrimitive.Item
|
|
ref={ref}
|
|
className={cn("border-border border-b", className)}
|
|
{...props}
|
|
/>
|
|
));
|
|
AccordionItem.displayName = "AccordionItem";
|
|
|
|
const AccordionTrigger = React.forwardRef<
|
|
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
>(({ className, children, ...props }, ref) => (
|
|
<AccordionPrimitive.Header className="flex">
|
|
<AccordionPrimitive.Trigger
|
|
ref={ref}
|
|
className={cn(
|
|
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
className,
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
</AccordionPrimitive.Trigger>
|
|
</AccordionPrimitive.Header>
|
|
));
|
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
|
|
const AccordionContent = React.forwardRef<
|
|
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
>(({ className, children, ...props }, ref) => (
|
|
<AccordionPrimitive.Content
|
|
ref={ref}
|
|
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
{...props}
|
|
>
|
|
<div className={cn("pb-4 pt-0 text-muted-foreground text-[16px]", className)}>{children}</div>
|
|
</AccordionPrimitive.Content>
|
|
));
|
|
|
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
|
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|