Skip to content

Add openapi-ts plugin#1579

Merged
webpro merged 1 commit intowebpro-nl:mainfrom
jonahsnider:openapi-ts
Mar 3, 2026
Merged

Add openapi-ts plugin#1579
webpro merged 1 commit intowebpro-nl:mainfrom
jonahsnider:openapi-ts

Conversation

@jonahsnider
Copy link
Copy Markdown
Contributor

Add an openapi-ts plugin, so that openapi-ts.config.ts is recognized as an entrypoint automatically

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 1, 2026

Open in StackBlitz

npm i https://pkg.pr.new/knip@1579
npm i https://pkg.pr.new/@knip/language-server@1579
npm i https://pkg.pr.new/@knip/mcp@1579

commit: 1a47296

@webpro webpro merged commit 42d1b3f into webpro-nl:main Mar 3, 2026
28 of 29 checks passed
@webpro
Copy link
Copy Markdown
Member

webpro commented Mar 3, 2026

Boom 💯

@mrlubos
Copy link
Copy Markdown

mrlubos commented Mar 3, 2026

@jonahsnider @webpro what does this plugin do? Are you knipping unused generated symbols?

@jonahsnider
Copy link
Copy Markdown
Contributor Author

what does this plugin do? Are you knipping unused generated symbols?

openapi-ts.config.ts needed to be manually added as an entrypoint in Knip. This change makes it so you don't need to do that manually.

@jonahsnider jonahsnider deleted the openapi-ts branch March 4, 2026 15:26
"@hey-api/openapi-ts": "*"
},
"dependencies": {
"@hey-api/typescript": "*",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonahsnider thanks! The only other thing I don't get are these dependencies. None of those @hey-api/* packages are published to npm, so I'd assume this is not needed unless it's something Knip-related

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, good callout. This is definitely just a weird choice by Claude, but the logic here should be sound in terms of resolving plugin dependencies mentioned in the openapi-ts.config.ts

Missed this the first time around. I can make a follow-up PR to clear up the fixtures if that'd be desired? cc @webpro

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First time I see this too! @hey-api/openapi-ts is all you need for the foreseeable future, the plugins are bundled inside so no extra dependencies

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name of the packages doesn't matter technically for Knip (just needs to match up). Feel free to fix it up to avoid potential confusion.

Please do PR if any listed plugin should not be listed in package.json, e.g. if it's built-in. Transitive dependencies of @hey-api/openapi-ts should not be flagged by Knip. Peer deeps should.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #1591 to make the test fixtures less confusing

@webpro
Copy link
Copy Markdown
Member

webpro commented Mar 7, 2026

🚀 This pull request is included in v5.86.0. See Release 5.86.0 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants