Add eslint rules for requiring semicolons and disallowing init to undefined

RESOLVED FIXED in Firefox 56

Status

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: ato, Assigned: ato)

Tracking

Version 3
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

a year ago
Under testing/marionette, we always use semicolons for consistency and we never initialise a scoped variable to undefined because it is the default value.

Disallowed:

> let foo = undefined;
> return foo

Allowed:

> const foo = undefined;
> let bar;
> return bar;
(Assignee)

Updated

a year ago
Assignee: nobody → ato
Status: NEW → ASSIGNED
(Assignee)

Comment 1

a year ago
Created attachment 8891617 [details] [diff] [review]
Tighten eslint rules on semicolons and init to undefined. r=automatedtester

Under testing/marionette, we always use semicolons for consistency and we
never initialise scoped variables to undefined becuase it is the default
value.  We also indent continued call expressions by four characters.

Disallowed:

	let foo = undefined;
	return foo

Allowed:

	const foo = undefined;
	let bar;
	return bar;

MozReview-Commit-ID: LgVPMqnFqNk
(Assignee)

Comment 2

a year ago
Created attachment 8891618 [details] [diff] [review]
Lint testing/marionette. r=automatedtester

Automatic fixes from './mach lint --fix testing/marionette'.

MozReview-Commit-ID: 4UOLrLLxMbH
(Assignee)

Updated

a year ago
Attachment #8891617 - Flags: review?(dburns)
(Assignee)

Updated

a year ago
Attachment #8891618 - Flags: review?(dburns)
Attachment #8891617 - Flags: review?(dburns) → review+
Attachment #8891618 - Flags: review?(dburns) → review+

Comment 4

a year ago
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/423b51b21519
Tighten eslint rules on semicolons and init to undefined. r=automatedtester
https://hg.mozilla.org/integration/mozilla-inbound/rev/9360c4975d36
Lint testing/marionette. r=automatedtester

Comment 5

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/423b51b21519
https://hg.mozilla.org/mozilla-central/rev/9360c4975d36
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.