зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 0f9626b48a66 (bug 1553451) for linting failures. CLOSED TREE
This commit is contained in:
Родитель
354eec452c
Коммит
2ae5a4bb01
|
@ -213,11 +213,7 @@ module.exports = {
|
|||
// Require camel case names
|
||||
"camelcase": "error",
|
||||
// Warn about cyclomatic complexity in functions.
|
||||
// 20 is ESLint's default, and we want to keep it this way to prevent new highly
|
||||
// complex functions from being introduced. However, because Mozilla's eslintrc has
|
||||
// some other value defined, we need to override it here. See bug 1553449 for more
|
||||
// information on complex DevTools functions that are currently excluded.
|
||||
"complexity": ["error", 20],
|
||||
"complexity": ["error", 40],
|
||||
// Don't warn for inconsistent naming when capturing this (not so important
|
||||
// with auto-binding fat arrow functions).
|
||||
"consistent-this": "off",
|
||||
|
|
|
@ -38,7 +38,6 @@ class SummaryGraph extends PureComponent {
|
|||
this.props.selectAnimation(this.props.animation);
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
getTitleText(state) {
|
||||
const getTime =
|
||||
time => getFormatStr("player.timeLabel", numberWithDecimals(time / 1000, 2));
|
||||
|
@ -137,7 +136,6 @@ class SummaryGraph extends PureComponent {
|
|||
|
||||
return text;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
render() {
|
||||
const {
|
||||
|
|
|
@ -199,7 +199,6 @@ const reducers = {
|
|||
* - when changes cancel each other out leaving the rule unchanged, the rule is removed
|
||||
* from the store. Its parent rule is removed as well if it too ends up unchanged.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
[TRACK_CHANGE](state, { change }) {
|
||||
const defaults = {
|
||||
selector: null,
|
||||
|
@ -352,7 +351,6 @@ const reducers = {
|
|||
|
||||
return state;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
[RESET_CHANGES](state) {
|
||||
return INITIAL_STATE;
|
||||
|
|
|
@ -325,7 +325,6 @@ CssComputedView.prototype = {
|
|||
* - value {Object} Depends on the type of the node
|
||||
* returns null if the node isn't anything we care about
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
getNodeInfo: function(node) {
|
||||
if (!node) {
|
||||
return null;
|
||||
|
@ -429,7 +428,6 @@ CssComputedView.prototype = {
|
|||
value,
|
||||
};
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
_createPropertyViews: function() {
|
||||
if (this._createViewsPromise) {
|
||||
|
|
|
@ -113,7 +113,6 @@ class FlexItemSizingProperties extends PureComponent {
|
|||
);
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
renderFlexibilitySection(flexItemSizing, mainFinalSize, properties, computedStyle) {
|
||||
const {
|
||||
mainDeltaSize,
|
||||
|
@ -184,7 +183,6 @@ class FlexItemSizingProperties extends PureComponent {
|
|||
)
|
||||
);
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
renderMinimumSizeSection(flexItemSizing, properties, dimension) {
|
||||
const { clampState, mainMinSize, mainDeltaSize } = flexItemSizing;
|
||||
|
|
|
@ -213,7 +213,6 @@ SelectorAutocompleter.prototype = {
|
|||
* '#f' requires an Id suggestion, so the state is States.ID
|
||||
* 'div > .foo' requires class suggestion, so state is States.CLASS
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
get state() {
|
||||
if (!this.searchBox || !this.searchBox.value) {
|
||||
return null;
|
||||
|
@ -307,7 +306,6 @@ SelectorAutocompleter.prototype = {
|
|||
}
|
||||
return this._state;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Removes event listeners and cleans up references.
|
||||
|
|
|
@ -895,7 +895,6 @@ MarkupView.prototype = {
|
|||
/**
|
||||
* Key shortcut listener.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_onShortcut(name, event) {
|
||||
if (this._isInputOrTextarea(event.target)) {
|
||||
return;
|
||||
|
@ -1025,7 +1024,6 @@ MarkupView.prototype = {
|
|||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Check if a node is an input or textarea
|
||||
|
|
|
@ -274,7 +274,6 @@ class ElementStyle {
|
|||
* Which pseudo element to flag as overridden.
|
||||
* Empty string or undefined will default to no pseudo element.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
updateDeclarations(pseudo = "") {
|
||||
// Gather all the text properties applied by these rules, ordered
|
||||
// from more- to less-specific. Text properties from keyframes rule are
|
||||
|
@ -377,7 +376,6 @@ class ElementStyle {
|
|||
}
|
||||
}
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Adds a new declaration to the rule.
|
||||
|
|
|
@ -371,7 +371,6 @@ CssRuleView.prototype = {
|
|||
* - value {Object} Depends on the type of the node
|
||||
* returns null of the node isn't anything we care about
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
getNodeInfo: function(node) {
|
||||
if (!node) {
|
||||
return null;
|
||||
|
@ -487,7 +486,6 @@ CssRuleView.prototype = {
|
|||
value,
|
||||
};
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Retrieve the RuleEditor instance.
|
||||
|
@ -1144,7 +1142,6 @@ CssRuleView.prototype = {
|
|||
/**
|
||||
* Creates editor UI for each of the rules in _elementStyle.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_createEditors: function() {
|
||||
// Run through the current list of rules, attaching
|
||||
// their editors in order. Create editors if needed.
|
||||
|
@ -1225,7 +1222,6 @@ CssRuleView.prototype = {
|
|||
|
||||
return promise.all(editorReadyPromises);
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Highlight rules that matches the filter search value and returns a
|
||||
|
|
|
@ -389,7 +389,6 @@ TextPropertyEditor.prototype = {
|
|||
/**
|
||||
* Populate the span based on changes to the TextProperty.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
update: function() {
|
||||
if (this.ruleView.isDestroyed) {
|
||||
return;
|
||||
|
@ -611,7 +610,6 @@ TextPropertyEditor.prototype = {
|
|||
// Update the rule property highlight.
|
||||
this.ruleView._updatePropertyHighlight(this);
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
_onStartEditing: function() {
|
||||
this.element.classList.remove("ruleview-overridden");
|
||||
|
|
|
@ -103,7 +103,6 @@ exports.getCustomTreeMapDisplays = function() {
|
|||
* @param {snapshotState | diffingState} state
|
||||
* @return {String}
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
exports.getStatusText = function(state) {
|
||||
assert(state, "Must have a state");
|
||||
|
||||
|
@ -171,7 +170,6 @@ exports.getStatusText = function(state) {
|
|||
return "";
|
||||
}
|
||||
};
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Returns a string representing a readable form of the snapshot's state;
|
||||
|
@ -180,7 +178,6 @@ exports.getStatusText = function(state) {
|
|||
* @param {snapshotState | diffingState} state
|
||||
* @return {String}
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
exports.getStatusTextFull = function(state) {
|
||||
assert(!!state, "Must have a state");
|
||||
|
||||
|
@ -248,7 +245,6 @@ exports.getStatusTextFull = function(state) {
|
|||
return "";
|
||||
}
|
||||
};
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Return true if the snapshot is in a diffable state, false otherwise.
|
||||
|
|
|
@ -186,7 +186,6 @@ class RequestListItem extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
render() {
|
||||
const {
|
||||
blocked,
|
||||
|
@ -285,7 +284,6 @@ class RequestListItem extends Component {
|
|||
)
|
||||
);
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
|
||||
module.exports = RequestListItem;
|
||||
|
|
|
@ -119,7 +119,6 @@ class SecurityPanel extends Component {
|
|||
);
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
render() {
|
||||
const { openLink, request } = this.props;
|
||||
const { securityInfo, url } = request;
|
||||
|
@ -233,7 +232,6 @@ class SecurityPanel extends Component {
|
|||
})
|
||||
);
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
|
||||
module.exports = SecurityPanel;
|
||||
|
|
|
@ -46,7 +46,6 @@ function Requests() {
|
|||
* This reducer is responsible for maintaining list of request
|
||||
* within the Network panel.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function requestsReducer(state = Requests(), action) {
|
||||
switch (action.type) {
|
||||
// Appending new request into the list/map.
|
||||
|
@ -183,7 +182,6 @@ function requestsReducer(state = Requests(), action) {
|
|||
return state;
|
||||
}
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
// Helpers
|
||||
|
||||
|
|
|
@ -120,7 +120,6 @@ function processFlagFilter(type, value) {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
function isFlagFilterMatch(item, { type, value, negative }) {
|
||||
if (value == null) {
|
||||
return false;
|
||||
|
@ -234,7 +233,6 @@ function isFlagFilterMatch(item, { type, value, negative }) {
|
|||
}
|
||||
return match;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
function isSizeMatch(value, size) {
|
||||
return value >= (size - size / 10) && value <= (size + size / 10);
|
||||
|
|
|
@ -25,7 +25,6 @@ class RequestListContextMenu {
|
|||
this.props = props;
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
open(event, clickedRequest, requests) {
|
||||
const {
|
||||
id,
|
||||
|
@ -285,7 +284,6 @@ class RequestListContextMenu {
|
|||
screenY: event.screenY,
|
||||
});
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Opens selected item in the debugger
|
||||
|
|
|
@ -35,7 +35,6 @@ const gFrameData = new WeakMap();
|
|||
* Parses the raw location of this function call to retrieve the actual
|
||||
* function name, source url, host name, line and column.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function parseLocation(location, fallbackLine, fallbackColumn) {
|
||||
// Parse the `location` for the function name, source url, line, column etc.
|
||||
|
||||
|
@ -183,7 +182,6 @@ function parseLocation(location, fallbackLine, fallbackColumn) {
|
|||
|
||||
return { functionName, fileName, host, port, url, line, column };
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Sets the properties of `isContent` and `category` on a frame.
|
||||
|
|
|
@ -106,7 +106,6 @@ class Frame extends Component {
|
|||
};
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
render() {
|
||||
let frame, isSourceMapped;
|
||||
const {
|
||||
|
@ -251,7 +250,6 @@ class Frame extends Component {
|
|||
|
||||
return dom.span(attributes, ...elements);
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
|
||||
module.exports = Frame;
|
||||
|
|
|
@ -553,7 +553,6 @@ class Tree extends Component {
|
|||
*
|
||||
* @param {Event} e
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_onKeyDown(e) {
|
||||
if (this.props.focused == null) {
|
||||
return;
|
||||
|
@ -625,7 +624,6 @@ class Tree extends Component {
|
|||
break;
|
||||
}
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
get activeElement() {
|
||||
return this.refs.tree.ownerDocument.activeElement;
|
||||
|
|
|
@ -199,7 +199,6 @@ class SplitBox extends Component {
|
|||
|
||||
// Rendering
|
||||
|
||||
/* eslint-disable complexity */
|
||||
render() {
|
||||
const { endPanelControl, splitterSize, vert } = this.state;
|
||||
const { startPanel, endPanel, minSize, maxSize } = this.props;
|
||||
|
@ -291,7 +290,6 @@ class SplitBox extends Component {
|
|||
)
|
||||
);
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
|
||||
module.exports = SplitBox;
|
||||
|
|
|
@ -270,7 +270,6 @@ define(function(require, exports, module) {
|
|||
|
||||
// Event Handlers
|
||||
|
||||
/* eslint-disable complexity */
|
||||
onKeyDown(event) {
|
||||
if (!SUPPORTED_KEYS.includes(event.key)) {
|
||||
return;
|
||||
|
@ -353,7 +352,6 @@ define(function(require, exports, module) {
|
|||
this.treeRef.current.focus();
|
||||
event.preventDefault();
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
onClickRow(nodePath, event) {
|
||||
const onClickRow = this.props.onClickRow;
|
||||
|
|
|
@ -48,7 +48,6 @@ function naturalSortCaseInsensitive(a, b) {
|
|||
* @param {Boolean} insensitive
|
||||
* Should the search be case insensitive?
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function naturalSort(a, b, insensitive) {
|
||||
// convert all to strings strip whitespace
|
||||
const i = function(s) {
|
||||
|
@ -105,4 +104,3 @@ function naturalSort(a, b, insensitive) {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
|
|
@ -654,7 +654,6 @@ OutputParser.prototype = {
|
|||
* The node to which spans containing points are added.
|
||||
* @returns {Node} The container to which spans have been added.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_addPolygonPointNodes: function(coords, container) {
|
||||
const tokenStream = getCSSLexer(coords);
|
||||
let token = tokenStream.nextToken();
|
||||
|
@ -759,7 +758,6 @@ OutputParser.prototype = {
|
|||
}
|
||||
return container;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Parse the given circle coordinates and populate the given container appropriately
|
||||
|
@ -771,7 +769,6 @@ OutputParser.prototype = {
|
|||
* The node to which the definition is added.
|
||||
* @returns {Node} The container to which the definition has been added.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_addCirclePointNodes: function(coords, container) {
|
||||
const tokenStream = getCSSLexer(coords);
|
||||
let token = tokenStream.nextToken();
|
||||
|
@ -877,7 +874,6 @@ OutputParser.prototype = {
|
|||
}
|
||||
return container;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Parse the given ellipse coordinates and populate the given container appropriately
|
||||
|
@ -889,7 +885,6 @@ OutputParser.prototype = {
|
|||
* The node to which the definition is added.
|
||||
* @returns {Node} The container to which the definition has been added.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_addEllipsePointNodes: function(coords, container) {
|
||||
const tokenStream = getCSSLexer(coords);
|
||||
let token = tokenStream.nextToken();
|
||||
|
@ -1005,7 +1000,6 @@ OutputParser.prototype = {
|
|||
}
|
||||
return container;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Parse the given inset coordinates and populate the given container appropriately.
|
||||
|
@ -1016,7 +1010,6 @@ OutputParser.prototype = {
|
|||
* The node to which the definition is added.
|
||||
* @returns {Node} The container to which the definition has been added.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_addInsetPointNodes: function(coords, container) {
|
||||
const insetPoints = ["top", "right", "bottom", "left"];
|
||||
const tokenStream = getCSSLexer(coords);
|
||||
|
@ -1130,7 +1123,6 @@ OutputParser.prototype = {
|
|||
|
||||
return container;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Append a angle value to the output
|
||||
|
|
|
@ -270,7 +270,6 @@ function isContentScheme(location, i = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
function isChromeScheme(location, i = 0) {
|
||||
const firstChar = location.charCodeAt(i);
|
||||
|
||||
|
@ -316,7 +315,6 @@ function isChromeScheme(location, i = 0) {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
function isWASM(location, i = 0) {
|
||||
return (
|
||||
|
|
|
@ -671,7 +671,6 @@ class Telemetry {
|
|||
* The ID of the tool that has been opened.
|
||||
*
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function getChartsFromToolId(id) {
|
||||
if (!id) {
|
||||
return null;
|
||||
|
@ -751,7 +750,6 @@ function getChartsFromToolId(id) {
|
|||
countScalar: countScalar,
|
||||
};
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Displays the first caller and calling line outside of this file in the
|
||||
|
|
|
@ -799,7 +799,6 @@ VariablesView.prototype = {
|
|||
/**
|
||||
* Listener handling a key down event on the view.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_onViewKeyDown: function(e) {
|
||||
const item = this.getFocusedItem();
|
||||
|
||||
|
@ -890,7 +889,6 @@ VariablesView.prototype = {
|
|||
item._onAddProperty(e);
|
||||
}
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Sets the text displayed in this container when there are no available items.
|
||||
|
@ -2795,7 +2793,6 @@ Variable.prototype = extend(Scope.prototype, {
|
|||
* and specifies if it's a 'this', '<exception>', '<return>' or '__proto__'
|
||||
* reference.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_setAttributes: function() {
|
||||
const ownerView = this.ownerView;
|
||||
if (ownerView.preventDescriptorModifiers) {
|
||||
|
@ -2853,7 +2850,6 @@ Variable.prototype = extend(Scope.prototype, {
|
|||
target.setAttribute("pseudo-item", "");
|
||||
}
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Adds the necessary event listeners for this variable.
|
||||
|
|
|
@ -506,7 +506,6 @@ class JSTerm extends Component {
|
|||
* @param {Object} response
|
||||
* The message received from the server.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
async _executeResultCallback(response) {
|
||||
if (!this.webConsoleUI) {
|
||||
return null;
|
||||
|
@ -579,7 +578,6 @@ class JSTerm extends Component {
|
|||
|
||||
return null;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
screenshotNotify(results) {
|
||||
const wrappedResults = results.map(message => ({ message, type: "logMessage" }));
|
||||
|
|
|
@ -157,7 +157,6 @@ class Message extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
render() {
|
||||
const {
|
||||
open,
|
||||
|
@ -347,7 +346,6 @@ class Message extends Component {
|
|||
attachment ? null : dom.br(),
|
||||
);
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
|
|
|
@ -68,7 +68,6 @@ class ReverseSearchInput extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
onInputKeyDown(event) {
|
||||
const {
|
||||
keyCode,
|
||||
|
@ -128,7 +127,6 @@ class ReverseSearchInput extends Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
renderSearchInformation() {
|
||||
const {
|
||||
|
|
|
@ -105,7 +105,6 @@ function cloneState(state) {
|
|||
* @param {UiState} uiState: The ui state.
|
||||
* @returns {MessageState} a new messages state.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function addMessage(newMessage, state, filtersState, prefsState, uiState) {
|
||||
const {
|
||||
messagesById,
|
||||
|
@ -275,9 +274,7 @@ function addMessage(newMessage, state, filtersState, prefsState, uiState) {
|
|||
|
||||
return state;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/* eslint-disable complexity */
|
||||
function messages(state = MessageState(), action, filtersState, prefsState, uiState) {
|
||||
const {
|
||||
messagesById,
|
||||
|
@ -544,7 +541,6 @@ function messages(state = MessageState(), action, filtersState, prefsState, uiSt
|
|||
|
||||
return state;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Returns the new current group id given the previous current group and the groupsById
|
||||
|
|
|
@ -75,7 +75,6 @@ global.ChromeUtils = {
|
|||
|
||||
// Point to vendored-in files and mocks when needed.
|
||||
const requireHacker = require("require-hacker");
|
||||
/* eslint-disable complexity */
|
||||
requireHacker.global_hook("default", (path, module) => {
|
||||
switch (path) {
|
||||
// For Enzyme
|
||||
|
@ -139,7 +138,6 @@ requireHacker.global_hook("default", (path, module) => {
|
|||
|
||||
return undefined;
|
||||
});
|
||||
/* eslint-enable complexity */
|
||||
|
||||
// Configure enzyme with React 16 adapter. This needs to be done after we set the
|
||||
// requireHack hook so `require()` calls in Enzyme are handled as well.
|
||||
|
|
|
@ -67,7 +67,6 @@ function transformPacket(packet) {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
function transformConsoleAPICallPacket(packet) {
|
||||
const { message } = packet;
|
||||
|
||||
|
@ -199,7 +198,6 @@ function transformConsoleAPICallPacket(packet) {
|
|||
chromeContext: message.chromeContext,
|
||||
});
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
function transformNavigationMessagePacket(packet) {
|
||||
const { url } = packet;
|
||||
|
|
|
@ -505,7 +505,6 @@ const AccessibleWalkerActor = ActorClassWithSpec(accessibleWalkerSpec, {
|
|||
* @param {Ci.nsIAccessibleEvent} subject
|
||||
* accessible event object.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
observe(subject) {
|
||||
const event = subject.QueryInterface(Ci.nsIAccessibleEvent);
|
||||
const rawAccessible = event.accessible;
|
||||
|
@ -601,7 +600,6 @@ const AccessibleWalkerActor = ActorClassWithSpec(accessibleWalkerSpec, {
|
|||
break;
|
||||
}
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Ensure that nothing interferes with the audit for an accessible object
|
||||
|
|
|
@ -463,7 +463,6 @@ var WebExtensionInspectedWindowActor = protocol.ActorClassWithSpec(
|
|||
* it is called over the remote debugging protocol the target window is always
|
||||
* `targetActor.window`.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
eval(callerInfo, expression, options, customTargetWindow) {
|
||||
const window = customTargetWindow || this.window;
|
||||
options = options || {};
|
||||
|
@ -640,7 +639,6 @@ var WebExtensionInspectedWindowActor = protocol.ActorClassWithSpec(
|
|||
|
||||
return {value: evalResult};
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -88,7 +88,6 @@ TouchSimulator.prototype = {
|
|||
this._isPicking = state;
|
||||
},
|
||||
|
||||
/* eslint-disable complexity */
|
||||
handleEvent(evt) {
|
||||
// Bail out if devtools is in pick mode in the same tab.
|
||||
if (this._isPicking) {
|
||||
|
@ -243,7 +242,6 @@ TouchSimulator.prototype = {
|
|||
evt.stopImmediatePropagation();
|
||||
}
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
fireMouseEvent(type, evt) {
|
||||
const content = this.getContent(evt.target);
|
||||
|
|
|
@ -550,7 +550,6 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
|
|||
/**
|
||||
* Clear the whole alignment container along the main axis for each flex item.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
renderJustifyContent() {
|
||||
if (!this.flexData || !this.currentQuads.content || !this.currentQuads.content[0]) {
|
||||
return;
|
||||
|
@ -631,7 +630,6 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
|
|||
|
||||
this.ctx.restore();
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Set up the canvas with the given options prior to drawing.
|
||||
|
@ -826,7 +824,6 @@ function getRectFromFlexItemValues(item, container) {
|
|||
* The new Flex data object.
|
||||
* @return {Boolean} true if the flex data has changed and false otherwise.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function compareFlexData(oldFlexData, newFlexData) {
|
||||
if (!oldFlexData || !newFlexData) {
|
||||
return true;
|
||||
|
@ -887,6 +884,5 @@ function compareFlexData(oldFlexData, newFlexData) {
|
|||
|
||||
return false;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
exports.FlexboxHighlighter = FlexboxHighlighter;
|
||||
|
|
|
@ -478,7 +478,6 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
this.viewport = { left, right, top, bottom, padding };
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
handleEvent(event, id) {
|
||||
// No event handling if the highlighter is hidden
|
||||
if (this.areShapesHidden()) {
|
||||
|
@ -578,7 +577,6 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
break;
|
||||
}
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Handle a mouse click in transform mode.
|
||||
|
@ -1706,7 +1704,6 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
* @returns {String} "top", "left", "right", or "bottom" if any of those edges were
|
||||
* clicked. "" if none were clicked.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
getInsetPointAt(pageX, pageY) {
|
||||
const { top, left, right, bottom } = this.coordinates;
|
||||
const zoom = getCurrentZoom(this.win);
|
||||
|
@ -1744,7 +1741,6 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
|
||||
return "";
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Parses the CSS definition given and returns the shape type associated
|
||||
|
|
|
@ -385,7 +385,6 @@ class DOMEventCollector extends MainEventCollector {
|
|||
* Get or detect jQuery events.
|
||||
*/
|
||||
class JQueryEventCollector extends MainEventCollector {
|
||||
/* eslint-disable complexity */
|
||||
getListeners(node, {checkOnly} = {}) {
|
||||
const jQuery = this.getJQuery(node);
|
||||
const handlers = [];
|
||||
|
@ -472,14 +471,12 @@ class JQueryEventCollector extends MainEventCollector {
|
|||
}
|
||||
return handlers;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
|
||||
/**
|
||||
* Get or detect jQuery live events.
|
||||
*/
|
||||
class JQueryLiveEventCollector extends MainEventCollector {
|
||||
/* eslint-disable complexity */
|
||||
getListeners(node, {checkOnly} = {}) {
|
||||
const jQuery = this.getJQuery(node);
|
||||
const handlers = [];
|
||||
|
@ -572,7 +569,6 @@ class JQueryLiveEventCollector extends MainEventCollector {
|
|||
}
|
||||
return handlers;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
normalizeListener(handlerDO) {
|
||||
function isFunctionInProxy(funcDO) {
|
||||
|
@ -870,7 +866,6 @@ class EventCollector {
|
|||
* native: false
|
||||
* }
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
processHandlerForEvent(listenerArray, listener, dbg) {
|
||||
let globalDO;
|
||||
|
||||
|
@ -1018,7 +1013,6 @@ class EventCollector {
|
|||
}
|
||||
}
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
|
||||
exports.EventCollector = EventCollector;
|
||||
|
|
|
@ -728,7 +728,6 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
|||
* hasLast: true if the last child of the node is included in the list.
|
||||
* nodes: Array of DOMNodes.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_getChildren: function(node, options = {}) {
|
||||
if (isNodeDead(node)) {
|
||||
return { hasFirst: true, hasLast: true, nodes: [] };
|
||||
|
@ -902,7 +901,6 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
|||
|
||||
return { hasFirst, hasLast, nodes };
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
getNativeAnonymousChildren: function(rawNode) {
|
||||
// Get an anonymous walker and start on the first child.
|
||||
|
@ -1095,7 +1093,6 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
|||
* @param string selectorState
|
||||
* One of "pseudo", "id", "tag", "class", "null"
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
getSuggestionsForQuery: function(query, completing, selectorState) {
|
||||
const sugs = {
|
||||
classes: new Map(),
|
||||
|
@ -1238,7 +1235,6 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
|||
suggestions: result,
|
||||
};
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Add a pseudo-class lock to a node.
|
||||
|
|
|
@ -329,7 +329,6 @@ const proto = {
|
|||
* An object that maps property names to safe getter descriptors as
|
||||
* defined by the remote debugging protocol.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
_findSafeGetterValues: function(ownProperties, limit = 0) {
|
||||
const safeGetterValues = Object.create(null);
|
||||
let obj = this.obj;
|
||||
|
@ -433,7 +432,6 @@ const proto = {
|
|||
|
||||
return safeGetterValues;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Find the safe getters for a given Debugger.Object. Safe getters are native
|
||||
|
|
|
@ -355,7 +355,6 @@ function wrappedPrimitivePreviewer(className, classObj, objectActor, grip, rawOb
|
|||
return true;
|
||||
}
|
||||
|
||||
/* eslint-disable complexity */
|
||||
function GenericObject(objectActor, grip, rawObj, specialStringBehavior = false) {
|
||||
const {obj, hooks} = objectActor;
|
||||
if (grip.preview || grip.displayString || hooks.getGripDepth() > 1) {
|
||||
|
@ -443,7 +442,6 @@ function GenericObject(objectActor, grip, rawObj, specialStringBehavior = false)
|
|||
|
||||
return true;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
// Preview functions that do not rely on the object class.
|
||||
previewers.Object = [
|
||||
|
@ -674,7 +672,6 @@ previewers.Object = [
|
|||
return true;
|
||||
},
|
||||
|
||||
/* eslint-disable complexity */
|
||||
function DOMEvent({obj, hooks}, grip, rawObj) {
|
||||
if (isWorker || !rawObj || !Event.isInstance(rawObj)) {
|
||||
return false;
|
||||
|
@ -761,7 +758,6 @@ previewers.Object = [
|
|||
|
||||
return true;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
function DOMException({obj, hooks}, grip, rawObj) {
|
||||
if (isWorker || !rawObj || obj.class !== "DOMException") {
|
||||
|
|
|
@ -835,7 +835,6 @@ var cookieHelpers = {
|
|||
* }
|
||||
* }
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
editCookie(data) {
|
||||
let {field, oldValue, newValue} = data;
|
||||
const origName = field === "name" ? oldValue : data.items.name;
|
||||
|
@ -921,7 +920,6 @@ var cookieHelpers = {
|
|||
cookie.sameSite
|
||||
);
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
_removeCookies(host, opts = {}) {
|
||||
// We use a uniqueId to emulate compound keys for cookies. We need to
|
||||
|
@ -2777,7 +2775,6 @@ const StorageActor = protocol.ActorClassWithSpec(specs.storageSpec, {
|
|||
* Pass an empty array if the host itself was affected: either completely
|
||||
* removed or cleared.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
update(action, storeType, data) {
|
||||
if (action == "cleared") {
|
||||
this.emit("stores-cleared", { [storeType]: data });
|
||||
|
@ -2842,7 +2839,6 @@ const StorageActor = protocol.ActorClassWithSpec(specs.storageSpec, {
|
|||
|
||||
return null;
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* This method removes data from the this.boundUpdate object in the same
|
||||
|
|
|
@ -534,7 +534,6 @@ WebConsoleActor.prototype =
|
|||
* @return object
|
||||
* The response object which holds the startedListeners array.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
startListeners: async function(request) {
|
||||
const startedListeners = [];
|
||||
const window = !this.parentActor.isRootActor ? this.window : null;
|
||||
|
@ -693,7 +692,6 @@ WebConsoleActor.prototype =
|
|||
traits: this.traits,
|
||||
};
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Handler for the "stopListeners" request.
|
||||
|
@ -987,7 +985,6 @@ WebConsoleActor.prototype =
|
|||
* @return object
|
||||
* The evaluation response packet.
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
evaluateJS: function(request) {
|
||||
const input = request.text;
|
||||
const timestamp = Date.now();
|
||||
|
@ -1157,7 +1154,6 @@ WebConsoleActor.prototype =
|
|||
notes: errorNotes,
|
||||
};
|
||||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* The Autocomplete request handler.
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// this file violates some naming conventions and consequently locally
|
||||
// disables some eslint rules.
|
||||
|
||||
/* eslint-disable camelcase, mozilla/no-aArgs, no-else-return, complexity */
|
||||
/* eslint-disable camelcase, mozilla/no-aArgs, no-else-return */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -539,7 +539,6 @@ function parseNamedDeclarations(isCssPropertyKnown, inputString,
|
|||
* @return {Array} an array of objects with the following signature:
|
||||
* [{ "value": string, "type": integer }, ...]
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function parsePseudoClassesAndAttributes(value) {
|
||||
if (!value) {
|
||||
throw new Error("empty input string");
|
||||
|
@ -625,7 +624,6 @@ function parsePseudoClassesAndAttributes(value) {
|
|||
|
||||
return result;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Expects a single CSS value to be passed as the input and parses the value
|
||||
|
|
|
@ -258,7 +258,6 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
|
|||
* Get any unprocessed mutation records and process them.
|
||||
*/
|
||||
getMutations(options = {}) {
|
||||
/* eslint-disable complexity */
|
||||
return super.getMutations(options).then(mutations => {
|
||||
const emitMutations = [];
|
||||
for (const change of mutations) {
|
||||
|
@ -402,7 +401,6 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
|
|||
|
||||
this.emit("mutations", emitMutations);
|
||||
});
|
||||
/* eslint-enable complexity */
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -180,7 +180,6 @@ function getLineCountInComments(text) {
|
|||
* @param string text The CSS source to prettify.
|
||||
* @return string Prettified CSS source
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function prettifyCSS(text, ruleCount) {
|
||||
if (prettifyCSS.LINE_SEPARATOR == null) {
|
||||
const os = Services.appinfo.OS;
|
||||
|
@ -406,7 +405,6 @@ function prettifyCSS(text, ruleCount) {
|
|||
|
||||
return result;
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
exports.prettifyCSS = prettifyCSS;
|
||||
|
||||
|
|
|
@ -60,7 +60,6 @@ function hasArrayIndex(str) {
|
|||
* element access (e.g. `x["match`).
|
||||
* }
|
||||
*/
|
||||
/* eslint-disable complexity */
|
||||
function analyzeInputString(str) {
|
||||
const bodyStack = [];
|
||||
|
||||
|
@ -196,7 +195,6 @@ function analyzeInputString(str) {
|
|||
|
||||
return buildReturnObject();
|
||||
}
|
||||
/* eslint-enable complexity */
|
||||
|
||||
/**
|
||||
* Provides a list of properties, that are possible matches based on the passed
|
||||
|
|
Загрузка…
Ссылка в новой задаче