wiseguru_ReWrite-Voice-Notes/eslint.config.mts
WiseGuru c74f74abc9 Remediate Obsidian community-submission lint
Errors: bump minAppVersion 1.4.0 to 1.4.4 (FileManager.processFrontMatter is since 1.4.4) and update versions.json; remove the disallowed eslint-disable in passphrase-modal and pass the random-string example via a variable to satisfy sentence-case.

Popout/compat warnings: setTimeout/clearTimeout to window.*; document to activeDocument, capturing the document ref for paired add/removeEventListener (recorder wake-lock, quick-record popover, settings, floater); globalThis to window for require/process in getNodeApi; replace the rewrite-hidden display-none important rule with el.toggle/hide/show; register activeDocument/activeWindow as eslint globals for no-undef.

Attestations: add .github/workflows/release.yml (build, actions/attest-build-provenance, softprops/action-gh-release on tag push).

Docs: CLAUDE.md minAppVersion rationale plus CI release/attestation and display() deferral notes; README Vault access disclosure and License corrected to 0BSD; DEVCONFLICTS refreshed.

Deferred recommendations: display() to getSettingDefinitions (1.13.0+ rewrite) and vault enumeration (necessary, disclosed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 22:56:54 -07:00

96 lines
2.9 KiB
TypeScript

import tseslint from 'typescript-eslint';
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, "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",
"OpenAI", "Whisper",
"Anthropic", "Claude",
"Google Gemini", "Gemini",
"Groq", "Mistral", "Voxtral",
"Ollama", "LM Studio",
"AssemblyAI", "Deepgram", "Rev.ai",
"whisper.cpp", "whisper-server", "faster-whisper-server",
"Argon2id", "Argon2", "zxcvbn", "diceware", "EFF",
];
const REWRITE_ACRONYMS = [
"LLM", "STT", "TTS",
"OS", "PBKDF2", "AES", "GCM", "KDF",
];
const sentenceCaseOptions = {
brands: [...DEFAULT_BRANDS, ...REWRITE_BRANDS],
acronyms: [...DEFAULT_ACRONYMS, ...REWRITE_ACRONYMS],
};
export default tseslint.config(
{
languageOptions: {
globals: {
...globals.browser,
// Obsidian ambient globals (popout-window aware; declared in obsidian.d.ts,
// which TS sees but eslint's no-undef does not).
activeDocument: 'readonly',
activeWindow: 'readonly',
},
parserOptions: {
projectService: {
allowDefaultProject: [
'eslint.config.js',
'manifest.json'
]
},
tsconfigRootDir: import.meta.dirname,
extraFileExtensions: ['.json']
},
},
},
...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",
"esbuild.config.mjs",
"eslint.config.js",
"version-bump.mjs",
"versions.json",
"main.js",
]),
);