From e15da45d9328ae2024a9d74ab274e5f468b98fff Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Fri, 21 Jun 2024 09:42:44 +0200 Subject: [PATCH] Add fixture for #687 --- .../knip/fixtures/exports-value-refs/index.ts | 3 +++ .../fixtures/exports-value-refs/package.json | 9 +++++++++ .../knip/fixtures/exports-value-refs/refs.ts | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 packages/knip/fixtures/exports-value-refs/index.ts create mode 100644 packages/knip/fixtures/exports-value-refs/package.json create mode 100644 packages/knip/fixtures/exports-value-refs/refs.ts diff --git a/packages/knip/fixtures/exports-value-refs/index.ts b/packages/knip/fixtures/exports-value-refs/index.ts new file mode 100644 index 000000000..de5e759bf --- /dev/null +++ b/packages/knip/fixtures/exports-value-refs/index.ts @@ -0,0 +1,3 @@ +import type { MyInterface } from './refs.js'; + +const x: MyInterface = { _class: 1, _type: { key: 1 }, _fn: () => {}, _const: 1 }; diff --git a/packages/knip/fixtures/exports-value-refs/package.json b/packages/knip/fixtures/exports-value-refs/package.json new file mode 100644 index 000000000..d83ffb357 --- /dev/null +++ b/packages/knip/fixtures/exports-value-refs/package.json @@ -0,0 +1,9 @@ +{ + "name": "@fixtures/exports-value-refs", + "knip": { + "ignoreExportsUsedInFile": { + "interface": true, + "type": true + } + } +} diff --git a/packages/knip/fixtures/exports-value-refs/refs.ts b/packages/knip/fixtures/exports-value-refs/refs.ts new file mode 100644 index 000000000..db56efdf9 --- /dev/null +++ b/packages/knip/fixtures/exports-value-refs/refs.ts @@ -0,0 +1,16 @@ +export interface MyInterface { + _class: MyClass; + _type: MyType; + _fn: typeof fn; + _const: typeof c; +} + +export type MyType = { + key: 1; +}; + +export class MyClass {} + +export function fn() {} + +export const c = 1;