Skip to content
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

🏗 Report unused private fields #14761

Merged
merged 5 commits into from
Apr 20, 2018

Conversation

jridgewell
Copy link
Contributor

They don't get stripped in v0.js

Fixes #14742.

.eslintrc Outdated
@@ -45,6 +45,7 @@
"amphtml-internal/no-global": 0,
"amphtml-internal/no-spread": 2,
"amphtml-internal/query-selector": 2,
"amphtml-internal/unused-private-field": 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, alphabetical order. place below "amphtml-internal/todo-format"

jridgewell added a commit to jridgewell/amphtml that referenced this pull request Apr 20, 2018
@jridgewell jridgewell merged commit eb5666e into ampproject:master Apr 20, 2018
@jridgewell jridgewell deleted the unused-private-fields branch April 20, 2018 22:30
@rsimha
Copy link
Contributor

rsimha commented Apr 21, 2018

This seems to have failed lint on master.

https://travis-ci.org/ampproject/amphtml/jobs/369340429

@jridgewell
Copy link
Contributor Author

Test flaked, lint isn't the issue.

@rsimha
Copy link
Contributor

rsimha commented Apr 23, 2018

@jridgewell In that case, we shouldn't be printing all these warnings during push builds, since there's nothing anyone can do about them there, and they distract from real errors.

Can you change this line in .eslintrc...

"amphtml-internal/unused-private-field": 1,

... to ...

"amphtml-internal/unused-private-field": process.env.TRAVIS_EVENT_TYPE == 'push' ? 0 : 1,

... and see if it works?

(Also do the same with any other warning-only rules you've introduced, until the majority of them are fixed.)

@rsimha
Copy link
Contributor

rsimha commented Apr 23, 2018

See https://travis-ci.org/ampproject/amphtml/jobs/370169393#L660-L1906 for the output currently being printed on master during gulp lint.

@jridgewell
Copy link
Contributor Author

I'm not sure what format .eslintrc actually is (it's not pure JSON), but it doesn't allow arbitrary expressions like that.

I'm trying to whittle away at the lint warnings.

jridgewell added a commit that referenced this pull request Apr 26, 2018
* Cleanup AnimationPlayer's private state

Part of #14761.

* Nit
peterjosling added a commit to emarchiori/amphtml that referenced this pull request Apr 27, 2018
Lots of methods on AmpDoc and Extensions which were marked as private, but being called from exported functions (and potentially being broken by Closure Compiler optimisations). Marked affected methods as public, and removed redundant exported functions (which existed only to expose the private methods).

Issue identified in ampproject#14896.
Fixes part of ampproject#14761.
peterjosling added a commit to emarchiori/amphtml that referenced this pull request Apr 27, 2018
Lots of methods on AmpDoc and Extensions which were marked as private, but being called from exported functions (and potentially being broken by Closure Compiler optimisations). Marked affected methods as public, and removed redundant exported functions (which existed only to expose the private methods).

Issue identified in ampproject#14896.
Fixes part of ampproject#14761.
peterjosling added a commit to emarchiori/amphtml that referenced this pull request Apr 27, 2018
Lots of methods on AmpDoc and Extensions which were marked as private, but being called from exported functions (and potentially being broken by Closure Compiler optimisations). Marked affected methods as public, and removed redundant exported functions (which existed only to expose the private methods).

Issue identified in ampproject#14896.
Fixes part of ampproject#14761.
glevitzky pushed a commit that referenced this pull request Apr 27, 2018
* Report unused private fields

They don't get stripped in v0.js

* ABCDEFG...

* Use AST to find the members

* Find unused methods

* Lint
peterjosling added a commit to emarchiori/amphtml that referenced this pull request Apr 30, 2018
Lots of methods on AmpDoc and Extensions which were marked as private, but being called from exported functions (and potentially being broken by Closure Compiler optimisations). Marked affected methods as public, and removed redundant exported functions (which existed only to expose the private methods).

Issue identified in ampproject#14896.
Fixes part of ampproject#14761.
jridgewell pushed a commit that referenced this pull request Apr 30, 2018
Lots of methods on AmpDoc and Extensions which were marked as private, but being called from exported functions (and potentially being broken by Closure Compiler optimisations). Marked affected methods as public, and removed redundant exported functions (which existed only to expose the private methods).

Issue identified in #14896.
Fixes part of #14761.
jridgewell added a commit that referenced this pull request May 21, 2018
Just need an `@restricted` annotation

Part of #14761.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants