Skip to content

Commit b299b71

Browse files
jellymartinpitt
authored andcommitted
Declare all variables on a separate line
This is generally a recommended style and found by biome.
1 parent a0c78fc commit b299b71

24 files changed

+100
-34
lines changed

pkg/apps/application-list.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ export const ApplicationList = ({ metainfo_db, appProgress, appProgressTitle, ac
143143
}
144144
}
145145

146-
let refresh_progress, refresh_button, tbody;
146+
let refresh_progress;
147+
let refresh_button;
148+
let tbody;
147149
if (progress) {
148150
refresh_progress = <ProgressBar id="refresh-progress" size="sm" data={progress} />;
149151
refresh_button = <CancelButton data={progress} />;

pkg/lib/credentials.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ export class Keys extends EventTarget {
127127

128128
#parse_key(line: string, items: Record<string, Key>): Key | undefined {
129129
const parts = line.trim().split(" ");
130-
let id, type, comment;
130+
let id;
131+
let type;
132+
let comment;
131133

132134
/* SSHv1 keys */
133135
if (!isNaN(parseInt(parts[0], 10))) {

pkg/lib/journal.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ journal.journalctl = function journalctl(/* ... */) {
140140
let interval = null;
141141

142142
function fire_streamers() {
143-
let ents, i;
143+
let ents;
144+
let i;
144145
if (streamers.length && entries.length > 0) {
145146
ents = entries;
146147
entries = [];
@@ -347,7 +348,8 @@ journal.renderer = function renderer(output_funcs) {
347348
// line has been output so far, top_state and bottom_state point
348349
// to the same object.
349350

350-
let top_state, bottom_state;
351+
let top_state;
352+
let bottom_state;
351353

352354
top_state = bottom_state = { };
353355

pkg/lib/machine-info.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ function decode_proc_str(s) {
130130
}
131131

132132
export function devicetree_info() {
133-
let model, serial;
133+
let model;
134+
let serial;
134135

135136
return Promise.all([
136137
// these succeed with content === null if files are absent

pkg/lib/packagekit.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,9 @@ export function install_missing_packages(data, progress_cb) {
493493
if (!data || data.missing_ids.length === 0)
494494
return Promise.resolve();
495495

496-
let last_progress, last_info, last_name;
496+
let last_progress;
497+
let last_info;
498+
let last_name;
497499

498500
function report_progess() {
499501
progress_cb({

pkg/lib/service.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ export function proxy(name, kind) {
136136

137137
cockpit.event_target(self);
138138

139-
let unit, details;
139+
let unit;
140+
let details;
140141
let wait_promise_resolve;
141142
const wait_promise = new Promise(resolve => { wait_promise_resolve = resolve });
142143

pkg/metrics/metrics.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,8 @@ class MetricsHistory extends React.Component {
18571857
let nodata_alert = null;
18581858
const lastHourIndex = this.state.hours.length - 1;
18591859
if (!this.state.loading && this.state.hours.length > 0 && this.oldest_timestamp < this.state.hours[lastHourIndex]) {
1860-
let t1, t2;
1860+
let t1;
1861+
let t2;
18611862
if (this.state.hours[lastHourIndex] - this.oldest_timestamp < 24 * MSEC_PER_H) {
18621863
t1 = timeformat.time(this.oldest_timestamp);
18631864
t2 = timeformat.time(this.state.hours[lastHourIndex]);

pkg/networkmanager/firewall.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ function serviceRow(props) {
121121
});
122122
}
123123

124-
let description, includes;
124+
let description;
125+
let includes;
125126
if (props.service.description)
126127
description = <p>{props.service.description}</p>;
127128

pkg/networkmanager/network-interface.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ export const NetworkInterfacePage = ({
165165
}
166166

167167
function renderDesc() {
168-
let desc, cs;
168+
let desc;
169+
let cs;
169170
if (dev) {
170171
if (dev.DeviceType == 'ethernet' || dev.IdVendor || dev.IdModel) {
171172
desc = cockpit.format("$IdVendor $IdModel $Driver", dev);

pkg/networkmanager/wireguard.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ export function WireGuardDialog({ settings, connection, dev }) {
140140
// Validate Addresses before submit
141141
// Also validate listenPort as PF TextInput[type=number] accepts normal text as well on firefox
142142
// See - https://github.com/patternfly/patternfly-react/issues/9391
143-
let addr, peersArr;
143+
let addr;
144+
let peersArr;
144145
const listen_port = Number(listenPort);
145146
try {
146147
addr = stringToAddresses(addresses);

pkg/packagekit/history.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export class History extends React.Component {
5656
*/
5757
mergeHistory() {
5858
const history = [];
59-
let prevTime, prevPackages;
59+
let prevTime;
60+
let prevPackages;
6061

6162
for (let i = 0; i < this.props.packagekit.length; ++i) {
6263
const packages = Object.keys(this.props.packagekit[i]).filter(i => i != "_time");

pkg/packagekit/updates.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,9 @@ class OsUpdates extends React.Component {
13541354
}
13551355

13561356
renderContent() {
1357-
let applySecurity, applyKpatches, applyAll;
1357+
let applySecurity;
1358+
let applyKpatches;
1359+
let applyAll;
13581360

13591361
/* On unregistered RHEL systems we need some heuristics: If the "main" OS repos (which provide coreutils) require
13601362
* a subscription, then point this out and don't show available updates, even if there are some auxiliary

pkg/shell/failures.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ export const Disconnected = ({ problem }) => {
117117

118118
export const MachineTroubleshoot = ({ machine, onClick }) => {
119119
const connecting = (machine.state == "connecting");
120-
let title, message;
120+
let title;
121+
let message;
121122
if (machine.restarting) {
122123
title = _("The machine is rebooting");
123124
message = "";

pkg/shell/router.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export function Router(callbacks) {
131131
}
132132

133133
function register(child) {
134-
let host, page;
134+
let host;
135+
let page;
135136
const name = child.name || "";
136137
if (name.indexOf("cockpit1:") === 0) {
137138
const parts = name.substring(9).split("/");
@@ -187,7 +188,8 @@ export function Router(callbacks) {
187188
if (typeof data !== "string")
188189
return;
189190

190-
let source, control;
191+
let source;
192+
let control;
191193

192194
/*
193195
* On Internet Explorer we see Access Denied when non Cockpit

pkg/shell/util.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ function component_checksum(machine: Machine, path: string): string | undefined
220220
}
221221

222222
export function compute_frame_url(machine: Machine, path: string): string {
223-
let base, checksum;
223+
let base;
224+
let checksum;
224225
if (machine.manifests && machine.manifests[".checksum"])
225226
checksum = "$" + machine.manifests[".checksum"];
226227
else

pkg/static/login.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ function debug(...args) {
6969

7070
const _ = gettext;
7171

72-
let login_path, application, org_login_path, org_application;
72+
let login_path;
73+
let application;
74+
let org_login_path;
75+
let org_application;
7376
const qs_re = /[?&]?([^=]+)=([^&]*)/g;
7477
let oauth_redirect_to = null;
7578

pkg/storaged/block/resize.jsx

+21-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export function check_unused_space(path) {
4444
const lvol = lvm2 && client.lvols[lvm2.LogicalVolume];
4545
const part = client.blocks_part[path];
4646

47-
let size, min_change;
47+
let size;
48+
let min_change;
4849

4950
if (lvol) {
5051
size = lvol.Size;
@@ -235,7 +236,9 @@ function lvol_or_part_and_fsys_resize(client, lvol_or_part, size, offline, passp
235236
}
236237

237238
export function get_resize_info(client, block, to_fit) {
238-
let info, shrink_excuse, grow_excuse;
239+
let info;
240+
let shrink_excuse;
241+
let grow_excuse;
239242

240243
if (block) {
241244
if (block.IdUsage == 'crypto' && client.blocks_crypto[block.path]) {
@@ -337,8 +340,17 @@ export function free_space_after_part(client, part) {
337340
}
338341

339342
export function grow_dialog(client, lvol_or_part, info, to_fit) {
340-
let title, block, name, orig_size, max_size, allow_infinite, round_size;
341-
let has_subvols, subvols, pvs_as_spaces, initial_pvs;
343+
let title;
344+
let block;
345+
let name;
346+
let orig_size;
347+
let max_size;
348+
let allow_infinite;
349+
let round_size;
350+
let has_subvols;
351+
let subvols;
352+
let pvs_as_spaces;
353+
let initial_pvs;
342354

343355
function compute_max_size(spaces) {
344356
const layout = lvol_or_part.Layout;
@@ -543,7 +555,11 @@ export function grow_dialog(client, lvol_or_part, info, to_fit) {
543555
}
544556

545557
export function shrink_dialog(client, lvol_or_part, info, to_fit) {
546-
let title, block, name, orig_size, round_size;
558+
let title;
559+
let block;
560+
let name;
561+
let orig_size;
562+
let round_size;
547563

548564
if (lvol_or_part.iface == "org.freedesktop.UDisks2.LogicalVolume") {
549565
const vgroup = client.vgroups[lvol_or_part.VolumeGroup];

pkg/storaged/client.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,17 @@ function is_toplevel_drive(block) {
433433
}
434434

435435
function update_indices() {
436-
let path, block, mdraid, vgroup, pvol, lvol, pool, blockdev, fsys, part, i;
436+
let path;
437+
let block;
438+
let mdraid;
439+
let vgroup;
440+
let pvol;
441+
let lvol;
442+
let pool;
443+
let blockdev;
444+
let fsys;
445+
let part;
446+
let i;
437447

438448
client.broken_multipath_present = false;
439449
client.drives_multipath_blocks = { };

pkg/storaged/crypto/encryption.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ const EncryptionCard = ({ card, block }) => {
133133
[block]);
134134
useEvent(luks_info, "changed");
135135

136-
let old_options, passphrase_path;
136+
let old_options;
137+
let passphrase_path;
137138
const old_config = block.Configuration.find(c => c[0] == "crypttab");
138139
if (old_config) {
139140
old_options = (decode_filename(old_config[1].options.v)

pkg/storaged/dialog.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,8 @@ class SizeSliderElement extends React.Component {
10381038
onChange({ text: value, unit });
10391039
};
10401040

1041-
let slider_val, text_val;
1041+
let slider_val;
1042+
let text_val;
10421043
if (val.text && val.unit) {
10431044
slider_val = Number(val.text) * val.unit;
10441045
text_val = val.text;

pkg/storaged/partitions/partition-table.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ function make_partition_pages(parent, block) {
6666
}
6767

6868
function process_partitions(parent, partitions, enable_dos_extended) {
69-
let i, p;
69+
let i;
70+
let p;
7071
for (i = 0; i < partitions.length; i++) {
7172
p = partitions[i];
7273
if (p.type == 'free')

pkg/storaged/utils.js

+16-5
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ export function extract_option(split, opt) {
7373
}
7474

7575
export function edit_crypto_config(block, modify) {
76-
let old_config, new_config;
76+
let old_config;
77+
let new_config;
7778

7879
function commit() {
7980
new_config[1]["track-parents"] = { t: 'b', v: true };
@@ -306,7 +307,9 @@ export function drive_name(drive) {
306307
}
307308

308309
export function get_block_link_parts(client, path) {
309-
let is_part, is_crypt, is_lvol;
310+
let is_part;
311+
let is_crypt;
312+
let is_lvol;
310313

311314
while (true) {
312315
if (client.blocks_part[path] && client.blocks_ptable[client.blocks_part[path].Table]) {
@@ -326,7 +329,8 @@ export function get_block_link_parts(client, path) {
326329
if (!block)
327330
return;
328331

329-
let location, link;
332+
let location;
333+
let link;
330334
if (client.mdraids[block.MDRaid]) {
331335
location = ["mdraid", client.mdraids[block.MDRaid].UUID];
332336
link = cockpit.format(_("MDRAID device $0"), mdraid_name(client.mdraids[block.MDRaid]));
@@ -384,7 +388,11 @@ export function get_partitions(client, block) {
384388
let n;
385389
let last_end = container_start;
386390
const total_end = container_start + container_size;
387-
let block, start, size, is_container, is_contained;
391+
let block;
392+
let start;
393+
let size;
394+
let is_container;
395+
let is_contained;
388396

389397
const result = [];
390398

@@ -517,7 +525,10 @@ export function get_available_spaces(client) {
517525

518526
function add_free_spaces(block) {
519527
const parts = get_partitions(client, block);
520-
let i, p, link_parts, text;
528+
let i;
529+
let p;
530+
let link_parts;
531+
let text;
521532
for (i in parts) {
522533
p = parts[i];
523534
if (p.type == 'free') {

pkg/systemd/overview-cards/insights.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ export class InsightsStatus extends React.Component {
176176
else
177177
url = "https://console.redhat.com/insights";
178178

179-
let icon, text;
179+
let icon;
180+
let text;
180181
if (this.state.hits) {
181182
const n = this.state.hits.n;
182183
if (n == 0) {

pkg/systemd/overview-cards/tuned-dialog.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ const TunedDialog = ({
200200
const withInfo = (active, recommended, profiles) => {
201201
const model = [];
202202
profiles.forEach(p => {
203-
let name, desc;
203+
let name;
204+
let desc;
204205
if (typeof p === "string") {
205206
name = p;
206207
desc = "";

0 commit comments

Comments
 (0)