What version of Oxlint are you using?
1.57.0
What command did you run?
bunx oxlint --fix .
What does your .oxlintrc.json (or oxlint.config.ts) config file look like?
What happened?
Running the autofix for eslint/sort-keys broke the following code from shadcn/ui Sidebar
Before:
const sidebarMenuButtonVariants = cva(
"peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
{
defaultVariants: {
variant: "default",
size: "default",
},
variants: {
variant: {
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
outline:
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
},
size: {
default: "h-8 text-sm",
sm: "h-7 text-xs",
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
},
},
},
);
After:
const sidebarMenuButtonVariants = cva(
"peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
{
defaultVariants: {
size: "default",
variant: "default",
},
variants: {
size: {
default: "h-8 text-sm",
sm: "h-7 text-xs",
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
},
variant: {
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
outline:
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
}default: "h-8 text-sm",
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
sm: "h-7 text-xs",
},
},
},
);
Note the }default: "h-8 text-sm". It looks like it moved the size key into the sibling variant property.
I'm guessing it's a case of it not handling multi-line values correctly.
What version of Oxlint are you using?
1.57.0
What command did you run?
bunx oxlint --fix .What does your
.oxlintrc.json(oroxlint.config.ts) config file look like?{ "$schema": "./node_modules/oxlint/configuration_schema.json", "plugins": ["eslint", "typescript", "unicorn", "oxc", "react", "jsx-a11y", "import"], "categories": { "correctness": "error", "suspicious": "error", "perf": "error", "style": "error", "restriction": "error", "pedantic": "warn", "nursery": "off" }, "env": { "browser": true, "es2022": true }, "ignorePatterns": [ "**/convex/_generated/**", "**/src/routeTree.gen.ts", "**/dist/**", "**/*.generated.ts", "**/*.generated.json", "**/node_modules/**" ], }What happened?
Running the autofix for
eslint/sort-keysbroke the following code from shadcn/ui SidebarBefore:
After:
Note the
}default: "h-8 text-sm". It looks like it moved thesizekey into the siblingvariantproperty.I'm guessing it's a case of it not handling multi-line values correctly.