Open
Description
Scenario: Your package is at version 1.1.0. You decide to drop support for Node.js 0.12. You later do other changes and then publish a minor release. You've now accidentally done a breaking change in a minor release. This happens all the time. And will happen a lot more now that maintainers are starting to drop support for Node.js 0.10 and 0.12.
We could check if the engine field is higher than the latest version, and if not a major release, throw an error.
Thoughts?
Idea from: npm/npm#13549 // @bajtos
Activity
jfmengels commentedon Aug 28, 2016
Sounds like a good idea to me 👍
What should then be done if the engine field was not set in the latest version, and now is? It could be done to make the package requirements clearer ("we didn't support 0.12 before, but now it's written in the package.json"), or when dropping support of a version ("We are stopping support for 0.12, and we have heard of the engine field so we're setting it now").
For lack of better options, probably better to let it pass?
sindresorhus commentedon Aug 30, 2016
Let it pass.
tommy-mitchell commentedon Apr 5, 2023
Should this check
tsconfig.json
too?sindresorhus commentedon Apr 6, 2023
@tommy-mitchell Do you mean the
target
field? If so, yes, that would be useful.