Skip to content

PackageJson: Use LiteralUnion for engines field#1354

Merged
sindresorhus merged 3 commits intosindresorhus:mainfrom
derodero24:fix/package-json-engines-literal-union
Feb 8, 2026
Merged

PackageJson: Use LiteralUnion for engines field#1354
sindresorhus merged 3 commits intosindresorhus:mainfrom
derodero24:fix/package-json-engines-literal-union

Conversation

@derodero24
Copy link
Contributor

Closes #1225

The engines field uses 'npm' | 'node' | string as its mapped type key, which collapses to just string in TypeScript — losing IDE autocomplete for common engine names.

This applies LiteralUnion to preserve 'npm' and 'node' as autocomplete suggestions, consistent with how os, cpu, homepage, and type fields are already typed in the same file.

@sindresorhus sindresorhus merged commit fc9e2bb into sindresorhus:main Feb 8, 2026
7 checks passed
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.

PackageJsonStandard.engines should use LiteralUnion to improve IDE autocomplete

3 participants