Skip to content

Commit

Permalink
[eslint] changing to always-multiline on comma-dangle (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jul 21, 2016
1 parent 7bba9f7 commit fa0497d
Show file tree
Hide file tree
Showing 24 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion caravel/assets/.eslintrc
Expand Up @@ -30,7 +30,7 @@
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"callback-return": [2, ["callback"]],
"camelcase": [0],
"comma-dangle": [2, "never"],
"comma-dangle": [2, "always-multiline"],
"comma-spacing": [2],
"comma-style": [2, "last"],
"curly": [2, "all"],
Expand Down
18 changes: 9 additions & 9 deletions caravel/assets/javascripts/modules/caravel.js
Expand Up @@ -32,7 +32,7 @@ var sourceMap = {
treemap: 'treemap.js',
cal_heatmap: 'cal_heatmap.js',
horizon: 'horizon.js',
mapbox: 'mapbox.jsx'
mapbox: 'mapbox.jsx',
};

var color = function () {
Expand All @@ -41,13 +41,13 @@ var color = function () {
//rausch hackb kazan babu lima beach barol
'#ff5a5f', '#7b0051', '#007A87', '#00d1c1', '#8ce071', '#ffb400', '#b4a76c',
'#ff8083', '#cc0086', '#00a1b3', '#00ffeb', '#bbedab', '#ffd266', '#cbc29a',
'#ff3339', '#ff1ab1', '#005c66', '#00b3a5', '#55d12e', '#b37e00', '#988b4e'
'#ff3339', '#ff1ab1', '#005c66', '#00b3a5', '#55d12e', '#b37e00', '#988b4e',
];
var spectrums = {
blue_white_yellow: ['#00d1c1', 'white', '#ffb400'],
fire: ['white', 'yellow', 'red', 'black'],
white_black: ['white', 'black'],
black_white: ['black', 'white']
black_white: ['black', 'white'],
};
var colorBnb = function () {
// Color factory
Expand Down Expand Up @@ -84,7 +84,7 @@ var color = function () {
return {
bnbColors: bnbColors,
category21: colorBnb(),
colorScalerFactory: colorScalerFactory
colorScalerFactory: colorScalerFactory,
};
};

Expand Down Expand Up @@ -124,7 +124,7 @@ var px = (function () {
}], // If the first of the month, do "month day, year."
["%Y", function (d) {
return true;
}] // fall back on month, year
}], // fall back on month, year
]);

