unocss-preset-forms
unocss-preset-forms copied to clipboard
Auto import gives invalid `import { presetForms } from "@julr/unocss-preset-forms/index";`
minor issue but the auto import gives import { presetForms } from "@julr/unocss-preset-forms/index";
instead of import { presetForms } from "@julr/unocss-preset-forms";
.
repro:
- have no import statement.
- install "@julr/unocss-preset-forms";
- write
presetForms();
in the presets config and select the autoimport
Looks like a moduleResolution
related problem or something like that. Could you share tsconfig please?
Otherwise, happy to receive a PR for that :pray:
Not sure how to fix it so I can't make a PR. It works for https://github.com/unpreset/unocss-preset-theme for example (no /index in that import) but I get /index here.
tsconfig.ts
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}
extended one
{
"compilerOptions": {
"paths": {
"$lib": [
"../src/lib"
],
"$lib/*": [
"../src/lib/*"
]
},
"rootDirs": [
"..",
"./types"
],
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"preserveValueImports": true,
"lib": [
"esnext",
"DOM",
"DOM.Iterable"
],
"moduleResolution": "node",
"module": "esnext",
"target": "esnext",
"ignoreDeprecations": "5.0"
},
"include": [
"ambient.d.ts",
"./types/**/$types.d.ts",
"../vite.config.ts",
"../src/**/*.js",
"../src/**/*.ts",
"../src/**/*.svelte",
"../tests/**/*.js",
"../tests/**/*.ts",
"../tests/**/*.svelte"
],
"exclude": [
"../node_modules/**",
"./[!ambient.d.ts]**",
"../src/service-worker.js",
"../src/service-worker.ts",
"../src/service-worker.d.ts"
]
}
Thanks ! Gonna take a look asap