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

Cannot exclude stories.ts file from auto import #407

Closed
5 tasks done
BrachyKnight opened this issue Jul 7, 2023 · 1 comment
Closed
5 tasks done

Cannot exclude stories.ts file from auto import #407

BrachyKnight opened this issue Jul 7, 2023 · 1 comment

Comments

@BrachyKnight
Copy link

BrachyKnight commented Jul 7, 2023

Describe the bug

I'm trying to exclude all *.stories.ts files from the autoimport plugin, since the export is only needed for storybook and nothing else.
I have tried with two methods:

  1. Adding the exclude property in the config object with an array as follows [\.stories.ts\.ts$];
  2. Using a negative lookbehind in the include array regex as follows: include: [/(?<!(stories))(\.[tj]sx?)$/]
    It seems that either they are not working or I am missing something. From the documentation I couln't work out if I am doing something wron

Reproduction

AutoImport({include: [ /(?<!(stories))(\.[tj]sx?)$/],)}

System Info

System:
    OS: Linux 5.15 Alpine Linux
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1255U
    Memory: 2.84 GB / 4.81 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
    pnpm: 8.6.6 - ~/.nvm/versions/node/v18.15.0/bin/pnpm

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 Jul 8, 2023

We temporarily close this due to the lack of enough information.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

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

2 participants