[eslint] changing to always-multiline on comma-dangle (#794)

This commit is contained in:
Maxime Beauchemin 2016-07-20 21:32:20 -07:00 committed by GitHub
parent 7bba9f73d0
commit fa0497de5e
24 changed files with 77 additions and 77 deletions

View File

@ -30,7 +30,7 @@
"brace-style": [2, "1tbs", { "allowSingleLine": true }], "brace-style": [2, "1tbs", { "allowSingleLine": true }],
"callback-return": [2, ["callback"]], "callback-return": [2, ["callback"]],
"camelcase": [0], "camelcase": [0],
"comma-dangle": [2, "never"], "comma-dangle": [2, "always-multiline"],
"comma-spacing": [2], "comma-spacing": [2],
"comma-style": [2, "last"], "comma-style": [2, "last"],
"curly": [2, "all"], "curly": [2, "all"],

View File

@ -32,7 +32,7 @@ var sourceMap = {
treemap: 'treemap.js', treemap: 'treemap.js',
cal_heatmap: 'cal_heatmap.js', cal_heatmap: 'cal_heatmap.js',
horizon: 'horizon.js', horizon: 'horizon.js',
mapbox: 'mapbox.jsx' mapbox: 'mapbox.jsx',
}; };
var color = function () { var color = function () {
@ -41,13 +41,13 @@ var color = function () {
//rausch hackb kazan babu lima beach barol //rausch hackb kazan babu lima beach barol
'#ff5a5f', '#7b0051', '#007A87', '#00d1c1', '#8ce071', '#ffb400', '#b4a76c', '#ff5a5f', '#7b0051', '#007A87', '#00d1c1', '#8ce071', '#ffb400', '#b4a76c',
'#ff8083', '#cc0086', '#00a1b3', '#00ffeb', '#bbedab', '#ffd266', '#cbc29a', '#ff8083', '#cc0086', '#00a1b3', '#00ffeb', '#bbedab', '#ffd266', '#cbc29a',
'#ff3339', '#ff1ab1', '#005c66', '#00b3a5', '#55d12e', '#b37e00', '#988b4e' '#ff3339', '#ff1ab1', '#005c66', '#00b3a5', '#55d12e', '#b37e00', '#988b4e',
]; ];
var spectrums = { var spectrums = {
blue_white_yellow: ['#00d1c1', 'white', '#ffb400'], blue_white_yellow: ['#00d1c1', 'white', '#ffb400'],
fire: ['white', 'yellow', 'red', 'black'], fire: ['white', 'yellow', 'red', 'black'],
white_black: ['white', 'black'], white_black: ['white', 'black'],
black_white: ['black', 'white'] black_white: ['black', 'white'],
}; };
var colorBnb = function () { var colorBnb = function () {
// Color factory // Color factory
@ -84,7 +84,7 @@ var color = function () {
return { return {
bnbColors: bnbColors, bnbColors: bnbColors,
category21: colorBnb(), category21: colorBnb(),
colorScalerFactory: colorScalerFactory colorScalerFactory: colorScalerFactory,
}; };
}; };
@ -124,7 +124,7 @@ var px = (function () {
}], // If the first of the month, do "month day, year." }], // If the first of the month, do "month day, year."
["%Y", function (d) { ["%Y", function (d) {
return true; return true;
}] // fall back on month, year }], // fall back on month, year
]); ]);
function formatDate(dttm) { function formatDate(dttm) {
@ -226,7 +226,7 @@ var px = (function () {
render_template: function (s) { render_template: function (s) {
var context = { var context = {
width: this.width, width: this.width,
height: this.height height: this.height,
}; };
return Mustache.render(s, context); return Mustache.render(s, context);
}, },
@ -235,7 +235,7 @@ var px = (function () {
var parser = document.createElement('a'); var parser = document.createElement('a');
parser.href = data.json_endpoint; parser.href = data.json_endpoint;
var endpoint = parser.pathname + this.querystring({ var endpoint = parser.pathname + this.querystring({
extraFilters: params.extraFilters extraFilters: params.extraFilters,
}); });
endpoint += "&json=true"; endpoint += "&json=true";
endpoint += "&force=" + this.force; endpoint += "&force=" + this.force;
@ -395,7 +395,7 @@ var px = (function () {
if (dashboard !== undefined) { if (dashboard !== undefined) {
delete dashboard.removeFilter(slice_id, col, vals); delete dashboard.removeFilter(slice_id, col, vals);
} }
} },
}; };
var visType = data.form_data.viz_type; var visType = data.form_data.viz_type;
px.registerViz(visType); px.registerViz(visType);
@ -424,7 +424,7 @@ var px = (function () {
timeFormatFactory: timeFormatFactory, timeFormatFactory: timeFormatFactory,
color: color(), color: color(),
getParam: getParam, getParam: getParam,
initFavStars: initFavStars initFavStars: initFavStars,
}; };
})(); })();

View File

@ -120,5 +120,5 @@ module.exports = {
showModal: showModal, showModal: showModal,
toggleCheckbox: toggleCheckbox, toggleCheckbox: toggleCheckbox,
fixDataTableBodyHeight: fixDataTableBodyHeight, fixDataTableBodyHeight: fixDataTableBodyHeight,
d3format: d3format d3format: d3format,
}; };

View File

@ -32,12 +32,12 @@ $(document).ready(function () {
editor.setTheme("ace/theme/crimson_editor"); editor.setTheme("ace/theme/crimson_editor");
editor.setOptions({ editor.setOptions({
minLines: 16, minLines: 16,
maxLines: Infinity maxLines: Infinity,
}); });
editor.getSession().setMode("ace/mode/sql"); editor.getSession().setMode("ace/mode/sql");
editor.focus(); editor.focus();
$("select").select2({ $("select").select2({
dropdownAutoWidth: true dropdownAutoWidth: true,
}); });
function showTableMetadata() { function showTableMetadata() {
@ -49,7 +49,7 @@ $(document).ready(function () {
$("#create_view").click(function () { $("#create_view").click(function () {
showModal({ showModal({
title: "Error", title: "Error",
body: "Sorry, this feature is not yet implemented" body: "Sorry, this feature is not yet implemented",
}); });
}); });
$(".sqlcontent").show(); $(".sqlcontent").show();
@ -80,8 +80,8 @@ $(document).ready(function () {
data: { data: {
data: JSON.stringify({ data: JSON.stringify({
database_id: $('#database_id').val(), database_id: $('#database_id').val(),
sql: editor.getSession().getValue() sql: editor.getSession().getValue(),
}) }),
}, },
success: function (data) { success: function (data) {
$('#loading').hide(0); $('#loading').hide(0);
@ -92,14 +92,14 @@ $(document).ready(function () {
retrieve: true, retrieve: true,
paging: false, paging: false,
searching: true, searching: true,
aaSorting: [] aaSorting: [],
}); });
}, },
error: function (err, err2) { error: function (err, err2) {
$('#loading').hide(0); $('#loading').hide(0);
$('#results').show(0); $('#results').show(0);
$('#results').html(err.responseText); $('#results').html(err.responseText);
} },
}); });
}); });
} }

View File

@ -35,7 +35,7 @@ function modelViewTable(selector, modelView, orderCol, order) {
bLengthChange: false, bLengthChange: false,
aaSorting: [], aaSorting: [],
searching: true, searching: true,
bInfo: false bInfo: false,
}); });
// Hack to move the searchbox in the right spot // Hack to move the searchbox in the right spot
@ -74,7 +74,7 @@ $(document).ready(function () {
domain: "month", domain: "month",
subDomain: "day", subDomain: "day",
itemName: "action", itemName: "action",
tooltip: true tooltip: true,
}); });
}); });
modelViewTable('#dash_table', 'DashboardModelViewAsync', 'changed_on', 'desc'); modelViewTable('#dash_table', 'DashboardModelViewAsync', 'changed_on', 'desc');

View File

@ -16,7 +16,7 @@ Object.keys(document.defaultView).forEach((property) => {
}); });
global.navigator = { global.navigator = {
userAgent: 'node.js' serAgent: 'node.js',
}; };
documentRef = document; documentRef = document;

View File

@ -180,7 +180,7 @@ function bigNumberVis(slice) {
return { return {
render: render, render: render,
resize: render resize: render,
}; };
} }

View File

@ -39,7 +39,7 @@ function calHeatmap(slice) {
subDomain: json.data["subdomain"], subDomain: json.data["subdomain"],
range: json.data["range"], range: json.data["range"],
browsing: true, 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) { } catch (e) {
slice.error(e); slice.error(e);
@ -51,7 +51,7 @@ function calHeatmap(slice) {
return { return {
render: render, render: render,
resize: render resize: render,
}; };
} }

View File

@ -24,10 +24,10 @@ function directedForceVis(slice) {
// Compute the distinct nodes from the links. // Compute the distinct nodes from the links.
links.forEach(function (link) { links.forEach(function (link) {
link.source = nodes[link.source] || (nodes[link.source] = { link.source = nodes[link.source] || (nodes[link.source] = {
name: link.source name: link.source,
}); });
link.target = nodes[link.target] || (nodes[link.target] = { link.target = nodes[link.target] || (nodes[link.target] = {
name: link.target name: link.target,
}); });
link.value = Number(link.value); link.value = Number(link.value);
@ -168,7 +168,7 @@ function directedForceVis(slice) {
}; };
return { return {
render: render, render: render,
resize: render resize: render,
}; };
} }

View File

@ -30,7 +30,7 @@ function filterBox(slice) {
$.getJSON(slice.jsonEndpoint({ $.getJSON(slice.jsonEndpoint({
// filter box should ignore the filters // filter box should ignore the filters
// otherwise there will be only a few options in the dropdown menu // otherwise there will be only a few options in the dropdown menu
extraFilters: false extraFilters: false,
}), function (payload) { }), function (payload) {
var maxes = {}; var maxes = {};
@ -57,7 +57,7 @@ function filterBox(slice) {
dropdownAutoWidth: true, dropdownAutoWidth: true,
data: data, data: data,
multiple: true, multiple: true,
formatResult: select2Formatter formatResult: select2Formatter,
}) })
.on('change', fltChanged); .on('change', fltChanged);
@ -85,7 +85,7 @@ function filterBox(slice) {
}; };
return { return {
render: refresh, render: refresh,
resize: refresh resize: refresh,
}; };
} }

View File

@ -17,7 +17,7 @@ function heatmapVis(slice) {
top: 10, top: 10,
right: 10, right: 10,
bottom: 35, bottom: 35,
left: 35 left: 35,
}; };
d3.json(slice.jsonEndpoint(), function (error, payload) { d3.json(slice.jsonEndpoint(), function (error, payload) {
@ -92,7 +92,7 @@ function heatmapVis(slice) {
.range([0, hmWidth]), .range([0, hmWidth]),
d3.scale.linear() d3.scale.linear()
.domain([0, heatmapDim[Y]]) .domain([0, heatmapDim[Y]])
.range([0, hmHeight]) .range([0, hmHeight]),
]; ];
var container = d3.select(slice.selector); var container = d3.select(slice.selector);
@ -228,7 +228,7 @@ function heatmapVis(slice) {
} }
return { return {
render: refresh, render: refresh,
resize: refresh resize: refresh,
}; };
} }

View File

@ -230,7 +230,7 @@ function horizonViz(slice) {
} }
return { return {
render: refresh, render: refresh,
resize: refresh resize: refresh,
}; };
} }

View File

@ -19,7 +19,7 @@ function iframeWidget(slice) {
return { return {
render: refresh, render: refresh,
resize: refresh resize: refresh,
}; };
} }

View File

@ -15,7 +15,7 @@ function markupWidget(slice) {
} }
return { return {
render: refresh, render: refresh,
resize: refresh resize: refresh,
}; };
} }

View File

@ -267,7 +267,7 @@ function nvd3Vis(slice) {
return { return {
render: render, render: render,
resize: update resize: update,
}; };
} }

View File

@ -76,7 +76,7 @@ function parallelCoordVis(slice) {
mouseover: function (d) { mouseover: function (d) {
parcoords.highlight([d]); parcoords.highlight([d]);
}, },
mouseout: parcoords.unhighlight mouseout: parcoords.unhighlight,
}); });
// update data table on brush event // update data table on brush event
parcoords.on("brush", function (d) { parcoords.on("brush", function (d) {
@ -88,7 +88,7 @@ function parallelCoordVis(slice) {
mouseover: function (d) { mouseover: function (d) {
parcoords.highlight([d]); parcoords.highlight([d]);
}, },
mouseout: parcoords.unhighlight mouseout: parcoords.unhighlight,
}); });
}); });
} }
@ -101,7 +101,7 @@ function parallelCoordVis(slice) {
return { return {
render: refresh, render: refresh,
resize: refresh resize: refresh,
}; };
} }

View File

@ -21,7 +21,7 @@ module.exports = function (slice) {
bInfo: false, bInfo: false,
scrollY: height + "px", scrollY: height + "px",
scrollCollapse: true, scrollCollapse: true,
scrollX: true scrollX: true,
}); });
table.column('-1').order('desc').draw(); table.column('-1').order('desc').draw();
utils.fixDataTableBodyHeight( utils.fixDataTableBodyHeight(
@ -34,6 +34,6 @@ module.exports = function (slice) {
} }
return { return {
render: refresh, render: refresh,
resize: refresh resize: refresh,
}; };
}; };

View File

@ -13,7 +13,7 @@ function sankeyVis(slice) {
top: 5, top: 5,
right: 5, right: 5,
bottom: 5, bottom: 5,
left: 5 left: 5,
}; };
var width = slice.width() - margin.left - margin.right; var width = slice.width() - margin.left - margin.right;
var height = slice.height() - margin.top - margin.bottom; var height = slice.height() - margin.top - margin.bottom;
@ -143,7 +143,7 @@ function sankeyVis(slice) {
"<div class='percents'>", "<div class='percents'>",
"<span class='emph'>", (isFinite(sourcePercent) ? sourcePercent : "100"), "%</span> of ", d.source.name, "<br/>", "<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", "<span class='emph'>" + (isFinite(targetPercent) ? targetPercent : "--") + "%</span> of ", d.target.name, "target",
"</div>" "</div>",
].join(""); ].join("");
} }
return html; return html;
@ -170,7 +170,7 @@ function sankeyVis(slice) {
}; };
return { return {
render: render, render: render,
resize: render resize: render,
}; };
} }

View File

@ -71,7 +71,7 @@ function sunburstVis(slice) {
width: visWidth / maxBreadcrumbs, width: visWidth / maxBreadcrumbs,
height: breadcrumbHeight *0.8, // more margin height: breadcrumbHeight *0.8, // more margin
spacing: 3, spacing: 3,
tipTailWidth: 10 tipTailWidth: 10,
}; };
breadcrumbs = svg.append("svg:g") breadcrumbs = svg.append("svg:g")
@ -301,7 +301,7 @@ function sunburstVis(slice) {
function buildHierarchy(rows) { function buildHierarchy(rows) {
var root = { var root = {
name: "root", name: "root",
children: [] children: [],
}; };
for (var i = 0; i < rows.length; i++) { // each record [groupby1val, groupby2val, (<string> or 0)n, m1, m2] for (var i = 0; i < rows.length; i++) { // each record [groupby1val, groupby2val, (<string> or 0)n, m1, m2]
@ -338,7 +338,7 @@ function sunburstVis(slice) {
childNode = { childNode = {
name: nodeName, name: nodeName,
children: [], children: [],
level: level level: level,
}; };
children.push(childNode); children.push(childNode);
} }
@ -349,7 +349,7 @@ function sunburstVis(slice) {
childNode = { childNode = {
name: nodeName, name: nodeName,
m1: m1, m1: m1,
m2: m2 m2: m2,
}; };
children.push(childNode); children.push(childNode);
} }
@ -379,7 +379,7 @@ function sunburstVis(slice) {
return { return {
render: render, render: render,
resize: render resize: render,
}; };
} }

View File

@ -79,7 +79,7 @@ function tableVis(slice) {
return { return {
col: c, col: c,
val: val, val: val,
isMetric: metrics.indexOf(c) >= 0 isMetric: metrics.indexOf(c) >= 0,
}; };
}); });
}).enter() }).enter()
@ -132,7 +132,7 @@ function tableVis(slice) {
bInfo: false, bInfo: false,
scrollY: height + "px", scrollY: height + "px",
scrollCollapse: true, scrollCollapse: true,
scrollX: true scrollX: true,
}); });
utils.fixDataTableBodyHeight( utils.fixDataTableBodyHeight(
slice.container.find('.dataTables_wrapper'), height); slice.container.find('.dataTables_wrapper'), height);
@ -148,7 +148,7 @@ function tableVis(slice) {
return { return {
render: refresh, render: refresh,
resize: function () {} resize: function () {},
}; };
} }

View File

@ -251,7 +251,7 @@ function treemap(slice) {
return { return {
render: render, render: render,
resize: render resize: render,
}; };
} }

View File

@ -14,7 +14,7 @@ function wordCloudChart(slice) {
var data = json.data; var data = json.data;
var range = [ var range = [
json.form_data.size_from, json.form_data.size_from,
json.form_data.size_to json.form_data.size_to,
]; ];
var rotation = json.form_data.rotation; var rotation = json.form_data.rotation;
var f_rotation; var f_rotation;
@ -84,7 +84,7 @@ function wordCloudChart(slice) {
return { return {
render: refresh, render: refresh,
resize: refresh resize: refresh,
}; };
} }

View File

@ -58,7 +58,7 @@ function worldMapChart(slice) {
element: slice.container.get(0), element: slice.container.get(0),
data: data, data: data,
fills: { fills: {
defaultFill: '#ddd' defaultFill: '#ddd',
}, },
geographyConfig: { geographyConfig: {
popupOnHover: true, popupOnHover: true,
@ -70,7 +70,7 @@ function worldMapChart(slice) {
highlightBorderWidth: 1, highlightBorderWidth: 1,
popupTemplate: function (geo, data) { popupTemplate: function (geo, data) {
return '<div class="hoverinfo"><strong>' + data.name + '</strong><br>' + f(data.m1) + '</div>'; return '<div class="hoverinfo"><strong>' + data.name + '</strong><br>' + f(data.m1) + '</div>';
} },
}, },
bubblesConfig: { bubblesConfig: {
borderWidth: 1, borderWidth: 1,
@ -90,8 +90,8 @@ function worldMapChart(slice) {
highlightBorderOpacity: 1, highlightBorderOpacity: 1,
highlightFillOpacity: 0.85, highlightFillOpacity: 0.85,
exitDelay: 100, exitDelay: 100,
key: JSON.stringify key: JSON.stringify,
} },
}); });
map.updateChoropleth(d); map.updateChoropleth(d);
@ -108,7 +108,7 @@ function worldMapChart(slice) {
return { return {
render: render, render: render,
resize: render resize: render,
}; };
} }

View File

@ -11,17 +11,17 @@ const config = {
welcome: APP_DIR + '/javascripts/welcome.js', welcome: APP_DIR + '/javascripts/welcome.js',
sql: APP_DIR + '/javascripts/sql.js', sql: APP_DIR + '/javascripts/sql.js',
standalone: APP_DIR + '/javascripts/standalone.js', standalone: APP_DIR + '/javascripts/standalone.js',
common: APP_DIR + '/javascripts/common.js' common: APP_DIR + '/javascripts/common.js',
}, },
output: { output: {
path: BUILD_DIR, path: BUILD_DIR,
filename: '[name].entry.js' filename: '[name].entry.js',
}, },
resolve: { resolve: {
extensions: ['', '.js', '.jsx'], extensions: ['', '.js', '.jsx'],
alias: { alias: {
webworkify: 'webworkify-webpack' webworkify: 'webworkify-webpack',
} },
}, },
module: { module: {
loaders: [ loaders: [
@ -30,22 +30,22 @@ const config = {
exclude: APP_DIR + '/node_modules', exclude: APP_DIR + '/node_modules',
loader: 'babel', loader: 'babel',
query: { query: {
presets: ['airbnb', 'es2015', 'react'] presets: ['airbnb', 'es2015', 'react'],
} },
}, },
/* for react-map-gl overlays */ /* for react-map-gl overlays */
{ {
test: /\.react\.js$/, test: /\.react\.js$/,
include: APP_DIR + '/node_modules/react-map-gl/src/overlays', include: APP_DIR + '/node_modules/react-map-gl/src/overlays',
loader: 'babel' loader: 'babel',
}, },
/* for require('*.css') */ /* for require('*.css') */
{ {
test: /\.css$/, test: /\.css$/,
include: APP_DIR, include: APP_DIR,
loader: "style-loader!css-loader" loader: "style-loader!css-loader",
}, },
/* for css linking images */ /* for css linking images */
@ -61,32 +61,32 @@ const config = {
{ {
test: /\.less$/, test: /\.less$/,
include: APP_DIR, include: APP_DIR,
loader: "style!css!less" loader: "style!css!less",
}, },
/* for mapbox */ /* for mapbox */
{ {
test: /\.json$/, test: /\.json$/,
loader: 'json-loader' loader: 'json-loader',
}, },
{ {
test: /\.js$/, test: /\.js$/,
include: APP_DIR + '/node_modules/mapbox-gl/js/render/painter/use_program.js', include: APP_DIR + '/node_modules/mapbox-gl/js/render/painter/use_program.js',
loader: 'transform/cacheable?brfs' loader: 'transform/cacheable?brfs',
} },
], ],
postLoaders: [{ postLoaders: [{
include: /node_modules\/mapbox-gl/, include: /node_modules\/mapbox-gl/,
loader: 'transform', loader: 'transform',
query: 'brfs' query: 'brfs',
}] }],
}, },
externals: { externals: {
cheerio: 'window', cheerio: 'window',
'react/lib/ExecutionEnvironment': true, 'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true 'react/lib/ReactContext': true,
}, },
plugins: [] plugins: [],
}; };
module.exports = config; module.exports = config;