mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-22 00:13:45 -05:00
Enable restrict-template-expressions linting rule (#7181)
* [AI] Promote typescript/restrict-template-expressions to error and fix violations Convert the oxlint rule from "warn" to "error" and fix all 42 violations by wrapping non-string template expressions with String(). This ensures type safety in template literals across the codebase. https://claude.ai/code/session_01Uk8SwFbD6HuUuo3SSMwU9z * Add release notes for PR #7181 --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
85e3166495
commit
541df52441
@@ -76,7 +76,7 @@ export function patchFetchForSqlJS(baseURL: string) {
|
||||
},
|
||||
});
|
||||
}
|
||||
return Promise.reject(new Error(`fetch not mocked for ${url}`));
|
||||
return Promise.reject(new Error(`fetch not mocked for ${String(url)}`));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@ handlers['api/schedule-update'] = withMutation(async function ({
|
||||
break;
|
||||
default:
|
||||
throw APIError(
|
||||
`Invalid amount operator: ${value}. Expected: is, isapprox, or isbetween`,
|
||||
`Invalid amount operator: ${String(value)}. Expected: is, isapprox, or isbetween`,
|
||||
);
|
||||
}
|
||||
sched._conditions[amountIndex].op = convertedOp;
|
||||
|
||||
@@ -715,7 +715,11 @@ const compileOp = saveStack('op', (state, fieldRef, opData) => {
|
||||
// Dedupe the ids
|
||||
const ids = [...new Set(right)];
|
||||
|
||||
return `${left} IN (` + ids.map(id => `'${id}'`).join(',') + ')';
|
||||
return (
|
||||
`${String(left)} IN (` +
|
||||
ids.map(id => `'${String(id)}'`).join(',') +
|
||||
')'
|
||||
);
|
||||
}
|
||||
case '$like': {
|
||||
const [left, right] = valArray(state, [lhs, rhs], ['string', 'string']);
|
||||
|
||||
@@ -611,7 +611,7 @@ export class CategoryTemplateContext {
|
||||
monthUtils.addMonths(date, numPeriods * 12);
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unrecognized periodic period: ${period}`);
|
||||
throw new Error(`Unrecognized periodic period: ${String(period)}`);
|
||||
}
|
||||
|
||||
//shift the starting date until its in our month or in the future
|
||||
|
||||
@@ -89,7 +89,7 @@ const exportModel = {
|
||||
|
||||
if (!isWidgetType(widget.type)) {
|
||||
throw new ValidationError(
|
||||
`Invalid widget.${idx}.type value ${widget.type}.`,
|
||||
`Invalid widget.${idx}.type value ${String(widget.type)}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export const mappingsFromString = (str: string): Mappings => {
|
||||
);
|
||||
} catch (e) {
|
||||
const message = e instanceof Error ? e.message : e;
|
||||
throw new Error(`Failed to parse mapping: ${message}`);
|
||||
throw new Error(`Failed to parse mapping: ${String(message)}`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ export function getDownloadError({
|
||||
default:
|
||||
const info =
|
||||
meta && typeof meta === 'object' && 'fileId' in meta && meta.fileId
|
||||
? `, fileId: ${meta.fileId}`
|
||||
? `, fileId: ${String(meta.fileId)}`
|
||||
: '';
|
||||
return t(
|
||||
'Something went wrong trying to download that file, sorry! Visit https://actualbudget.org/contact/ for support. reason: {{reason}}{{info}}',
|
||||
|
||||
Reference in New Issue
Block a user