publint
publint copied to clipboard
Suggest `"sideEffects": false`
This helps bundlers optimize code better. I'd say that 98% of packages should be able to add this, but I'm not sure when we can detect the 2% of cases when it's wrong to add it.
Sounds good to me 👍 I don't think there's particularly cases where it's wrong to add, but probably just unnecessary, e.g. if the package was never intended or not cared to be bundled, then the field probably isn't helpful.
As a start, maybe we can check a few things, e.g. if there's a "browser" field, "module" field, "browser" condition, or "module" condition, then we'd suggest this if those field exist which we assume it'll be consumed by bundlers.