normalize-package-data icon indicating copy to clipboard operation
normalize-package-data copied to clipboard

[QUESTION] Have a way to just check for correctness (i.e. whether there are warnings) ?

Open myrne opened this issue 11 years ago • 1 comments

Originally, I thought that it would be best to separate the code for generating warnings from the code that make changes to data. But that was before I thought of the (quite elegant) solution of passing a warn function along.

However, it may be interesting to check for package.json validity (perhaps on several levels of correctness) while leaving the package data alone.

The consumer of this function could also do it by himself, by calling normalize on a cloned object, and pass a "warn" function that (for example) sets a "hasWarned" to true, then check this hasWarnings value afterwards.

myrne avatar Apr 08 '13 18:04 myrne

Wouldn't it be best if npm publish rejects a package.json that generates a warning?

myrne avatar Apr 08 '13 18:04 myrne