Closed Bug 1702532 Opened 3 years ago Closed 3 years ago

Ensure browser/extensions/screenshots/assertIsBlankDocument.js passes eslint check

Categories

(Firefox :: Screenshots, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: emmamalysz, Assigned: falgunimst95)

References

Details

(Whiteboard: [outreachy-2021-screenshots])

Attachments

(1 file, 1 obsolete file)

We should fix these errors in order to enable eslint in the screenshots directory.

To find the errors:

  1. Temporarily comment out https://searchfox.org/mozilla-central/rev/4fa18c26fa907f38d56b599571b9846af1506f3c/.eslintignore#43-45
  2. Run ./mach lint browser/extensions/screenshots/assertIsBlankDocument.js

First, check if this can receive an automatic fix via:
./mach lint browser/extensions/screenshots/assertIsBlankDocument.js --fix.

Otherwise, investigate the failures and see if it requires a manual fix

No longer blocks: 1682719
Blocks: 1682719
Severity: -- → S4
Priority: -- → P3
Blocks: 1702558
No longer blocks: 1702558
Assignee: nobody → falgunimst95
Status: NEW → ASSIGNED
Whiteboard: [outreachy-2021-screenshots]
Attachment #9213137 - Attachment description: Bug 1702532: I had ensure that, I had run the linting and had pass all the linting tests browser/extensions/screenshots/assertIsBlankDocument.js passes eslint check → Bug 1702532: fixes done eslint errors in browser/extensions/screenshots/assertIsBlankDocument.js

In this file browser/extensions/screenshots/assertIsBlankDocument.js, the eslint failues that need to be manually corrected is:

'browser' is undefined in line 10.

I could not understand where do I need to import the browser. Or is there any other way to first define the browser variable?

To fix that error, we can include a comment that indicates browser is a global var. Here's an example:
https://searchfox.org/mozilla-central/rev/54f37fc1ac0f98b590af51e01ce82bb74179bf63/browser/extensions/screenshots/background/analytics.js#1-5

For just browser we would want,
/* globals browser */

Attachment #9213137 - Attachment description: Bug 1702532: fixes done eslint errors in browser/extensions/screenshots/assertIsBlankDocument.js → Bug 1702532: fix done eslint errors in browser/extensions/screenshots/assertIsBlankDocument.js
Attachment #9213137 - Attachment description: Bug 1702532: fix done eslint errors in browser/extensions/screenshots/assertIsBlankDocument.js → Bug 1702532: fix eslint errors in browser/extensions/screenshots/assertIsBlankDocument.js
Attachment #9213137 - Attachment description: Bug 1702532: fix eslint errors in browser/extensions/screenshots/assertIsBlankDocument.js → WIP: Bug 1702532: fix eslint errors in browser/extensions/screenshots/assertIsBlankDocument.js.
Attachment #9213137 - Attachment description: WIP: Bug 1702532: fix eslint errors in browser/extensions/screenshots/assertIsBlankDocument.js. → Bug 1702532: fix eslint check passes in browser/extensions/screenshots/assertIsBlankDocument.js.
Pushed by emalysz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/78344c8e1ec2
fix eslint check passes in browser/extensions/screenshots/assertIsBlankDocument.js. r=emalysz
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Attachment #9213325 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: