Install "eslint-plugin-obsidianmd" plugin to fix all the lint errors and adhere to Obsidian plugin guidelines#830
Conversation
Code Review by Qodo
Context used 1.
|
PR Summary by QodoInstall eslint-plugin-obsidianmd and fix all lint/build errors across codebase WalkthroughsDescription• Adds eslint-plugin-obsidianmd with a new eslint.config.mjs flat config, replacing the legacy .eslintignore file and adding lint/lint:fix npm scripts. • Fixes all lint violations across ~90 files: replaces document.* with activeDocument.*, setTimeout/setInterval with window.* equivalents, NodeJS.Timeout with number, and adds void to unhandled promise calls. • Removes the self-referential plugin.view and plugin.plugin pattern to prevent memory leaks; refactors registerEmbedRegistry into its own method with error handling. Diagramgraph TD
A["eslint.config.mjs"] --> B["eslint-plugin-obsidianmd"] --> C["main.ts"] --> D["registerEmbedRegistry()"]
B --> E["src/**/*.ts/tsx"] --> F["activeDocument API"]
E --> G["window.setTimeout/setInterval"]
E --> H["void + Promise chains"]
I["styles.css"] --> J["CSS classes"]
E --> J
subgraph Legend
direction LR
_cfg["Config"] ~~~ _mod(["Module"]) ~~~ _api(["API"]) ~~~ _css["CSS"]
end
High-Level AssessmentAdopting the official File ChangesEnhancement (2)
Bug fix (15)
Refactor (76)
Documentation (1)
Other (7)
|
…side callback of `onClick`
This PR contains :
Implements - #797