Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package name with dot is not imported properly #463

Open
5 tasks done
gokhantaskan opened this issue Dec 24, 2023 · 2 comments
Open
5 tasks done

Package name with dot is not imported properly #463

gokhantaskan opened this issue Dec 24, 2023 · 2 comments

Comments

@gokhantaskan
Copy link

gokhantaskan commented Dec 24, 2023

Describe the bug

When I try to import twin.macro:

AutoImport({
  dirs: [],
  imports: [
    "react",
    "react-router-dom",
    {
      ...,
      "twin.macro": [["default", "tw"], "css", "styled", "theme"],
    },
  ],
  eslintrc: {
    enabled: true,
  },
}), 

it generates the following code:

// Should be 'twin.macro'
const styled: typeof import('twin')['styled']
const theme: typeof import('twin')['theme']
const tw: typeof import('twin')['default']
const css: typeof import('twin')['css']

As you can see, it removes the dot and the following string.

Reproduction

https://stackblitz.com/edit/vitejs-vite-nercgp?file=auto-imports.d.ts

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
    Memory: 11.30 GB / 31.71 GB
  Binaries:
    Node: 18.18.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.2.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.11.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.91)
    Internet Explorer: 11.0.22621.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@antfu
Copy link
Member

antfu commented Dec 25, 2023

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

@antfu antfu closed this as completed Dec 25, 2023
@gokhantaskan
Copy link
Author

Hi antfu,

Here is the repro link: https://stackblitz.com/edit/vitejs-vite-nercgp?file=auto-imports.d.ts

@userquin userquin reopened this Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants