Skip to content

Warn on variables starting with underscores #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
evmar opened this issue May 5, 2016 · 4 comments
Closed

Warn on variables starting with underscores #143

evmar opened this issue May 5, 2016 · 4 comments

Comments

@evmar
Copy link
Contributor

evmar commented May 5, 2016

To Closure, a variable name that starts with an underscore prevents optimization.
Tsickle should warn/error on code that uses an underscore.

@mprobst
Copy link
Contributor

mprobst commented May 5, 2016 via email

@evmar
Copy link
Contributor Author

evmar commented May 5, 2016

I'm having difficulty coming up with a case with one of the Closure inspectors that demonstrates this problem, but I'm sure I've seen it. See also microsoft/TypeScript#7345

@rkirov
Copy link
Contributor

rkirov commented Apr 29, 2017

I think leading underscore is the escape hatch for 'variable renaming', which is completely different from 'property renaming'. So class fields are save, but top-level functions like __extend are not.

@evmar
Copy link
Contributor Author

evmar commented Aug 20, 2019

I cannot repro varying behavior here, and we disallow this per style already.

@evmar evmar closed this as completed Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants