Skip to content

Add valueless Node.js flags and reuse them for tsx - #2363

Merged
webpro merged 1 commit into
webpro-nl:mainfrom
everton-dgn:fix/node-valueless-flags
Nov 16, 2026
Merged

webpro merged 1 commit into
webpro-nl:mainfrom
everton-dgn:fix/node-valueless-flags

Conversation

@everton-dgn

Copy link
Copy Markdown
Contributor

node --experimental-test-coverage test/unit.mjs (sharp) and tsx --test __test__/*.spec.ts (arrow-adbc) make Knip report those test files as unused. A flag missing from the Node plugin's boolean list takes the next argument as its value, and the tsx plugin declared none.

Following #2042, I added nine valueless flags from node_options.cc. tsx passes Node.js flags through (docs), so the tsx plugin now reuses that list, the same way tsrs reuses args from the TypeScript plugin.

@pkg-pr-new

pkg-pr-new Bot commented Nov 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 93d3443

@webpro webpro left a comment

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.

Thanks, Éverton! This keeps boolean flags from consuming the script path and gives Node and tsx one shared list.

@webpro
webpro merged commit d946de1 into webpro-nl:main Nov 16, 2026
33 checks passed
@webpro

webpro commented Nov 18, 2026

Copy link
Copy Markdown
Member

🚀 This pull request is included in v6.46.0. See Release 6.46.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.

2 participants