Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63a0fd0

Browse files
committed
add eslint rule padded-blocks: [2, "never"]`
1 parent 4e37602 commit 63a0fd0

File tree

154 files changed

+1
-652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1
-652
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"space-in-parens": [2, "never"],
4747
"space-before-function-paren": [2, "never"],
4848
"space-before-blocks": [2],
49+
"padded-blocks": [2, "never"],
4950
"spaced-comment": [2, "always"],
5051
"no-tabs": [2],
5152
"no-multi-spaces": [2, {"ignoreEOLComments": true}],

devtools/test_dashboard/devtools.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ function debounce(func, wait, immediate) {
193193
}
194194

195195
function searchMocks(e) {
196-
197196
// Clear results.
198197
while(mocksList.firstChild) {
199198
mocksList.removeChild(mocksList.firstChild);

devtools/test_dashboard/server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ function readFiles(files) {
6666
}
6767

6868
function createMocksList(files) {
69-
7069
// eliminate pollutants (e.g .DS_Store) that can accumulate in the mock directory
7170
var jsonFiles = files.filter(function(file) {
7271
return file.name.substr(-5) === '.json';

src/components/annotations/common_defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ module.exports = function handleAnnotationCommonDefaults(annIn, annOut, fullLayo
5252
coerce('arrowwidth', ((borderOpacity && borderWidth) || 1) * 2);
5353
coerce('standoff');
5454
coerce('startstandoff');
55-
5655
}
5756

5857
var hoverText = coerce('hovertext');

src/components/annotations/draw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,6 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
634634
var xUpdate, yUpdate;
635635
if(xa) {
636636
xUpdate = xa.p2r(xa.r2p(options.x) + dx);
637-
638637
} else {
639638
var widthFraction = options._xsize / gs.w;
640639
var xLeft = options.x + (options._xshift - options.xshift) / gs.w - widthFraction / 2;

src/components/annotations/draw_arrow_head.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ module.exports = function drawArrowHead(el3, ends, options) {
7575
end.x += backOffX;
7676
end.y += backOffY;
7777
el3.attr({x2: end.x, y2: end.y});
78-
7978
}
8079

8180
if(startBackOff) {
@@ -89,7 +88,6 @@ module.exports = function drawArrowHead(el3, ends, options) {
8988
start.x -= startBackOffX;
9089
start.y -= startbackOffY;
9190
el3.attr({x1: start.x, y1: start.y});
92-
9391
}
9492
}
9593
else if(el.nodeName === 'path') {

src/components/fx/hover.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ exports.loneHover = function loneHover(hoverItem, opts) {
157157
};
158158

159159
exports.multiHovers = function multiHovers(hoverItems, opts) {
160-
161160
if(!Array.isArray(hoverItems)) {
162161
hoverItems = [hoverItems];
163162
}

src/components/images/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
2626

2727

2828
function imageDefaults(imageIn, imageOut, fullLayout) {
29-
3029
function coerce(attr, dflt) {
3130
return Lib.coerce(imageIn, imageOut, attributes, attr, dflt);
3231
}

src/components/images/draw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ module.exports = function draw(gd) {
8181
thisImage.attr('xmlns', xmlnsNamespaces.svg);
8282

8383
var imagePromise = new Promise(function(resolve) {
84-
8584
var img = new Image();
8685
this.img = img;
8786

src/components/legend/style.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ module.exports = function style(s, gd) {
146146
trace.colorscale, 'stroke');
147147
}
148148
}
149-
150149
}
151150

152151
function stylePoints(d) {

src/components/modebar/modebar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ proto.updateActiveButton = function(buttonClicked) {
270270

271271
button3.classed('active', val === thisval);
272272
}
273-
274273
});
275274
};
276275

src/components/rangeselector/draw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ module.exports = function draw(gd) {
8383

8484
reposition(gd, buttons, selectorLayout, axisLayout._name, selector);
8585
});
86-
8786
};
8887

8988
function makeSelectorData(gd) {

src/components/rangeslider/draw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ function setupDragElement(rangeSlider, gd, axisOpts, opts) {
254254
}
255255

256256
function setDataRange(rangeSlider, gd, axisOpts, opts) {
257-
258257
function clamp(v) {
259258
return axisOpts.l2r(Lib.constrain(v, opts._rl[0], opts._rl[1]));
260259
}

src/components/sliders/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module.exports = function slidersDefaults(layoutIn, layoutOut) {
2626
};
2727

2828
function sliderDefaults(sliderIn, sliderOut, layoutOut) {
29-
3029
function coerce(attr, dflt) {
3130
return Lib.coerce(sliderIn, sliderOut, attributes, attr, dflt);
3231
}

src/components/sliders/draw.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ function drawSlider(gd, sliderGroup, sliderOpts) {
277277

278278
sliderGroup.call(setGripPosition, sliderOpts, false);
279279
sliderGroup.call(drawCurrentValue, sliderOpts);
280-
281280
}
282281

283282
function drawCurrentValue(sliderGroup, sliderOpts, valueOverride) {
@@ -409,7 +408,6 @@ function drawLabelGroup(sliderGroup, sliderOpts) {
409408
dims.currentValueTotalHeight
410409
);
411410
});
412-
413411
}
414412

415413
function handleInput(gd, sliderGroup, sliderOpts, normalizedPosition, doTransition) {
@@ -540,7 +538,6 @@ function drawTicks(sliderGroup, sliderOpts) {
540538
(isMajor ? constants.tickOffset : constants.minorTickOffset) + dims.currentValueTotalHeight
541539
);
542540
});
543-
544541
}
545542

546543
function computeLabelSteps(sliderOpts) {

src/components/updatemenus/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ module.exports = function updateMenusDefaults(layoutIn, layoutOut) {
2828
};
2929

3030
function menuDefaults(menuIn, menuOut, layoutOut) {
31-
3231
function coerce(attr, dflt) {
3332
return Lib.coerce(menuIn, menuOut, attributes, attr, dflt);
3433
}

src/components/updatemenus/draw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ module.exports = function draw(gd) {
133133
} else {
134134
drawButtons(gd, gHeader, null, null, menuOpts);
135135
}
136-
137136
});
138137
};
139138

src/lib/coerce.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ exports.valObjectMeta = {
267267
// either be a matching 1D array or an array of such matching 1D arrays
268268
otherOpts: ['dflt', 'freeLength', 'dimensions'],
269269
coerceFunction: function(v, propOut, dflt, opts) {
270-
271270
// simplified coerce function just for array items
272271
function coercePart(v, opts, dflt) {
273272
var out;

src/lib/dates.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ exports.cleanDate = function(v, dflt, calendar) {
377377
*/
378378
var fracMatch = /%\d?f/g;
379379
function modDateFormat(fmt, x, formatter, calendar) {
380-
381380
fmt = fmt.replace(fracMatch, function(match) {
382381
var digits = Math.min(+(match.charAt(1)) || 6, 6);
383382
var fracSecs = ((x / 1000 % 1) + 2)

src/lib/events.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ var EventEmitter = require('events').EventEmitter;
1616
var Events = {
1717

1818
init: function(plotObj) {
19-
2019
/*
2120
* If we have already instantiated an emitter for this plot
2221
* return early.

src/lib/extend.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) {
6868
// TODO does this do the right thing for typed arrays?
6969

7070
if(length === 2 && isArray(target) && isArray(inputs[1]) && target.length === 0) {
71-
7271
allPrimitives = primitivesLoopSplice(inputs[1], target);
7372

7473
if(allPrimitives) {

src/lib/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,6 @@ lib.objectFromPath = function(path, value) {
843843

844844
tmpObj = tmpObj[el];
845845
} else {
846-
847846
if(i === keys.length - 1) {
848847
tmpObj[key] = value;
849848
} else {

src/lib/is_plain_object.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
// more info: http://stackoverflow.com/questions/18531624/isplainobject-thing
1313
module.exports = function isPlainObject(obj) {
14-
1514
// We need to be a little less strict in the `imagetest` container because
1615
// of how async image requests are handled.
1716
//

src/lib/relink_private.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) {
2828
continue;
2929
}
3030
if(k.charAt(0) === '_' || typeof fromVal === 'function') {
31-
3231
// if it already exists at this point, it's something
3332
// that we recreate each time around, so ignore it
3433
if(k in toContainer) continue;
3534

3635
toContainer[k] = fromVal;
3736
}
3837
else if(isArrayOrTypedArray(fromVal) && isArrayOrTypedArray(toVal) && isPlainObject(fromVal[0])) {
39-
4038
// filter out data_array items that can contain user objects
4139
// most of the time the toVal === fromVal check will catch these early
4240
// but if the user makes new ones we also don't want to recurse in.
@@ -51,7 +49,6 @@ module.exports = function relinkPrivateKeys(toContainer, fromContainer) {
5149
}
5250
}
5351
else if(isPlainObject(fromVal) && isPlainObject(toVal)) {
54-
5552
// recurse into objects, but only if they still exist
5653
relinkPrivateKeys(toVal, fromVal);
5754

src/lib/svg_text_utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ function cleanEscapesForTex(s) {
163163
}
164164

165165
function texToSVG(_texString, _config, _callback) {
166-
167166
var originalRenderer,
168167
originalConfig,
169168
originalProcessSectionDelay,

src/plot_api/helpers.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ function cleanAxRef(container, attr) {
237237
*/
238238
function cleanTitle(titleContainer) {
239239
if(titleContainer) {
240-
241240
// title -> title.text
242241
// (although title used to be a string attribute,
243242
// numbers are accepted as well)
@@ -258,7 +257,6 @@ function cleanTitle(titleContainer) {
258257
var newAttrSet = titleContainer.title && titleContainer.title[newAttrName];
259258

260259
if(oldAttrSet && !newAttrSet) {
261-
262260
// Ensure title object exists
263261
if(!titleContainer.title) {
264262
titleContainer.title = {};
@@ -613,7 +611,6 @@ exports.manageArrayContainers = function(np, newVal, undoit) {
613611

614612
// delete item
615613
if(pLastIsNumber && newVal === null) {
616-
617614
// Clear item in array container when new value is null
618615
var contPath = parts.slice(0, pLength - 1).join('.');
619616
var cont = Lib.nestedProperty(obj, contPath).get();
@@ -624,15 +621,13 @@ exports.manageArrayContainers = function(np, newVal, undoit) {
624621
}
625622
// create item
626623
else if(pLastIsNumber && np.get() === undefined) {
627-
628624
// When adding a new item, make sure undo command will remove it
629625
if(np.get() === undefined) undoit[np.astr] = null;
630626

631627
np.set(newVal);
632628
}
633629
// update item
634630
else {
635-
636631
// If the last part of attribute string isn't a number,
637632
// np.set is all we need.
638633
np.set(newVal);

src/plot_api/plot_api.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,6 @@ function assertIndexArray(gd, indices, arrayName) {
733733
* @param newIndices
734734
*/
735735
function checkMoveTracesArgs(gd, currentIndices, newIndices) {
736-
737736
// check that gd has attribute 'data' and 'data' is array
738737
if(!Array.isArray(gd.data)) {
739738
throw new Error('gd.data must be an array.');
@@ -759,7 +758,6 @@ function checkMoveTracesArgs(gd, currentIndices, newIndices) {
759758
if(typeof newIndices !== 'undefined' && currentIndices.length !== newIndices.length) {
760759
throw new Error('current and new indices must be of equal length.');
761760
}
762-
763761
}
764762
/**
765763
* A private function to reduce the type checking clutter in addTraces.
@@ -816,7 +814,6 @@ function checkAddTracesArgs(gd, traces, newIndices) {
816814
* @param maxPoints
817815
*/
818816
function assertExtendTracesArgs(gd, update, indices, maxPoints) {
819-
820817
var maxPointsIsObject = Lib.isPlainObject(maxPoints);
821818

822819
if(!Array.isArray(gd.data)) {
@@ -833,7 +830,6 @@ function assertExtendTracesArgs(gd, update, indices, maxPoints) {
833830
assertIndexArray(gd, indices, 'indices');
834831

835832
for(var key in update) {
836-
837833
/*
838834
* Verify that the attribute to be updated contains as many trace updates
839835
* as indices. Failure must result in throw and no-op
@@ -864,7 +860,6 @@ function assertExtendTracesArgs(gd, update, indices, maxPoints) {
864860
* @return {Object[]}
865861
*/
866862
function getExtendProperties(gd, update, indices, maxPoints) {
867-
868863
var maxPointsIsObject = Lib.isPlainObject(maxPoints);
869864
var updateProps = [];
870865
var trace, target, prop, insert, maxp;
@@ -877,9 +872,7 @@ function getExtendProperties(gd, update, indices, maxPoints) {
877872

878873
// loop through all update keys and traces and harvest validated data.
879874
for(var key in update) {
880-
881875
for(var j = 0; j < indices.length; j++) {
882-
883876
/*
884877
* Choose the trace indexed by the indices map argument and get the prop setter-getter
885878
* instance that references the key and value for this particular trace.
@@ -1166,12 +1159,10 @@ exports.addTraces = function addTraces(gd, traces, newIndices) {
11661159
}
11671160

11681161
try {
1169-
11701162
// this is redundant, but necessary to not catch later possible errors!
11711163
checkMoveTracesArgs(gd, currentIndices, newIndices);
11721164
}
11731165
catch(error) {
1174-
11751166
// something went wrong, reset gd to be safe and rethrow error
11761167
gd.data.splice(gd.data.length - traces.length, traces.length);
11771168
throw error;
@@ -1296,7 +1287,6 @@ exports.moveTraces = function moveTraces(gd, currentIndices, newIndices) {
12961287

12971288
// get the traces that aren't being moved around
12981289
for(i = 0; i < gd.data.length; i++) {
1299-
13001290
// if index isn't in currentIndices, include it in ignored!
13011291
if(currentIndices.indexOf(i) === -1) {
13021292
newData.push(gd.data[i]);
@@ -2747,7 +2737,6 @@ exports.react = function(gd, data, layout, config) {
27472737
plotDone = exports.newPlot(gd, data, layout, config);
27482738
}
27492739
else {
2750-
27512740
if(Lib.isPlainObject(data)) {
27522741
var obj = data;
27532742
data = obj.data;
@@ -2877,7 +2866,6 @@ exports.react = function(gd, data, layout, config) {
28772866

28782867
return gd;
28792868
});
2880-
28812869
};
28822870

28832871
function diffData(gd, oldFullData, newFullData, immutable, transition, newDataRevision) {
@@ -3099,7 +3087,6 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) {
30993087
}
31003088
else if(canBeDataArray) {
31013089
if(wasArray && nowArray) {
3102-
31033090
// don't try to diff two data arrays. If immutable we know the data changed,
31043091
// if not, assume it didn't and let `layout.datarevision` tell us if it did
31053092
if(immutable) {
@@ -3394,7 +3381,6 @@ exports.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
33943381
if(newFrame.onComplete) {
33953382
newFrame.onComplete();
33963383
}
3397-
33983384
});
33993385

34003386
gd.emit('plotly_animatingframe', {
@@ -3658,7 +3644,6 @@ exports.addFrames = function(gd, frameList, indices) {
36583644
if(typeof frame.name === 'number') {
36593645
Lib.warn('Warning: addFrames accepts frames with numeric names, but the numbers are' +
36603646
'implicitly cast to strings');
3661-
36623647
}
36633648

36643649
if(!frame.name) {

0 commit comments

Comments
 (0)