Skip to content

Commit

Permalink
eslint: Enable "semi" rule
Browse files Browse the repository at this point in the history
Fix semicolons in all files.

Closes  cockpit-project#9736
  • Loading branch information
suomiy authored and martinpitt committed Jul 26, 2018
1 parent bc6b99a commit 53ea9be
Show file tree
Hide file tree
Showing 92 changed files with 276 additions and 277 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"prefer-promise-reject-errors": ["error", { "allowEmptyReject": true }],
"react/jsx-indent": ["error", 4],
"semi": ["error", "always", { "omitLastInOneLineBlock": true }],

"camelcase": "off",
"comma-dangle": "off",
Expand All @@ -36,7 +37,6 @@
"react/jsx-curly-spacing": "off",
"react/jsx-indent-props": "off",
"react/prop-types": "off",
"semi": "off",
"space-before-function-paren": "off",
"standard/no-callback-literal": "off",

Expand Down
2 changes: 1 addition & 1 deletion pkg/apps/application-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ApplicationList extends React.Component {
refresh_button = <CancelButton data={this.state.progress} />;
} else {
refresh_progress = null;
refresh_button = <button className="btn btn-default fa fa-refresh" onClick={left_click(refresh)} />
refresh_button = <button className="btn btn-default fa fa-refresh" onClick={left_click(refresh)} />;
}

table_classes = "table app-list";
Expand Down
12 changes: 6 additions & 6 deletions pkg/apps/utils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export function icon_url(path_or_url) {
payload: "fsread1",
binary: "raw",
path: path_or_url,
}
};

if (path_or_url.endsWith(".svg")) {
queryobj.external = {"content-type": "image/svg+xml"}
queryobj.external = {"content-type": "image/svg+xml"};
}

var query = window.btoa(JSON.stringify(queryobj));
Expand Down Expand Up @@ -75,7 +75,7 @@ export const ProgressBar = ({ title, data }) => {
</div>
);
}
}
};

export const CancelButton = ({ data }) => {
return (
Expand All @@ -85,7 +85,7 @@ export const CancelButton = ({ data }) => {
{_("Cancel")}
</button>
);
}
};

export const show_error = ex => {
if (ex.code == "cancelled")
Expand All @@ -107,7 +107,7 @@ export const show_error = ex => {
cancel_caption: _("Close"),
actions: [ ]
});
}
};

export const launch = (comp) => {
var i;
Expand All @@ -117,4 +117,4 @@ export const launch = (comp) => {
return;
}
}
}
};
8 changes: 4 additions & 4 deletions pkg/dashboard/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var resource_monitors = [
};
},
options: { yaxis: { tickColor: "#e1e6ed",
tickFormatter: function(v) { return v + "%"; }} },
tickFormatter: function(v) { return v + "%" }} },
ymax_min: 100
},
{ selector: "#dashboard-plot-1",
Expand Down Expand Up @@ -350,7 +350,7 @@ PageDashboard.prototype = {
});

$.each(seen, function(addr) {
series[addr].forEach(function (s) { s.remove(); });
series[addr].forEach(function (s) { s.remove() });
delete series[addr];
});

Expand Down Expand Up @@ -455,7 +455,7 @@ PageDashboard.prototype = {
}

function plot_refresh() {
self.plots.forEach(function (p) { p.refresh(); });
self.plots.forEach(function (p) { p.refresh() });
}

function plot_add(addr, info) {
Expand Down Expand Up @@ -525,7 +525,7 @@ PageDashboard.prototype = {
}

$(window).on('resize.dashboard', function () {
self.plots.forEach(function (p) { p.resize(); });
self.plots.forEach(function (p) { p.resize() });
});

renderer();
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/atomic.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function updateVulnerableInfo() {

/* Atomic sometimes returns containers for which it doesn't
* have scan results. Remove those. */
var ids = Object.keys(infos).filter(function (id) { return infos[id].json_file; });
var ids = Object.keys(infos).filter(function (id) { return infos[id].json_file });

if (ids.length > 0) {
promises = ids.map(function (id) {
Expand Down
16 changes: 8 additions & 8 deletions pkg/docker/containers-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ var ContainerHeader = React.createClass({
return {
filter: 'running',
filterText: ''
}
};
},

filterChanged: function () {
Expand Down Expand Up @@ -144,7 +144,7 @@ var ContainerProblems = React.createClass({
problem_cursors.push(<a data-url={problem[i][0]} className='list-group-item' role="link" tabIndex="0" onClick={this.onItemClick}>
<span className="pficon pficon-warning-triangle-o fa-lg" />
{problem[i][1]}
</a>)
</a>);
}

return (
Expand Down Expand Up @@ -255,7 +255,7 @@ var ContainerList = React.createClass({
$(this.props.client).off('container.containers', this.containersChanged);
$(this.props.client).off('container.container-details', this.containersChanged);
this.service.removeEventListener("Crash", this.newProblemOccurred);
this.problems_client.close()
this.problems_client.close();
},

render: function () {
Expand All @@ -276,9 +276,9 @@ var ContainerList = React.createClass({

var state;
if (this.props.client.waiting[container.Id]) {
state = { element: <div className="spinner" />, tight: true }
state = { element: <div className="spinner" />, tight: true };
} else {
state = util.render_container_status(container.State)
state = util.render_container_status(container.State);
}

var image = container.Image;
Expand All @@ -287,7 +287,7 @@ var ContainerList = React.createClass({

if (shortContID in this.state.problems) {
hasProblem = true;
state = <div><span className="pficon pficon-warning-triangle-o" />{state}</div>
state = <div><span className="pficon pficon-warning-triangle-o" />{state}</div>;
}

var columns = [
Expand Down Expand Up @@ -600,11 +600,11 @@ var ImageList = React.createClass({

var element;
if (this.props.client.waiting[image.Id]) {
element = <div className="spinner" />
element = <div className="spinner" />;
} else {
element = <button className="btn btn-default btn-control-ct fa fa-play"
onClick={ this.showRunImageDialog.bind(this) }
data-image={image.Id} />
data-image={image.Id} />;
}

var columns = [
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
var id = this.container_id;
this.client.start(this.container_id).
fail(function(ex) {
util.handle_scope_start_container(self.client, id, ex.message, function() { self.maybe_reconnect_terminal(); }, null);
util.handle_scope_start_container(self.client, id, ex.message, function() { self.maybe_reconnect_terminal() }, null);
}).
done(function() {
self.maybe_reconnect_terminal();
Expand Down Expand Up @@ -285,7 +285,7 @@
_("Deleting a container will erase all data in it."),
_("Delete")).
done(function () {
util.docker_container_delete(self.client, self.container_id, function() { location.go("/"); }, function () { });
util.docker_container_delete(self.client, self.container_id, function() { location.go("/") }, function () { });
});
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
var mem_series;

var cpu_options = plot.plot_simple_template();
$.extend(cpu_options.yaxis, { tickFormatter: function(v) { return v.toFixed(0); },
$.extend(cpu_options.yaxis, { tickFormatter: function(v) { return v.toFixed(0) },
max: 100
});
$.extend(cpu_options.grid, { hoverable: true,
Expand Down
6 changes: 3 additions & 3 deletions pkg/docker/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@
$(function() {
dialog.setup();
$("#containers-search-image-dialog").
on('show.bs.modal', function () { dialog.enter(); }).
on('shown.bs.modal', function () { dialog.show(); }).
on('hidden.bs.modal', function () { dialog.leave(); });
on('show.bs.modal', function () { dialog.enter() }).
on('shown.bs.modal', function () { dialog.show() }).
on('hidden.bs.modal', function () { dialog.leave() });
});

function search(client) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/storage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@

function add_drives() {
var dfd = cockpit.defer();
var devs = drives.map(function (d) { return d.path; });
var devs = drives.map(function (d) { return d.path });
if (docker_will_be_stopped)
client.close();

Expand Down Expand Up @@ -452,7 +452,7 @@
cockpit.location.go('/');
});

$('#storage-reset').on('click', function () { reset_storage(client); });
$('#storage-reset').on('click', function () { reset_storage(client) });

function add_callback(drives, model) {
add_storage(client, drives, model);
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
};

util.multi_line = function multi_line(strings) {
return strings.map(function (str) { return Mustache.render("{{.}}", str); }).join('<br/>');
return strings.map(function (str) { return Mustache.render("{{.}}", str) }).join('<br/>');
};

util.format_cpu_shares = function format_cpu_shares(priority) {
Expand Down Expand Up @@ -244,7 +244,7 @@
var self = this;
$(self).hide().
siblings("div.spinner").show();
util.docker_container_delete(client, id, function() { }, function () { $(self).show().siblings("div.spinner").hide(); });
util.docker_container_delete(client, id, function() { }, function () { $(self).show().siblings("div.spinner").hide() });
return false;
});
var btn_play = $('<button class="btn btn-default btn-control-ct fa fa-play">').
Expand Down
10 changes: 5 additions & 5 deletions pkg/kdump/kdump-view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,15 @@ var KdumpPage = React.createClass({
settings["core_collector"].value =
settings["core_collector"].value
.split(" ")
.filter((e) => { return (e != "-c"); })
.filter((e) => { return (e != "-c") })
.join(" ");
} else {
// if we don't have anything on this in the original settings,
// we can get rid of the entry altogether
delete settings["core_collector"];
}
} else {
console.log("not changing compression setting")
console.log("not changing compression setting");
return;
}
} else if (key !== undefined) {
Expand Down Expand Up @@ -349,7 +349,7 @@ var KdumpPage = React.createClass({
initialTarget: self.props.kdumpStatus.target,
compressionEnabled: self.compressionStatus(settings)
});
}
};
updateDialogBody();
// also test modifying properties in subsequent render calls
var footerProps = {
Expand Down Expand Up @@ -394,7 +394,7 @@ var KdumpPage = React.createClass({
} else if (target.target == "mount") {
kdumpLocation = _("On a mounted device");
} else {
kdumpLocation = _("No configuration found")
kdumpLocation = _("No configuration found");
targetCanChange = false;
}
}
Expand Down Expand Up @@ -484,7 +484,7 @@ var KdumpPage = React.createClass({
{_("Test Configuration")}
</button>
</Tooltip>
)
);
}
return (
<div className="container-fluid">
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubernetes/scripts/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
el = angular.element("<a>")
.attr("href", href)
.attr("target", "_blank")
.on("click", function(ev) { ev.stopPropagation(); });
.on("click", function(ev) { ev.stopPropagation() });
element.append(el);
} else {
el = element;
Expand Down
26 changes: 13 additions & 13 deletions pkg/kubernetes/scripts/graphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,17 +598,17 @@
cpu: {
label: _("CPU"),
step: 1000 * 1000 * 1000 * 10,
formatter: function(v) { return (v / (100 * 1000 * 1000)) + "%"; }
formatter: function(v) { return (v / (100 * 1000 * 1000)) + "%" }
},
memory: {
label: _("Memory"),
step: 1024 * 1024 * 64,
formatter: function(v) { return KubeFormat.formatBytes(v); }
formatter: function(v) { return KubeFormat.formatBytes(v) }
},
network: {
label: _("Network"),
step: 1000 * 1000 * 10,
formatter: function(v) { return KubeFormat.formatBitsPerSec((v / 10), "Mbps"); }
formatter: function(v) { return KubeFormat.formatBitsPerSec((v / 10), "Mbps") }
}
};

Expand All @@ -617,13 +617,13 @@
.selectAll("li")
.data(Object.keys(tabs))
.enter().append("li")
.attr("data-metric", function(d) { return d; })
.attr("data-metric", function(d) { return d })
.append("a")
.text(function(d) { return tabs[d].label; });
.text(function(d) { return tabs[d].label });

function metric_tab(tab) {
outer.selectAll("ul li")
.attr("class", function(d) { return tab === d ? "active": null; });
.attr("class", function(d) { return tab === d ? "active": null });
grid.metric(tab);
}

Expand Down Expand Up @@ -667,9 +667,9 @@
var offset = 0;

var line = d3.svg.line()
.defined(function(d) { return d !== undefined; })
.x(function(d, i) { return x((grid.beg + i) - offset); })
.y(function(d, i) { return y(d); });
.defined(function(d) { return d !== undefined })
.x(function(d, i) { return x((grid.beg + i) - offset) })
.y(function(d, i) { return y(d) });

/* Initial display: 1024 px, 5 minutes of data */
var factor = 300000 / 1024;
Expand Down Expand Up @@ -773,12 +773,12 @@
var rows = grid.rows;

var series = stage.selectAll("path.line")
.data(rows, function(d, i) { return i; });
.data(rows, function(d, i) { return i });

series
.style("stroke", function(d, i) { return colors(i); })
.attr("d", function(d) { return line(d); })
.classed("highlight", function(d) { return d.uid === highlighted; });
.style("stroke", function(d, i) { return colors(i) })
.attr("d", function(d) { return line(d) })
.classed("highlight", function(d) { return d.uid === highlighted });

series.enter().append("path")
.attr("class", "line")
Expand Down
4 changes: 2 additions & 2 deletions pkg/kubernetes/scripts/kube-client-cockpit.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@
bufferedAmount: { value: 0 },
extensions: { value: "" },
protocol: { value: base64 ? "base64.channel.k8s.io" : "" },
readyState: { get: function() { return state; } },
readyState: { get: function() { return state } },
url: { value: url },
close: { value: close },
send: { value: send },
Expand Down Expand Up @@ -617,7 +617,7 @@
bufferedAmount: { value: 0 },
extensions: { value: "" },
protocol: { value: protocols[0] },
readyState: { get: function() { return state; } },
readyState: { get: function() { return state } },
url: { value: url },
close: { value: close },
send: { value: send },
Expand Down
Loading

0 comments on commit 53ea9be

Please sign in to comment.