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

fix(types): add missing options parameter to importMeta #6433

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

OysterD3
Copy link
Contributor

Description

The new feature to import as raw was merged but IDE will display an error because the typings only accept the pattern and don't allow the options. #5545

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@Shinigami92 Shinigami92 added the p2-nice-to-have Not breaking anything but nice to have (priority) label Jan 11, 2022
@patak-dev patak-dev merged commit ccf7d79 into vitejs:main Jan 11, 2022
glob(pattern: string): Record<
glob(
pattern: string,
options?: AssertOptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review. But we can't import types in this ambient type module. It will fail to provide completion for Vite client types. So we need to import like import('../src/node/importGlob').AssertOptions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can we have ESLint warns about type importing? I couldn't find like /* eslint-warn @typescript-eslint/consistent-type-imports */

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ydcjeff thanks for being on top of this, would you make a PR with the needed changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants