mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-21 15:36:50 -05:00
lint: actual/typography disallow using curly quotes (#6454)
* Update typography rule to disallow curly quotes with auto-fix - Reverse typography rule to detect and flag curly quotes instead of straight quotes - Add auto-fixer that converts curly quotes to straight quotes - Fix auto-fixer to properly escape quotes when they match string delimiters * Fix quotation marks in error messages and formatting strings across multiple files - Standardize quotation marks from curly to straight in error messages and string formatting for consistency. - Update various components and utility files to ensure proper string handling and improve readability. * Standardize quotation marks across multiple files - Replace curly quotes with straight quotes in various documentation and code files for consistency and improved readability. - Update error messages, comments, and documentation to ensure uniformity in string formatting. * Standardize month formatting across multiple components - Update month formatting strings from "MMMM 'yy" to "MMMM ''yy" in various components and utility files for consistency. - Ensure uniformity in how months are displayed throughout the application. * Refactor typography rule to enhance curly quote handling - Simplify the error reporting mechanism for curly quotes by creating a shared fix function. - Update test cases to include various curly quote scenarios for improved coverage. - Ensure consistent handling of curly quotes in formatting functions across multiple files. * Refactor typography handling and update tests for curly quotes - Replace curly quotes with their Unicode equivalents in typography rule and related test cases for consistency. - Remove unnecessary eslint-disable comments to improve code clarity. - Ensure proper handling of quotes in arithmetic and utility tests to align with updated typography standards. * Update VRT screenshots Auto-generated by VRT workflow PR: #6454 * Fix: Correct typo in budget cell notification message Co-authored-by: matiss <matiss@mja.lv> * Update VRT screenshots Auto-generated by VRT workflow PR: #6454 * Temporarily disable i18n string extraction workflow --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
committed by
GitHub
parent
ddb95359c3
commit
d9a1260c91
@@ -22,7 +22,7 @@ function parseRawArgs(argv) {
|
||||
|
||||
if (!key?.startsWith('--')) {
|
||||
throw new Error(
|
||||
`Unexpected argument “${key ?? ''}”. Use --key value pairs.`,
|
||||
`Unexpected argument "${key ?? ''}". Use --key value pairs.`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ function parseRawArgs(argv) {
|
||||
}
|
||||
|
||||
if (values.length === 0) {
|
||||
throw new Error(`Missing value for argument “${key}”.`);
|
||||
throw new Error(`Missing value for argument "${key}".`);
|
||||
}
|
||||
|
||||
const keyName = key.slice(2);
|
||||
@@ -55,14 +55,14 @@ function getSingleValue(args, key) {
|
||||
return undefined;
|
||||
}
|
||||
if (values.length !== 1) {
|
||||
throw new Error(`Argument “--${key}” must have exactly one value.`);
|
||||
throw new Error(`Argument "--${key}" must have exactly one value.`);
|
||||
}
|
||||
return values[0];
|
||||
}
|
||||
|
||||
function parseMapping(values, key, description) {
|
||||
if (!values || values.length === 0) {
|
||||
throw new Error(`Missing required argument “--${key}” (${description}).`);
|
||||
throw new Error(`Missing required argument "--${key}" (${description}).`);
|
||||
}
|
||||
|
||||
if (values.length === 1) {
|
||||
@@ -81,7 +81,7 @@ function parseMapping(values, key, description) {
|
||||
Object.entries(parsed).map(([name, pathValue]) => {
|
||||
if (typeof pathValue !== 'string') {
|
||||
throw new Error(
|
||||
`Value for “${name}” in “--${key}” must be a string path.`,
|
||||
`Value for "${name}" in "--${key}" must be a string path.`,
|
||||
);
|
||||
}
|
||||
return [name, pathValue];
|
||||
@@ -91,7 +91,7 @@ function parseMapping(values, key, description) {
|
||||
const message =
|
||||
error instanceof Error ? error.message : 'Unknown parsing error';
|
||||
throw new Error(
|
||||
`Failed to parse “--${key}” value as JSON object: ${message}`,
|
||||
`Failed to parse "--${key}" value as JSON object: ${message}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ function parseMapping(values, key, description) {
|
||||
|
||||
if (!rawName || rawPathParts.length === 0) {
|
||||
throw new Error(
|
||||
`Argument “--${key}” must be provided as name=path pairs or a JSON object.`,
|
||||
`Argument "--${key}" must be provided as name=path pairs or a JSON object.`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -112,12 +112,12 @@ function parseMapping(values, key, description) {
|
||||
const pathValue = rawPathParts.join('=').trim();
|
||||
|
||||
if (!name) {
|
||||
throw new Error(`Argument “--${key}” contains an empty bundle name.`);
|
||||
throw new Error(`Argument "--${key}" contains an empty bundle name.`);
|
||||
}
|
||||
|
||||
if (!pathValue) {
|
||||
throw new Error(
|
||||
`Argument “--${key}” for bundle “${name}” must include a non-empty path.`,
|
||||
`Argument "--${key}" for bundle "${name}" must include a non-empty path.`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ function parseMapping(values, key, description) {
|
||||
}
|
||||
|
||||
if (entries.size === 0) {
|
||||
throw new Error(`Argument “--${key}” must define at least one bundle.`);
|
||||
throw new Error(`Argument "--${key}" must define at least one bundle.`);
|
||||
}
|
||||
|
||||
return entries;
|
||||
@@ -152,7 +152,7 @@ function parseArgs(argv) {
|
||||
|
||||
if (!headPath) {
|
||||
throw new Error(
|
||||
`Bundle “${name}” is missing a corresponding “--head” entry.`,
|
||||
`Bundle "${name}" is missing a corresponding "--head" entry.`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ function parseArgs(argv) {
|
||||
for (const name of headMap.keys()) {
|
||||
if (!baseMap.has(name)) {
|
||||
throw new Error(
|
||||
`Bundle “${name}” is missing a corresponding “--base” entry.`,
|
||||
`Bundle "${name}" is missing a corresponding "--base" entry.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -194,8 +194,8 @@ async function loadStats(filePath) {
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: 'Unknown error while parsing stats file';
|
||||
console.error(`[bundle-stats] Failed to parse “${filePath}”: ${message}`);
|
||||
throw new Error(`Failed to load stats file “${filePath}”: ${message}`);
|
||||
console.error(`[bundle-stats] Failed to parse "${filePath}": ${message}`);
|
||||
throw new Error(`Failed to load stats file "${filePath}": ${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,12 +26,12 @@ function parseArgs(argv) {
|
||||
|
||||
if (!key?.startsWith('--')) {
|
||||
throw new Error(
|
||||
`Unexpected argument “${key ?? ''}”. Use --key value pairs.`,
|
||||
`Unexpected argument "${key ?? ''}". Use --key value pairs.`,
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof value === 'undefined') {
|
||||
throw new Error(`Missing value for argument “${key}”.`);
|
||||
throw new Error(`Missing value for argument "${key}".`);
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
@@ -42,16 +42,16 @@ function parseArgs(argv) {
|
||||
args.identifier = value;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown argument “${key}”.`);
|
||||
throw new Error(`Unknown argument "${key}".`);
|
||||
}
|
||||
}
|
||||
|
||||
if (!args.commentFile) {
|
||||
throw new Error('Missing required argument “--comment-file“.');
|
||||
throw new Error('Missing required argument "--comment-file".');
|
||||
}
|
||||
|
||||
if (!args.identifier) {
|
||||
throw new Error('Missing required argument “--identifier“.');
|
||||
throw new Error('Missing required argument "--identifier".');
|
||||
}
|
||||
|
||||
return args;
|
||||
@@ -70,7 +70,7 @@ function getRepoInfo() {
|
||||
|
||||
const [owner, repo] = repository.split('/');
|
||||
if (!owner || !repo) {
|
||||
throw new Error(`Invalid GITHUB_REPOSITORY value “${repository}”.`);
|
||||
throw new Error(`Invalid GITHUB_REPOSITORY value "${repository}".`);
|
||||
}
|
||||
|
||||
return { owner, repo };
|
||||
|
||||
Reference in New Issue
Block a user