-
-
Notifications
You must be signed in to change notification settings - Fork 386
Open
Labels
feature requestFeature requestFeature request
Description
Suggest an idea for Knip
Knip treats the exports of all entries as used. However, not all exports are always used. For example, consider the following project:
// lib/exports.js
// This function is exported via `package.json` exports. So it’s actually used.
export function used() {}// lib/bin.js
// This function is only exported via the `package.json` `bin` field. So it’s unused.
export function unused() {}// knip.config.js
// This module is used by Knip. Only the default export is used.
export function unused() {}
export default {}I imagine entry could be a mapping of file name patterns to export name patterns instead of an array. So this project structure would yield a Knip config equivalent to:
{
"entry": {
"lib/bin": [],
"lib/exports": ["*"],
"knip.config.js": ["default"]
}
}For backwards compatibility, an array could be equivalent to a mapping where each entry maps to a value of ["*"].
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestFeature requestFeature request