unused-exports

作者: openshift

找出從未被其他檔案匯入的匯出符號。當使用者說「check exports」、「unused exports」或要求清理匯出時使用。

npx skills add https://github.com/openshift/lightspeed-console --skill unused-exports

unused-exports

Step 1: Run ts-unused-exports

Version is pinned to guard against supply chain attacks:

npx ts-unused-exports@11.0.1 unit-tests/tsconfig.json \
  --findCompletelyUnusedFiles \
  --showLineNumber \
  --searchNamespaces

Step 2: Filter out entry points

Some exports are consumed externally by the OpenShift console framework, not by imports within this repo. Read package.jsonconsolePlugin.exposedModules and console-extensions.json$codeRef values to identify them. Exclude any finding that is a default export of an exposed module or is named in a $codeRef.

Step 3: Report findings

Group into unused exports and completely unused files. If nothing remains, report that all exports are accounted for. Do not modify any files.