Integrate eslint-plugin-obsidianmd and add lint to CI
Adds the official Obsidian ESLint plugin (eslint-plugin-obsidianmd) and
upgrades the ESLint toolchain from v8 to v9 with flat config format.
The new eslint.config.mjs applies the recommended Obsidian rules to all
plugin source, with separate config blocks for unit tests and integration
tests (each uses its own tsconfig and has Node-specific rules disabled,
e.g. prefer-window-timers and no-restricted-globals that don't apply in
a Jest/Node environment).
Fixes surfaced by the linter:
- Replaced console.log with console.debug in all verbose-logging gates
(no-console only allows warn/error/debug per Obsidian guidelines)
- Converted window timer calls from activeWindow.* to window.* to match
the prefer-window-timers rule; updated jest.setup.js to alias
global.window = global so tests continue to pass in Node
- Bumped minAppVersion from 0.12.0 to 1.4.0 to match the highest-version
API in use (Vault.createFolder requires 1.4.0)
- Fixed sentence-case violations in the settings panel UI strings
- Added void operator to openLinkText call (no-floating-promises)
- Removed unnecessary type assertion in requestHandler.ts
- Removed unused SearchResult import from requestHandler.test.ts
- Suppressed no-restricted-imports on the type-only `import type { Moment }
from "moment"` in types.ts (Moment is not re-exported by obsidian)
- Migrated .eslintignore to the flat-config ignores block
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> A
Adam Coddington committed
7366a2e7a9057ed346c58e79edd9d134947f7d9b
Parent: 61e5332