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:
@@ -18,9 +18,9 @@ export function redactConfig(config: Config): Record<string, unknown> {
|
||||
|
||||
// Helper: redact specified keys on an object if they exist and are non-nullish
|
||||
const redact = (obj: Record<string, unknown> | undefined, ...keys: string[]) => {
|
||||
if (!obj) return;
|
||||
if (!obj) {return;}
|
||||
for (const key of keys) {
|
||||
if (obj[key] !== undefined && obj[key] !== null) obj[key] = '***';
|
||||
if (obj[key] !== undefined && obj[key] !== null) {obj[key] = '***';}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -102,22 +102,22 @@ export function redactConfig(config: Config): Record<string, unknown> {
|
||||
/** Keys that are safe to update at runtime via config.patch. */
|
||||
const PATCHABLE_KEYS: Record<string, (config: Config, value: unknown) => boolean> = {
|
||||
'hooks.confirm': (config, value) => {
|
||||
if (!Array.isArray(value) || !value.every((v) => typeof v === 'string')) return false;
|
||||
if (!Array.isArray(value) || !value.every((v) => typeof v === 'string')) {return false;}
|
||||
config.hooks.confirm = value as string[];
|
||||
return true;
|
||||
},
|
||||
'hooks.log': (config, value) => {
|
||||
if (!Array.isArray(value) || !value.every((v) => typeof v === 'string')) return false;
|
||||
if (!Array.isArray(value) || !value.every((v) => typeof v === 'string')) {return false;}
|
||||
config.hooks.log = value as string[];
|
||||
return true;
|
||||
},
|
||||
'hooks.silent': (config, value) => {
|
||||
if (!Array.isArray(value) || !value.every((v) => typeof v === 'string')) return false;
|
||||
if (!Array.isArray(value) || !value.every((v) => typeof v === 'string')) {return false;}
|
||||
config.hooks.silent = value as string[];
|
||||
return true;
|
||||
},
|
||||
'server.localhost': (config, value) => {
|
||||
if (typeof value !== 'boolean') return false;
|
||||
if (typeof value !== 'boolean') {return false;}
|
||||
config.server.localhost = value;
|
||||
return true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user