fix: enable sentence-case eslint rules and fix 36 UI text violations

This commit is contained in:
sean2077 2026-01-21 10:00:43 +08:00
parent 73fa940062
commit 27ea8c8e54
No known key found for this signature in database
GPG key ID: 99D5252D915C51D9
3 changed files with 55 additions and 57 deletions

View file

@ -29,7 +29,8 @@ export default [
"@typescript-eslint/no-misused-promises": "error",
// 项目特定覆盖
// "obsidianmd/ui/sentence-case": ["warn", { enforceCamelCaseLower: false }],
"obsidianmd/ui/sentence-case": ["error", { enforceCamelCaseLower: false }],
"obsidianmd/ui/sentence-case-locale-module": ["error", { enforceCamelCaseLower: false, allowAutoFix: true }],
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },

37
package-lock.json generated
View file

@ -102,6 +102,7 @@
"integrity": "sha512-eohl3hKTiVyD1ilYdw9T0OiB4hnjef89e3dMYKz+mVKDzj+5IteTseASUsOB+EU9Tf6VNTCjDePcP6wkDGmLKQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@keyv/serialize": "^1.1.1"
}
@ -168,6 +169,7 @@
}
],
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18"
},
@ -211,6 +213,7 @@
}
],
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18"
}
@ -873,6 +876,7 @@
"integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
@ -965,7 +969,6 @@
"integrity": "sha512-KWiFQpSAqEIyrTXko3hFNLeQvSK8zXlJQzhhxsyVn58WFRYXST99b3Nqnu+ttOtjds2Pl2grUHGpe2NzhPynuQ==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": ">=18"
}
@ -1020,8 +1023,7 @@
"resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz",
"integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/@microsoft/eslint-plugin-sdl": {
"version": "1.1.0",
@ -1371,6 +1373,7 @@
"integrity": "sha512-jCzKdm/QK0Kg4V4IK/oMlRZlY+QOcdjv89U2NgKHZk1CYTj82/RVSx1mV/0gqCVMJ/DA+Zf/S4NBWNF8GQ+eqQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.48.0",
"@typescript-eslint/types": "8.48.0",
@ -1526,7 +1529,6 @@
"integrity": "sha512-2X4BX8hUeB5JcA1TQJ7GjcgulXQ+5UkNb0DL8gHsHUHdFoiCTJoYLTpib3LtSDPZsRET5ygN4qqIWrHyYIKERA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.47.0",
"@typescript-eslint/types": "^8.47.0",
@ -1549,7 +1551,6 @@
"integrity": "sha512-a0TTJk4HXMkfpFkL9/WaGTNuv7JWfFTQFJd6zS9dVAjKsojmv9HT55xzbEpnZoY+VUb+YXLMp+ihMLz/UlZfDg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/types": "8.47.0",
"@typescript-eslint/visitor-keys": "8.47.0"
@ -1568,7 +1569,6 @@
"integrity": "sha512-ybUAvjy4ZCL11uryalkKxuT3w3sXJAuWhOoGS3T/Wu+iUu1tGJmk5ytSY8gbdACNARmcYEB0COksD2j6hfGK2g==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
@ -1765,7 +1765,6 @@
"integrity": "sha512-nHAE6bMKsizhA2uuYZbEbmp5z2UpffNrPEqiKIeN7VsV6UY/roxanWfoRrf6x/k9+Obf+GQdkm0nPU+vnMXo9A==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
@ -1780,7 +1779,6 @@
"integrity": "sha512-k6ti9UepJf5NpzCjH31hQNLHQWupTRPhZ+KFF8WtTuTpy7uHPfeg2NM7cP27aCGajoEplxJDFVCEm9TGPYyiVg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/project-service": "8.47.0",
"@typescript-eslint/tsconfig-utils": "8.47.0",
@ -1810,7 +1808,6 @@
"integrity": "sha512-g7XrNf25iL4TJOiPqatNuaChyqt49a/onq5YsJ9+hXeugK+41LVg7AxikMfM02PC6jbNtZLCJj6AUcQXJS/jGQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.7.0",
"@typescript-eslint/scope-manager": "8.47.0",
@ -1835,7 +1832,6 @@
"integrity": "sha512-SIV3/6eftCy1bNzCQoPmbWsRLujS8t5iDIZ4spZOBHqrM+yfX2ogg8Tt3PDTAVKw3sSCiUgg30uOAvK2r9zGjQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/types": "8.47.0",
"eslint-visitor-keys": "^4.2.1"
@ -1854,7 +1850,6 @@
"integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
@ -1868,6 +1863,7 @@
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@ -2471,8 +2467,7 @@
"resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz",
"integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/cross-spawn": {
"version": "7.0.6",
@ -2988,6 +2983,7 @@
"integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.1",
@ -4855,6 +4851,7 @@
"resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz",
"integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">= 10.16.0"
}
@ -5694,6 +5691,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@ -5743,6 +5741,7 @@
"integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"cssesc": "^3.0.0",
"util-deprecate": "^1.0.2"
@ -6542,8 +6541,7 @@
"resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.3.tgz",
"integrity": "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/stylelint": {
"version": "16.26.1",
@ -6561,6 +6559,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"@csstools/css-parser-algorithms": "^3.0.5",
"@csstools/css-syntax-patches-for-csstree": "^1.0.19",
@ -6923,6 +6922,7 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
@ -7135,6 +7135,7 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@ -7149,7 +7150,6 @@
"integrity": "sha512-Lwe8i2XQ3WoMjua/r1PHrCTpkubPYJCAfOurtn+mtTzqB6jNd+14n9UN1bJ4s3F49x9ixAm0FLflB/JzQ57M8Q==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/eslint-plugin": "8.47.0",
"@typescript-eslint/parser": "8.47.0",
@ -7174,7 +7174,6 @@
"integrity": "sha512-fe0rz9WJQ5t2iaLfdbDc9T80GJy0AeO453q8C3YCilnGozvOyCG5t+EZtg7j7D88+c3FipfP/x+wzGnh1xp8ZA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.47.0",
@ -7231,7 +7230,6 @@
"integrity": "sha512-QC9RiCmZ2HmIdCEvhd1aJELBlD93ErziOXXlHEZyuBo3tBiAZieya0HLIxp+DoDWlsQqDawyKuNEhORyku+P8A==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/types": "8.47.0",
"@typescript-eslint/typescript-estree": "8.47.0",
@ -7299,8 +7297,7 @@
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
"integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/webidl-conversions": {
"version": "3.0.1",

View file

@ -13,12 +13,12 @@ export default {
enable_status_bar_name: "Enable status bar",
enable_status_bar_desc: "Turn the status bar feature on or off.",
status_bar_title:
"🖱️Left click: Switch random wallpaper\n🖱Middle click: Open settings tab\n🖱Right click: Save current background",
"🖱️left click: switch random wallpaper\n🖱middle click: open settings tab\n🖱right click: save current background",
// ===== 外观设置 =====
appearance_settings_title: "Appearance",
appearance_settings_hint:
"💡 Global appearance settings. These act as defaults and have lower priority than per-background overrides. If changes here seem ineffective, check whether the currently active background has its own appearance overrides.",
"💡 global appearance settings. These act as defaults and have lower priority than per-background overrides. If changes here seem ineffective, check whether the currently active background has its own appearance overrides.",
blur_depth_name: "Background blur",
blur_depth_desc: "Set the background blurriness, from 0 to 30.",
reset_blur_tooltip: "Reset to default blur",
@ -37,7 +37,7 @@ export default {
"Reset only clears overrides for this background, so it inherits global settings (does not modify global settings)",
bg_size_name: "Background size",
bg_size_desc:
"Set how the background image is sized. 'Intelligent' means choosing size based on image and window dimensions.",
"Set how the background image is sized. 'intelligent' means choosing size based on image and window dimensions.",
reset_bg_size_tooltip: "Reset to default background size",
bg_size_option_cover:
"Scale the background image to completely cover the background area, maintaining aspect ratio. Commonly used for full-screen backgrounds.",
@ -68,10 +68,10 @@ export default {
reset_time_rules_button: "Restore defaults",
reset_time_rules_tooltip: "Reset the time slot rules to their default settings.",
time_rule_hint:
"💡 When time slot rules overlap, the first matching rule takes precedence. The indicator 🔥 means the current active rule.",
"💡 when time slot rules overlap, the first matching rule takes precedence. The indicator 🔥 means the current active rule.",
rule_name_label: "Rule name:",
start_time_label: "Start time (HH:MM):",
end_time_label: "End time (HH:MM):",
start_time_label: "Start time (hh:mm):",
end_time_label: "End time (hh:mm):",
interval_name: "Switch interval",
interval_desc: "How often to switch the background (in minutes).",
confirm_clear_time_rules: "Are you sure you want to clear all time slot rules?",
@ -103,10 +103,10 @@ export default {
bg_name_label: "Background name:",
image_url_label: "Image URL (remote link or vault internal path):",
color_value_label: "Color value (e.g. #ff0000):",
gradient_css_label: "CSS gradient (e.g. linear-gradient(45deg, #ff0000, #0000ff)):",
gradient_css_label: "CSS gradient (e.g. Linear-gradient(45deg, #ff0000, #0000ff)):",
select_background_option: "Select background",
background_management_hint:
"💡 Tip: You can drag background items to reorder them; The background with 🔥 indicator is the currently applied background.",
"💡 tip: you can drag background items to reorder them; the background with 🔥 indicator is the currently applied background.",
drag_handle_tooltip: "Drag to reorder",
random_wallpaper_settings_title: "Random wallpaper",
enable_random_wallpaper_name: "Enable random wallpaper",
@ -123,35 +123,35 @@ export default {
add_api_button: "Add API",
restore_default_apis_tooltip:
"Restore the default wallpaper APIs provided by the plugin (will not overwrite existing APIs)",
restore_default_apis_success: "🎉 Successfully restored default wallpaper APIs",
restore_default_apis_success: "🎉 successfully restored default wallpaper APIs",
wallpaper_api_hint:
"💡 You can add multiple API instances of the same type with different parameters to get different types of wallpapers.",
"💡 you can add multiple API instances of the same type with different parameters to get different types of wallpapers.",
add_api_bg_tooltip: "Click to add a new wallpaper from API",
wallpaper_api_url_name: "Wallpaper API URL",
wallpaper_api_url_desc:
"Supports Unsplash, Pixabay, Pexels APIs. Default uses Unsplash API (need to replace YOUR_ACCESS_KEY)",
"Supports unsplash, pixabay, pexels APIs. Default uses unsplash API (need to replace your_access_key)",
fallback_on_error_name: "Fallback on API error",
fallback_on_error_desc: "When API request fails, fallback to use local background list",
test_api_connection_name: "Test API connection",
test_api_connection_desc: "Test whether current API settings can fetch wallpapers normally",
// ===== 命令相关 =====
command_open_settings_tab_name: "DTB: Open settings in new tab",
command_toggle_name: "DTB: Toggle dynamic background",
command_toggle_enabled_notice: "✅ DTB: Dynamic background enabled",
command_toggle_disabled_notice: "❌ DTB: Dynamic background disabled",
command_next_bg_name: "DTB: Switch to next background",
command_open_settings_tab_name: "Dtb: open settings in new tab",
command_toggle_name: "Dtb: toggle dynamic background",
command_toggle_enabled_notice: "✅ dtb: dynamic background enabled",
command_toggle_disabled_notice: "❌ dtb: dynamic background disabled",
command_next_bg_name: "Dtb: switch to next background",
command_next_bg_notice: "🎨 DTB: Background switched to: {bgName}",
command_test_bg_name: "DTB: Test current time period background",
command_test_bg_name: "Dtb: test current time period background",
command_test_bg_success_notice: "🕒 DTB: Current period: {ruleName}, background: {bgName}",
command_test_bg_no_bg_notice: "⚠️ DTB: No background set for period {ruleName}",
command_test_bg_no_rule_notice: "⚠️ DTB: No matching rule for the current time",
command_test_bg_not_supported_notice: "⚠️ DTB: Current mode does not support background testing",
command_fetch_random_wallpaper_name: "DTB: Fetch random wallpaper",
command_fetch_random_wallpaper_notice_success: "🎉 DTB: Applied random wallpaper",
command_test_bg_no_rule_notice: "⚠️ dtb: no matching rule for the current time",
command_test_bg_not_supported_notice: "⚠️ dtb: current mode does not support background testing",
command_fetch_random_wallpaper_name: "Dtb: fetch random wallpaper",
command_fetch_random_wallpaper_notice_success: "🎉 dtb: applied random wallpaper",
command_fetch_random_wallpaper_notice_failed:
"❌ DTB: Failed to fetch random wallpaper, please check API settings and network connection",
command_save_current_background_name: "DTB: Save current background",
"❌ dtb: failed to fetch random wallpaper, please check API settings and network connection",
command_save_current_background_name: "Dtb: save current background",
// ===== 通用按钮文本 =====
button_cancel: "Cancel",
@ -182,12 +182,12 @@ export default {
dark_blue_gray_gradient_bg: "Dark blue gray gradient",
// ===== Notice 消息 =====
notice_all_fields_required: "⚠️ DTB: Please provide all required fields",
notice_name_and_value_required: "⚠️ DTB: Please provide both name and value",
notice_valid_folder_path_required: "⚠️ DTB: Please provide a valid folder path",
notice_folder_not_found: "❌ DTB: Folder not found",
notice_all_fields_required: "⚠️ dtb: please provide all required fields",
notice_name_and_value_required: "⚠️ dtb: please provide both name and value",
notice_valid_folder_path_required: "⚠️ dtb: please provide a valid folder path",
notice_folder_not_found: "❌ dtb: folder not found",
notice_folder_added_successfully: '🎉 DTB: Images from folder "{folderPath}" added successfully',
notice_error_adding_folder_images: "❌ DTB: Error adding images from folder",
notice_error_adding_folder_images: "❌ dtb: error adding images from folder",
notice_api_failed_enable_disable: "❌ DTB: Failed to {action} {apiName}",
notice_api_success_enable_disable: "🎉 DTB: Successfully {action} {apiName}",
notice_api_error_enable_disable: "❌ DTB: Error {action} {apiName}",
@ -196,13 +196,13 @@ export default {
notice_api_success_applied: "🎉 DTB: Successfully applied wallpaper from {apiName}",
notice_api_failed_fetch: "❌ DTB: Failed to fetch wallpaper from {apiName}",
notice_api_error_fetch: "❌ DTB: Error fetching wallpaper from {apiName}: {error}",
notice_save_background_no_need_save_local: "🎉 DTB: Current background is a local image, no need to save",
notice_save_background_no_need_save_local: "🎉 dtb: current background is a local image, no need to save",
notice_save_background_valid_folder_path_required:
"⚠️ DTB: Please provide a valid folder path to save the wallpaper",
notice_save_background_only_image_supported: "⚠️ DTB: Only image backgrounds are supported for saving",
"⚠️ dtb: please provide a valid folder path to save the wallpaper",
notice_save_background_only_image_supported: "⚠️ dtb: only image backgrounds are supported for saving",
notice_save_background_success: "🎉 DTB: Current background saved to {folderPath}",
notice_save_background_failed:
"❌ DTB: Failed to save current background, please check folder path and permissions",
"❌ dtb: failed to save current background, please check folder path and permissions",
notice_save_background_overwrite_existing_file: "⚠️ DTB: File {filePath} already exists, do you want to overwrite?",
notice_save_background_converted:
'🎉 DTB: Current background has been converted to value from "{oldPath}" to "{newPath}", the original link has been saved to the remoteUrl property as a backup, if the local file does not exist later, it will fall back to using the remote link',
@ -222,7 +222,7 @@ export default {
api_modal_header_value: "Header value",
api_modal_api_parameters: "API parameters",
api_modal_api_documentation: "📖 API documentation",
api_modal_token_url: "🔑 Token URL",
api_modal_token_url: "🔑 token URL",
api_modal_extra_params: "Extra parameters (JSON)",
api_modal_extra_params_desc: "Additional parameters not covered above, in JSON format",
api_modal_extra_params_placeholder: '{\n "customParam": "value",\n "anotherParam": 123\n}',
@ -232,7 +232,7 @@ export default {
api_modal_title_add: "Add wallpaper API",
api_modal_basic_config: "Basic configuration",
api_modal_api_name: "API name",
api_modal_api_name_placeholder: "e.g., Unsplash Nature",
api_modal_api_name_placeholder: "E.g., unsplash nature",
api_modal_description_optional: "Description (optional)",
api_modal_api_type: "API type",
api_modal_custom_settings: "Custom settings",
@ -249,6 +249,6 @@ export default {
status_disabled: "Disabled",
// ===== 动作词 =====
action_enable: "enable",
action_disable: "disable",
action_enable: "Enable",
action_disable: "Disable",
};