E0029

E0029#

Warning name: unused_package

This warning is emitted when a package is listed as an import but no code in the current package refers to it. Remove the import if it was left over from a refactor, or use the package through its alias if the dependency is still needed.

Erroneous example#

moon.mod.json#
{
  "name": "moonbit-community/E0029"
}
lib/moon.pkg.json#
{}
moon.pkg.json#
{
  "is_main": true,
  "import": ["moonbit-community/E0029/lib"] // Warning: Unused package
}
top.mbt#
///|
fn main {

}

Suggestion#

Remove the unused package:

moon.pkg.json#
{
  "is-main": true
}