Closed Bug 1385547 Opened 2 years ago Closed 2 years ago

Add eslint rules for requiring semicolons and disallowing init to undefined

Categories

(Testing :: Marionette, enhancement)

Version 3
enhancement
Not set

Tracking

(firefox56 fixed)

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: ato, Assigned: ato)

Details

Attachments

(2 files)

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: nobody → ato
Status: NEW → ASSIGNED
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
Automatic fixes from './mach lint --fix testing/marionette'.

MozReview-Commit-ID: 4UOLrLLxMbH
Attachment #8891617 - Flags: review?(dburns)
Attachment #8891618 - Flags: review?(dburns)
Attachment #8891617 - Flags: review?(dburns) → review+
Attachment #8891618 - Flags: review?(dburns) → review+
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
https://hg.mozilla.org/mozilla-central/rev/423b51b21519
https://hg.mozilla.org/mozilla-central/rev/9360c4975d36
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.