-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
I have a codebase that uses different values for different web-mode indentation variables within .tsx files. For example:
(setq web-mode-code-indent-offset 2)
(setq web-mode-markup-indent-offset 4)Here's some code written this way:
import Menu from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
import { useCallback } from "react";
export default function FooBarMenu() {
const fooCallback = useCallback(() => {
console.log("foo");
}, []);
return (
<Menu label="Foo"
disabled={false}>
<MenuItem className=""
onClick={fooCallback}>
Foo
</MenuItem>
</Menu>
);
}When I run dtrt-indent-diagnosis, it says "Guessed offset 2 with 100% confidence" and sets all my variables to 2. No doubt because it expects them all to be the same; see here.
Unfortunately this is probably hard to fix because it requires a more detailed understanding of JSX/TSX files.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels