[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 }],
"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"],

View File

@ -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 () {
@ -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
@ -84,7 +84,7 @@ var color = function () {
return {
bnbColors: bnbColors,
category21: colorBnb(),
colorScalerFactory: colorScalerFactory
colorScalerFactory: colorScalerFactory,
};
};
@ -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) {
@ -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);
},
@ -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;
@ -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);
@ -424,7 +424,7 @@ var px = (function () {
timeFormatFactory: timeFormatFactory,
color: color(),
getParam: getParam,
initFavStars: initFavStars
initFavStars: initFavStars,
};
})();

View File

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

View File

@ -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() {
@ -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();
@ -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);
@ -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);
}
},
});
});
}

View File

@ -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
@ -74,7 +74,7 @@ $(document).ready(function () {
domain: "month",
subDomain: "day",
itemName: "action",
tooltip: true
tooltip: true,
});
});
modelViewTable('#dash_table', 'DashboardModelViewAsync', 'changed_on', 'desc');

View File

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

View File

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

View File

@ -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);
@ -51,7 +51,7 @@ function calHeatmap(slice) {
return {
render: render,
resize: render
resize: render,
};
}

View File

@ -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);
@ -168,7 +168,7 @@ function directedForceVis(slice) {
};
return {
render: render,
resize: render
resize: render,
};
}

View File

@ -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 = {};
@ -57,7 +57,7 @@ function filterBox(slice) {
dropdownAutoWidth: true,
data: data,
multiple: true,
formatResult: select2Formatter
formatResult: select2Formatter,
})
.on('change', fltChanged);
@ -85,7 +85,7 @@ function filterBox(slice) {
};
return {
render: refresh,
resize: refresh
resize: refresh,
};
}

View File

@ -17,7 +17,7 @@ function heatmapVis(slice) {
top: 10,
right: 10,
bottom: 35,
left: 35
left: 35,
};
d3.json(slice.jsonEndpoint(), function (error, payload) {
@ -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);
@ -228,7 +228,7 @@ function heatmapVis(slice) {
}
return {
render: refresh,
resize: refresh
resize: refresh,
};
}

View File

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

View File

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

View File

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

View File

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

View File

@ -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) {
@ -88,7 +88,7 @@ function parallelCoordVis(slice) {
mouseover: function (d) {
parcoords.highlight([d]);
},
mouseout: parcoords.unhighlight
mouseout: parcoords.unhighlight,
});
});
}
@ -101,7 +101,7 @@ function parallelCoordVis(slice) {
return {
render: refresh,
resize: refresh
resize: refresh,
};
}

View File

@ -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(
@ -34,6 +34,6 @@ module.exports = function (slice) {
}
return {
render: refresh,
resize: refresh
resize: refresh,
};
};

View File

@ -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;
@ -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;
@ -170,7 +170,7 @@ function sankeyVis(slice) {
};
return {
render: render,
resize: render
resize: render,
};
}

View File

@ -71,7 +71,7 @@ function sunburstVis(slice) {
width: visWidth / maxBreadcrumbs,
height: breadcrumbHeight *0.8, // more margin
spacing: 3,
tipTailWidth: 10
tipTailWidth: 10,
};
breadcrumbs = svg.append("svg:g")
@ -301,7 +301,7 @@ function sunburstVis(slice) {
function buildHierarchy(rows) {
var root = {
name: "root",
children: []
children: [],
};
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 = {
name: nodeName,
children: [],
level: level
level: level,
};
children.push(childNode);
}
@ -349,7 +349,7 @@ function sunburstVis(slice) {
childNode = {
name: nodeName,
m1: m1,
m2: m2
m2: m2,
};
children.push(childNode);
}
@ -379,7 +379,7 @@ function sunburstVis(slice) {
return {
render: render,
resize: render
resize: render,
};
}

View File

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

View File

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

View File

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

View File

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

View File

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