Skip to content

Unused dependencies validation is not working #524

@kricsleo

Description

@kricsleo

Environment

[email protected]

Reproduction

https://stackblitz.com/edit/github-8qb4tr6d?file=package.json&startScript=build

Describe the bug

lodash is installed as a dependency but isn't referenced in the source code.

The build should warn for this unused dependency.

unbuild/src/validate.ts

Lines 33 to 39 in a6570a5

if (unusedDependencies.size > 0) {
warn(
ctx,
"Potential unused dependencies found: " +
[...unusedDependencies].map((id) => colors.cyan(id)).join(", "),
);
}

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions