google / google/closure-compiler

Add an @pure annotation

Open
#2,395 5 comments 0 reactions 0 assignees View on GitHub
feat help wanted
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I'd like to have an annotation to declare an intent that a function will not have side effects. In the presence of this annotation, I'd like the compiler to warn me if the function has side effects.

In a lot of code, you have simple helper methods that are intended to be side-effect free. It's very easy for a side effect to be accidentally introduced at a later time. I'd like to have a warning issued for this so the developer can correct it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.