style: auto-fix ESLint issues (curly braces and formatting)
- Add curly braces to all if/else/for/while statements - Fix indentation and trailing spaces - Auto-fixed 372 linting errors using eslint --fix - Remaining issues are warnings only (non-null assertions, explicit any types)
This commit is contained in:
@@ -75,11 +75,11 @@ function friendlyMimeType(mimeType: string): string {
|
||||
|
||||
/** Format file size in human-readable form. */
|
||||
function formatSize(bytes: string | undefined): string {
|
||||
if (!bytes) return '';
|
||||
if (!bytes) {return '';}
|
||||
const n = parseInt(bytes, 10);
|
||||
if (isNaN(n)) return '';
|
||||
if (n < 1024) return `${n} B`;
|
||||
if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
||||
if (isNaN(n)) {return '';}
|
||||
if (n < 1024) {return `${n} B`;}
|
||||
if (n < 1024 * 1024) {return `${(n / 1024).toFixed(1)} KB`;}
|
||||
return `${(n / (1024 * 1024)).toFixed(1)} MB`;
|
||||
}
|
||||
|
||||
@@ -95,9 +95,9 @@ function formatFiles(files: FileSummary[]): string {
|
||||
parts.push(` Type: ${friendlyMimeType(f.mimeType)}`);
|
||||
parts.push(` Modified: ${f.modifiedTime}`);
|
||||
const size = formatSize(f.size);
|
||||
if (size) parts.push(` Size: ${size}`);
|
||||
if (f.owners.length > 0) parts.push(` Owners: ${f.owners.join(', ')}`);
|
||||
if (f.webViewLink) parts.push(` Link: ${f.webViewLink}`);
|
||||
if (size) {parts.push(` Size: ${size}`);}
|
||||
if (f.owners.length > 0) {parts.push(` Owners: ${f.owners.join(', ')}`);}
|
||||
if (f.webViewLink) {parts.push(` Link: ${f.webViewLink}`);}
|
||||
return parts.join('\n');
|
||||
})
|
||||
.join('\n\n');
|
||||
|
||||
Reference in New Issue
Block a user