function formatDate(dttm) {
Expand Down Expand Up @@ -226,7 +226,7 @@ var px = (function () {
render_template: function (s) {
var context = {
width: this.width,
height: this.height
height: this.height,
};
return Mustache.render(s, context);
},
Expand All @@ -235,7 +235,7 @@ var px = (function () {
var parser = document.createElement('a');
parser.href = data.json_endpoint;
var endpoint = parser.pathname + this.querystring({
extraFilters: params.extraFilters
extraFilters: params.extraFilters,
});
endpoint += "&json=true";
endpoint += "&force=" + this.force;
Expand Down Expand Up @@ -395,7 +395,7 @@ var px = (function () {
if (dashboard !== undefined) {
delete dashboard.removeFilter(slice_id, col, vals);
}
}
},
};
var visType = data.form_data.viz_type;
px.registerViz(visType);
Expand Down Expand Up @@ -424,7 +424,7 @@ var px = (function () {
timeFormatFactory: timeFormatFactory,
color: color(),
getParam: getParam,
initFavStars: initFavStars
initFavStars: initFavStars,
};
})();

Expand Down
2 changes: 1 addition & 1 deletion caravel/assets/javascripts/modules/utils.js
Expand Up @@ -120,5 +120,5 @@ module.exports = {
showModal: showModal,
toggleCheckbox: toggleCheckbox,
fixDataTableBodyHeight: fixDataTableBodyHeight,
d3format: d3format
d3format: d3format,
};
14 changes: 7 additions & 7 deletions caravel/assets/javascripts/sql.js
Expand Up @@ -32,12 +32,12 @@ $(document).ready(function () {
editor.setTheme("ace/theme/crimson_editor");
editor.setOptions({
minLines: 16,
maxLines: Infinity
maxLines: Infinity,
});
editor.getSession().setMode("ace/mode/sql");
editor.focus();
$("select").select2({
dropdownAutoWidth: true
dropdownAutoWidth: true,
});

function showTableMetadata() {
Expand All @@ -49,7 +49,7 @@ $(document).ready(function () {
$("#create_view").click(function () {
showModal({
title: "Error",
body: "Sorry, this feature is not yet implemented"
body: "Sorry, this feature is not yet implemented",
});
});
$(".sqlcontent").show();
Expand Down Expand Up @@ -80,8 +80,8 @@ $(document).ready(function () {
data: {
data: JSON.stringify({
database_id: $('#database_id').val(),
sql: editor.getSession().getValue()
})
sql: editor.getSession().getValue(),
}),
},
success: function (data) {
$('#loading').hide(0);
Expand All @@ -92,14 +92,14 @@ $(document).ready(function () {
retrieve: true,
paging: false,
searching: true,
aaSorting: []
aaSorting: [],
});
},
error: function (err, err2) {
$('#loading').hide(0);
$('#results').show(0);
$('#results').html(err.responseText);
}
},
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions caravel/assets/javascripts/welcome.js
Expand Up @@ -35,7 +35,7 @@ function modelViewTable(selector, modelView, orderCol, order) {
bLengthChange: false,
aaSorting: [],
searching: true,
bInfo: false
bInfo: false,
});

// Hack to move the searchbox in the right spot
Expand Down Expand Up @@ -74,7 +74,7 @@ $(document).ready(function () {
domain: "month",
subDomain: "day",
itemName: "action",
tooltip: true
tooltip: true,
});
});
modelViewTable('#dash_table', 'DashboardModelViewAsync', 'changed_on', 'desc');
Expand Down
2 changes: 1 addition & 1 deletion caravel/assets/spec/helpers/browser.js
Expand Up @@ -16,7 +16,7 @@ Object.keys(document.defaultView).forEach((property) => {
});

global.navigator = {
userAgent: 'node.js'
serAgent: 'node.js',
};

documentRef = document;
2 changes: 1 addition & 1 deletion caravel/assets/visualizations/big_number.js
Expand Up @@ -180,7 +180,7 @@ function bigNumberVis(slice) {

return {
render: render,
resize: render
resize: render,
};
}

Expand Down
4 changes: 2 additions & 2 deletions caravel/assets/visualizations/cal_heatmap.js
Expand Up @@ -39,7 +39,7 @@ function calHeatmap(slice) {
subDomain: json.data["subdomain"],
range: json.data["range"],
browsing: true,
legend: [extents[0], extents[0]+step, extents[0]+step*2, extents[0]+step*3]
legend: [extents[0], extents[0]+step, extents[0]+step*2, extents[0]+step*3],
});
} catch (e) {
slice.error(e);
Expand All @@ -51,7 +51,7 @@ function calHeatmap(slice) {

return {
render: render,
resize: render
resize: render,
};
}

Expand Down
6 changes: 3 additions & 3 deletions caravel/assets/visualizations/directed_force.js
Expand Up @@ -24,10 +24,10 @@ function directedForceVis(slice) {
// Compute the distinct nodes from the links.
links.forEach(function (link) {
link.source = nodes[link.source] || (nodes[link.source] = {
name: link.source
name: link.source,
});
link.target = nodes[link.target] || (nodes[link.target] = {
name: link.target
name: link.target,
});
link.value = Number(link.value);

Expand Down Expand Up @@ -168,7 +168,7 @@ function directedForceVis(slice) {
};
return {
render: render,
resize: render
resize: render,
};
}

Expand Down
6 changes: 3 additions & 3 deletions caravel/assets/visualizations/filter_box.js
Expand Up @@ -30,7 +30,7 @@ function filterBox(slice) {
$.getJSON(slice.jsonEndpoint({
// filter box should ignore the filters
// otherwise there will be only a few options in the dropdown menu
extraFilters: false
extraFilters: false,
}), function (payload) {
var maxes = {};

Expand All @@ -57,7 +57,7 @@ function filterBox(slice) {
dropdownAutoWidth: true,
data: data,
multiple: true,
formatResult: select2Formatter
formatResult: select2Formatter,
})
.on('change', fltChanged);

Expand Down Expand Up @@ -85,7 +85,7 @@ function filterBox(slice) {
};
return {
render: refresh,
resize: refresh
resize: refresh,
};
}

Expand Down
6 changes: 3 additions & 3 deletions caravel/assets/visualizations/heatmap.js
Expand Up @@ -17,7 +17,7 @@ function heatmapVis(slice) {
top: 10,
right: 10,
bottom: 35,
left: 35
left: 35,
};

d3.json(slice.jsonEndpoint(), function (error, payload) {
Expand Down Expand Up @@ -92,7 +92,7 @@ function heatmapVis(slice) {
.range([0, hmWidth]),
d3.scale.linear()
.domain([0, heatmapDim[Y]])
.range([0, hmHeight])
.range([0, hmHeight]),
];

var container = d3.select(slice.selector);
Expand Down Expand Up @@ -228,7 +228,7 @@ function heatmapVis(slice) {
}
return {
render: refresh,
resize: refresh
resize: refresh,
};
}

Expand Down
2 changes: 1 addition & 1 deletion caravel/assets/visualizations/horizon.js
Expand Up @@ -230,7 +230,7 @@ function horizonViz(slice) {
}
return {
render: refresh,
resize: refresh
resize: refresh,
};
}

Expand Down
2 changes: 1 addition & 1 deletion caravel/assets/visualizations/iframe.js
Expand Up @@ -19,7 +19,7 @@ function iframeWidget(slice) {

return {
render: refresh,
resize: refresh
resize: refresh,
};
}

Expand Down
2 changes: 1 addition & 1 deletion caravel/assets/visualizations/markup.js
Expand Up @@ -15,7 +15,7 @@ function markupWidget(slice) {
}
return {
render: refresh,
resize: refresh
resize: refresh,
};
}

Expand Down
2 changes: 1 addition & 1 deletion caravel/assets/visualizations/nvd3_vis.js
Expand Up @@ -267,7 +267,7 @@ function nvd3Vis(slice) {

return {
render: render,
resize: update
resize: update,
};
}

Expand Down
6 changes: 3 additions & 3 deletions caravel/assets/visualizations/parallel_coordinates.js
Expand Up @@ -76,7 +76,7 @@ function parallelCoordVis(slice) {
mouseover: function (d) {
parcoords.highlight([d]);
},
mouseout: parcoords.unhighlight
mouseout: parcoords.unhighlight,
});
// update data table on brush event
parcoords.on("brush", function (d) {
Expand All @@ -88,7 +88,7 @@ function parallelCoordVis(slice) {
mouseover: function (d) {
parcoords.highlight([d]);
},
mouseout: parcoords.unhighlight
mouseout: parcoords.unhighlight,
});
});
}
Expand All @@ -101,7 +101,7 @@ function parallelCoordVis(slice) {

return {
render: refresh,
resize: refresh
resize: refresh,
};
}

Expand Down
4 changes: 2 additions & 2 deletions caravel/assets/visualizations/pivot_table.js
Expand Up @@ -21,7 +21,7 @@ module.exports = function (slice) {
bInfo: false,
scrollY: height + "px",
scrollCollapse: true,
scrollX: true
scrollX: true,
});
table.column('-1').order('desc').draw();
utils.fixDataTableBodyHeight(
Expand All @@ -34,6 +34,6 @@ module.exports = function (slice) {
}
return {
render: refresh,
resize: refresh
resize: refresh,
};
};
6 changes: 3 additions & 3 deletions caravel/assets/visualizations/sankey.js
Expand Up @@ -13,7 +13,7 @@ function sankeyVis(slice) {
top: 5,
right: 5,
bottom: 5,
left: 5
left: 5,
};
var width = slice.width() - margin.left - margin.right;
var height = slice.height() - margin.top - margin.bottom;
Expand Down Expand Up @@ -143,7 +143,7 @@ function sankeyVis(slice) {
"<div class='percents'>",
"<span class='emph'>", (isFinite(sourcePercent) ? sourcePercent : "100"), "%</span> of ", d.source.name, "<br/>",
"<span class='emph'>" + (isFinite(targetPercent) ? targetPercent : "--") + "%</span> of ", d.target.name, "target",
"</div>"
"</div>",
].join("");
}
return html;
Expand All @@ -170,7 +170,7 @@ function sankeyVis(slice) {
};
return {
render: render,
resize: render
resize: render,
};
}

Expand Down

0 comments on commit fa0497d

Please sign in to comment.