Closed Bug 1593921 Opened 6 years ago Closed 6 years ago

Use eslint-disable-next-line instead of eslint-disable/enable blocks for complexity issues

Categories

(DevTools :: General, task, P3)

task

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

Details

Attachments

(1 file)

We have wrapped a few methods in the code base with

/* eslint-disable complexity */
function tooComplexMethod() {
  // ...
}
/* eslint-enable complexity */

When moving code around we can easily break the block, by moving the "enable" lower than intended, or removing it altogether (hence making the disable apply to the whole file).

Since complexity is used on functions, we can alternatively use eslint-disable-next-line. This will be less error prone.

Using next-line is less error prone for refactorings than wrapping methods with enable/disable blocks.

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/27157ea1dd60 Use eslint-disable-next-line to disable complexity checks in DevTools r=pbro
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: