Currently, the /* @__PURE__ */ annotation must be used individually on every returned value for a given call.
Could it be possible to allow using the annotation on a function, so all its returned values are considered pure? Like in the following.
/** * The function is pure, so if the result is not used, it can be removed. * * @__PURE__ */function addTwo(number: number) { return number + 2;}// Will be removedaddTwo(4);// Will be removedconst x = addTwo(3);// This will be keptexport const y = addTwo(2);
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.