google / google/closure-compiler

Warn if a goog.scope alias uses a different name from the last part of the original name

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

Description

When creating a short alias for `some.really.long.name.Foo` the alias should almost certainly be `Foo`. If someone writes

``` js
goog.scope(function() {
var Bar = some.really.long.name.Foo;
});
```

it is surprising and a violation of the style guide. We could probably warn for this pretty easily in the [ScopedAliases pass](https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/ScopedAliases.java)

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.