Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .cursor/skills/unused-exports/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: unused-exports
description: >-
Find exported symbols that are never imported by another file. Use when the
user says "check exports", "unused exports" or asks to clean up exports.
---

# unused-exports

## Step 1: Run ts-unused-exports

Version is pinned to guard against supply chain attacks:

```sh
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.json` → `consolePlugin.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.
2 changes: 1 addition & 1 deletion src/flags.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SetFeatureFlag } from '@openshift-console/dynamic-plugin-sdk';

export const FLAG_LIGHTSPEED_PLUGIN = 'LIGHTSPEED_PLUGIN';
const FLAG_LIGHTSPEED_PLUGIN = 'LIGHTSPEED_PLUGIN';

export const enableLightspeedPluginFlag = (setFeatureFlag: SetFeatureFlag) =>
setFeatureFlag(FLAG_LIGHTSPEED_PLUGIN, true);
2 changes: 1 addition & 1 deletion src/hooks/useOpenOLS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Attachment } from '../types';
// Hook that provides a callback function to open the OpenShift Lightspeed UI with an optional
// initial prompt. Exposed as a console extension so other console pages and plugins can discover
// and invoke it.
export const useOpenOLS = (): ((
const useOpenOLS = (): ((
// Optional initial prompt text to populate the input field
prompt?: string,
// Optional array of attachments to include with the prompt
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export type Tool = {

export type OlsToolUIComponent = React.ComponentType<{ tool: Tool }>;

export type HistoryCompression = {
type HistoryCompression = {
durationMs?: number;
status: 'compressing' | 'done';
};
Expand Down
4 changes: 4 additions & 0 deletions unit-tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig.json",
"include": [".", "../src", "../types.d.ts"]
}