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

Partially fix existing lint errors in build-system/ #11334

Merged
merged 4 commits into from
Sep 20, 2017
Merged

Partially fix existing lint errors in build-system/ #11334

merged 4 commits into from
Sep 20, 2017

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Sep 19, 2017

This PR contains all possible automatic lint fixes for build-system by running:

gulp lint --build_system --fix

There are still a bunch of errors that must be dealt with via manual fixes, or eslint rule changes.

Follow up to #11325
Partial fix for #11273

@rsimha rsimha self-assigned this Sep 19, 2017
@rsimha
Copy link
Contributor Author

rsimha commented Sep 19, 2017

/to @erwinmombay @choumx

This PR reduces the number of lint errors in build-system from ~800 to ~400. The ones that remain are in https://travis-ci.org/ampproject/amphtml/jobs/277454076, and we must decide which of them we forgive via rule overrides in build-system/.eslintrc, and which ones we manually fix.

@rsimha rsimha changed the title Fix existing lint errors in build-system/ Partially fix existing lint errors in build-system/ Sep 19, 2017
@rsimha rsimha requested a review from cramforce September 19, 2017 18:40
@@ -437,11 +437,11 @@ function getClosedPullRequests(opt_page) {
options.qs = {
state: 'closed',
page: opt_page,
access_token: GITHUB_ACCESS_TOKEN,
Copy link
Member

Choose a reason for hiding this comment

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

Could we change the policy to align with our non-build code?

Copy link
Contributor Author

@rsimha rsimha Sep 19, 2017

Choose a reason for hiding this comment

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

We currently use the rules in eslint-config-es5 because the build system code is written in ES5 JS, while the runtime is in ES6. That's where the non-conforming comma rules are coming from.

I'm working on a parallel thread on upgrading to using node 6 on Travis, at which point we can safely use ES6 code in build-system, and then use the same linter as the rest of the runtime. Will update this PR once I have that part figured out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now use the same ES6 rules as the rest of the AMP runtime, and trailing commas are back. PTAL.

@cramforce
Copy link
Member

cramforce commented Sep 19, 2017 via email

@rsimha
Copy link
Contributor Author

rsimha commented Sep 19, 2017

Right, what I meant to say was that with the impending move to node 6 on Travis, we no longer need to restrict build system code to ES5, and therefore, no longer need separate sets of lint rules.

For context on why we're doing so, see the discussion starting at #11278 (comment)

@rsimha
Copy link
Contributor Author

rsimha commented Sep 20, 2017

The latest commit in this PR uses ES6 rules, and after an automatic --fix run, we are down to fewer than 100 remaining lint errors in build-system that need to be manually fixed.

@cramforce PTAL.

Copy link

@dreamofabear dreamofabear left a comment

Choose a reason for hiding this comment

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

👍

.eslintrc Outdated
@@ -33,7 +33,10 @@
"sandbox": true,
"context": false,
"global": false,
"describes": true
"describes": true,
"require": false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move these into a sub folder's .eslintrc. They're dangerous in the src folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I was about to ask. Done.

@rsimha rsimha dismissed cramforce’s stale review September 20, 2017 20:54

We now use the same lint rules across all directories. Trailing commas are back.

@rsimha rsimha merged commit d66ccb3 into ampproject:master Sep 20, 2017
@rsimha rsimha deleted the 2017-09-19-FixLintErrors branch September 20, 2017 20:54
dmvjs pushed a commit to dmvjs/amphtml that referenced this pull request Jan 31, 2018
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.

5 participants