Closed IgnusG closed 2 weeks ago
Is there any update on this? Apart from affecting the indentation i am also noticing that the import path gets modified with the path from the previous import.
Before:
<script lang="ts">
import { theme } from "@/theme/main.treat"
import { BORDER_RADIUS, BOX_SHADOW, FONT_FAMILY } from "@/theme/constants"
import { cssColorVars, cssFontWeightVars } from "@/utils/styles"
import type { Host } from "."
import BaseTemplate from "./template/base.svelte"
import "./app.css"
import Routes from "./routes"
import { config } from "./store"
</script>
After:
<script lang="ts">
import { theme } from "@/theme/main.treat"
import { BORDER_RADIUS, BOX_SHADOW, FONT_FAMILY } from "@/theme/constants"
import { cssColorVars, cssFontWeightVars } from "@/utils/styles"
import BaseTemplate from "./template/base.svelte"
import "./app.css"
import Routes from "./routes"
import { config } from "./store"
import type { Host } from ".tore" // eslint modifies import path
</script>
The automatic re-ordering of imports seems to remove the indentation of the imports. I feel like this is because it sees them as top level inside of the script tag. This causes some of the statements to be distorted (see
ZocreateEventDispatcher
),I've noticed the auto-import from the svelte extension for VS Code also places imports to the edge instead of respecting the indent so maybe it's a setting I missed?
Input
Output:
Expected
It works correctly without the indentation (if I write the code like this):
package.json
.eslintrc.js