Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

A dynamic import with template string literal is not found by depcheck #779

@ArtskydJ

Description

@ArtskydJ

Bug Description

Depcheck is not aware that a dependency is used if it's imported with a dynamic import with a template string literal.

Code snippets

Where the dependency is used:

const micromark = await import(`micromark`)

Where the dependency is listed in package.json:

{
	"dependencies": {
		"micromark": "^3.1.0",
		...
	}
}

Versions

  • node -v: 16.19.0
  • npm -v: 8.19.3
  • depcheck --version: 1.4.3

Extra info

The exact same code, but replacing ticks with quotes works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions