From 2e2696a10862b3b0a20c19ae175b921a34ef49a9 Mon Sep 17 00:00:00 2001 From: WiseGuru <42100212+WiseGuru@users.noreply.github.com> Date: Sun, 24 May 2026 13:09:18 -0700 Subject: [PATCH] completed phase 8 --- eslint.config.mts | 56 +++++++++++++++++++++++++++++++++++++++++++++++ src/ui/modal.ts | 4 ++-- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/eslint.config.mts b/eslint.config.mts index 3062c4a..cefa5bc 100644 --- a/eslint.config.mts +++ b/eslint.config.mts @@ -3,6 +3,54 @@ import obsidianmd from "eslint-plugin-obsidianmd"; import globals from "globals"; import { globalIgnores } from "eslint/config"; +// Mirror the plugin's DEFAULT_BRANDS / DEFAULT_ACRONYMS (the rule replaces the +// defaults when options are passed, so we have to provide the full lists) plus +// the extras this project needs: provider names, "Web Speech", "ReWrite", "LLM". +const DEFAULT_BRANDS = [ + "iOS", "iPadOS", "macOS", "Windows", "Android", "Linux", + "Obsidian", "Obsidian Sync", "Obsidian Publish", + "Google Drive", "Dropbox", "OneDrive", "iCloud Drive", + "YouTube", "Slack", "Discord", "Telegram", "WhatsApp", "Twitter", "X", + "Readwise", "Zotero", + "Excalidraw", "Mermaid", + "Markdown", "LaTeX", "JavaScript", "TypeScript", "Node.js", + "npm", "pnpm", "Yarn", "Git", "GitHub", + "GitLab", "Notion", "Evernote", "Roam Research", "Logseq", "Anki", "Reddit", + "VS Code", "Visual Studio Code", "IntelliJ IDEA", "WebStorm", "PyCharm", +]; + +const DEFAULT_ACRONYMS = [ + "API", "HTTP", "HTTPS", "URL", "DNS", "TCP", "IP", "SSH", "TLS", "SSL", "FTP", "SFTP", "SMTP", + "JSON", "XML", "HTML", "CSS", "PDF", "CSV", "YAML", "SQL", "PNG", "JPG", "JPEG", "GIF", "SVG", + "2FA", "MFA", "OAuth", "JWT", "LDAP", "SAML", + "SDK", "IDE", "CLI", "GUI", "CRUD", "REST", "SOAP", + "CPU", "GPU", "RAM", "SSD", "USB", + "UI", "OK", + "RSS", "S3", "WebDAV", + "ID", + "UUID", "GUID", "SHA", "MD5", "ASCII", "UTF-8", "UTF-16", "DOM", "CDN", "FAQ", "AI", "ML", +]; + +const REWRITE_BRANDS = [ + "ReWrite", + "Web Speech", + "OpenAI", "Whisper", + "Anthropic", "Claude", + "Google Gemini", "Gemini", + "Groq", "Mistral", + "Ollama", "LM Studio", + "AssemblyAI", "Deepgram", "Rev.ai", +]; + +const REWRITE_ACRONYMS = [ + "LLM", "STT", "TTS", +]; + +const sentenceCaseOptions = { + brands: [...DEFAULT_BRANDS, ...REWRITE_BRANDS], + acronyms: [...DEFAULT_ACRONYMS, ...REWRITE_ACRONYMS], +}; + export default tseslint.config( { languageOptions: { @@ -22,6 +70,14 @@ export default tseslint.config( }, }, ...obsidianmd.configs.recommended, + { + plugins: { obsidianmd }, + rules: { + 'obsidianmd/ui/sentence-case': ['error', sentenceCaseOptions], + 'obsidianmd/ui/sentence-case-json': ['error', sentenceCaseOptions], + 'obsidianmd/ui/sentence-case-locale-module': ['error', sentenceCaseOptions], + }, + }, globalIgnores([ "node_modules", "dist", diff --git a/src/ui/modal.ts b/src/ui/modal.ts index e63c48b..7ab7f9c 100644 --- a/src/ui/modal.ts +++ b/src/ui/modal.ts @@ -128,13 +128,13 @@ export class ReWriteModal extends Modal { private renderRecordTab(parent: HTMLElement, isWebSpeech: boolean, language: string): void { if (isWebSpeech && !isWebSpeechAvailable()) { parent.createEl('p', { - text: 'Web Speech is not available here. Use the Paste tab or pick a different transcription provider in settings.', + text: 'Web Speech is not available here. Use the paste tab or pick a different transcription provider in settings.', }); return; } if (!isWebSpeech && !isMediaRecorderAvailable()) { parent.createEl('p', { - text: 'Audio recording is not supported in this environment. Use the Paste tab instead.', + text: 'Audio recording is not supported in this environment. Use the paste tab instead.', }); return; }