## [Add this checklist to your Obsidian](obsidian://new?name=Obsidian%20October%202024%20plugin%20self-critique%20checklist&content=%23%23%20Releasing%20%26%20naming%0A%0A-%20%5B%20%5D%20Remove%20placeholder%20names%20such%20as%20%60MyPlugin%60%20and%20%60SampleSettingTab%60.%0A-%20%5B%20%5D%20Don%27t%20include%20the%20word%20%22Obsidian%22%20in%20your%20name%20unless%20it%20absolutely%20makes%20sense.%20Most%20of%20the%20time%20it%27s%20redundant.%0A-%20%5B%20%5D%20Don%27t%20include%20your%20plugin%20name%20in%20command%20names.%20Obsidian%20adds%20this%20for%20you.%0A-%20%5B%20%5D%20Don%27t%20prefix%20commands%20with%20your%20plugin%20ID.%20Obsidian%20adds%20this%20for%20you.%0A-%20%5B%20%5D%20Don%27t%20include%20%60main.js%60%20in%20your%20repo.%20Only%20include%20it%20in%20your%20releases.%0A-%20%5B%20%5D%20If%20you%20haven%27t%2C%20consider%20add%20a%20%60fundingUrl%60%20so%20that%20users%20of%20your%20plugin%20can%20show%20some%20support.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FReference%2FManifest%23fundingUrl%29.%0A%0A%23%23%20Compatibility%0A%0A-%20%5B%20%5D%20Don%27t%20provide%20default%20hotkeys%20for%20commands.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Avoid%2Bsetting%2Ba%2Bdefault%2Bhotkey%2Bfor%2Bcommands%29.%0A-%20%5B%20%5D%20Don%27t%20override%20core%20styling.%20If%20needed%2C%20add%20your%20own%20class%20and%20make%20the%20styling%20only%20apply%20to%20your%20class.%0A-%20%5B%20%5D%20Do%20scan%20your%20code%20for%20deprecated%20methods%20%28they%20usually%20show%20up%20as%20strikeout%20text%20in%20IDEs%29.%0A-%20%5B%20%5D%20Don%27t%20assign%20styles%20via%20JavaScript%20or%20in%20HTML.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23No%2Bhardcoded%2Bstyling%29.%0A-%20%5B%20%5D%20Don%27t%20access%20the%20hardcoded%20%60.obsidian%60%20folder%20if%20you%20need%20to%20access%20the%20configuration%20directory.%20The%20location%20could%20be%20customized%2C%20so%20please%20use%20%60Vault.configDir%60%20instead.%0A%0A%23%23%20Mobile%20support%0A%0APlease%20only%20complete%20this%20section%20if%20you%20have%20%60isDesktopOnly%60%20set%20to%20false%20in%20your%20manifest.%0A%0A-%20%5B%20%5D%20Don%27t%20use%20node.js%20modules%20such%20as%20%60fs%60%2C%20%60path%60%2C%20and%20%60electron%60.%0A-%20%5B%20%5D%20Don%27t%20use%20regex%20lookbehinds%20if%20you%20want%20to%20support%20iOS%20versions%20lower%20than%2016.4%20%28ignore%20this%20if%20you%20don%27t%20use%20regex%20in%20your%20plugin%29.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FGetting%2Bstarted%2FMobile%2Bdevelopment%23Lookbehind%2Bin%2Bregular%2Bexpressions%29.%0A-%20%5B%20%5D%20Don%27t%20use%20the%20%60FileSystemAdapter%60%20class.%0A-%20%5B%20%5D%20Don%27t%20use%20%60process.platform%60%2C%20use%20Obsidian%27s%20%60Platform%60%20instead.%20%5BLink%20to%20API%5D%28https%3A%2F%2Fdocs.obsidian.md%2FReference%2FTypeScript%2BAPI%2FPlatform%29.%0A-%20%5B%20%5D%20Don%27t%20use%20%60fetch%60%20or%20%60axios.get%60%2C%20use%20Obsidian%27s%20%60requestUrl%60%20instead.%20%5BLink%20to%20API%5D%28https%3A%2F%2Fdocs.obsidian.md%2FReference%2FTypeScript%2BAPI%2FrequestUrl%29.%0A%0A%23%23%20Coding%20style%0A%0A-%20%5B%20%5D%20Don%27t%20use%20%60var%60.%20Use%20%60let%60%20or%20%60const%60%20instead.%20%5BLearn%20more%5D%28https%3A%2F%2Fjavascript.plainenglish.io%2F4-reasons-why-var-is-considered-obsolete-in-modern-javascript-a30296b5f08f%29.%0A-%20%5B%20%5D%20Don%27t%20use%20the%20global%20%60app%60%20instance.%20Use%20%60this.app%60%20provided%20to%20your%20plugin%20instance%20instead.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Avoid%2520using%2520global%2520app%2520instance%29.%0A-%20%5B%20%5D%20Do%20break%20up%20your%20%60main.ts%60%20into%20smaller%20files%20or%20even%20folders%20if%20it%20gets%20big%20to%20make%20code%20easier%20to%20find.%0A-%20%5B%20%5D%20Do%20use%20%60async%60%20and%20%60await%60%20when%20you%20can%20for%20readability%2C%20instead%20of%20using%20%60Promise%60.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Prefer%2Basync%252Fawait%2Bover%2BPromise%29.%0A-%20%5B%20%5D%20Don%27t%20use%20global%20variables.%20Try%20to%20keep%20variables%20either%20in%20the%20scope%20of%20classes%20or%20functions.%20%5BLearn%20more%5D%28http%3A%2F%2Fwiki.c2.com%2F%3FGlobalVariablesAreBad%29.%0A-%20%5B%20%5D%20Do%20test%20with%20%60instanceof%60%20before%20casting%20into%20other%20types%20such%20as%20%60TFile%60%2C%20%60TFolder%60%2C%20or%20%60FileSystemAdapter%60%2C%20%0A-%20%5B%20%5D%20Don%27t%20use%20use%20%60as%20any%60%20and%20use%20proper%20typing%20instead.%0A%0A%0A%23%23%20API%20usage%0A%0A-%20%5B%20%5D%20Don%27t%20use%20%60Vault.modify%60.%20If%20you%20want%20to%20edit%20the%20active%20file%2C%20prefer%20using%20the%20%60Editor%60%20interface.%20If%20you%20want%20to%20edit%20it%20in%20the%20background%2C%20use%20%60Vault.process%60.%0A-%20%5B%20%5D%20Don%27t%20manually%20read%20and%20write%20frontmatter.%20Instead%2C%20use%20%60FileManager.processFrontMatter%60.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Prefer%2B%2560FileManager.processFrontMatter%2560%2Bto%2Bmodify%2Bfrontmatter%2Bof%2Ba%2Bnote%29.%0A-%20%5B%20%5D%20Don%27t%20use%20%60vault.delete%60%20to%20delete%20files.%20Use%20%60trashFile%60%20instead%20to%20make%20sure%20the%20file%20is%20deleted%20according%20to%20the%20users%20preferences.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FReference%2FTypeScript%2BAPI%2FFileManager%2FtrashFile%29.%0A-%20%5B%20%5D%20Don%27t%20use%20the%20%60Adapter%60%20API%20whenever%20possible.%20Use%20%60Vault%60%20API%20instead.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Prefer%2Bthe%2BVault%2BAPI%2Bover%2Bthe%2BAdapter%2BAPI%29.%0A-%20%5B%20%5D%20Don%27t%20manage%20reading%20and%20write%20plugin%20data%20yourself.%20Use%20%60Plugin.loadData%28%29%60%20and%20%60Plugin.saveData%28%29%60%20instead.%0A-%20%5B%20%5D%20Do%20use%20%60normalizePath%28%29%60%20if%20you%20take%20user%20defined%20paths.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FReference%2FTypeScript%2BAPI%2FnormalizePath%29.%0A%0A%0A%23%23%20Performance%0A%0A-%20%5B%20%5D%20Do%20optimize%20your%20plugin%27s%20load%20time.%20%5BDetailed%20guide%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FGuides%2FOptimizing%2Bplugin%2Bload%2Btime%29.%0A-%20%5B%20%5D%20Don%27t%20iterate%20all%20files%20to%20find%20a%20file%20or%20folder%20by%20its%20path.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Avoid%2Biterating%2Ball%2Bfiles%2Bto%2Bfind%2Ba%2Bfile%2Bby%2Bits%2Bpath%29.%0A-%20%5B%20%5D%20If%20you%20want%20your%20plugins%20to%20be%20compatible%20with%20Obsidian%201.7.2%2B%20%28currently%20in%20early%20access%29%2C%20update%20your%20plugin%20to%20work%20with%20%60DeferredViews%60.%20%5BDetailed%20guide%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FGuides%2FUnderstanding%2Bdeferred%2Bviews%29.%0A-%20%5B%20%5D%20If%20you%27re%20using%20%60moment%60%2C%20make%20sure%20you%27re%20doing%20%60import%20%7B%20moment%7D%20from%20%27obsidian%27%60%20so%20that%20you%20don%27t%20import%20another%20copy.%0A-%20%5B%20%5D%20Do%20minimize%20your%20%60main.js%60%20for%20releasing.%0A-%20%5B%20%5D%20Do%20your%20initial%20UI%20setup%20on%20%60workspace.onLayoutReady%28%29%60%20instead%20of%20in%20the%20constructor%20or%20%60onload%28%29%60%20function.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FGuides%2FOptimizing%2Bplugin%2Bload%2Btime%23If%2Byou%2Bhave%2Bcode%2Bthat%2Byou%2Bwant%2Bto%2Brun%2Bat%2Bstartup%252C%2Bwhere%2Bshould%2Bit%2Bgo%253F%29.%0A%0A%23%23%20User%20interface%0A%0A-%20%5B%20%5D%20Don%27t%20use%20setting%20headings%20unless%20you%20have%20more%20than%20one%20section.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Only%2Buse%2Bheadings%2Bunder%2Bsettings%2Bif%2Byou%2Bhave%2Bmore%2Bthan%2Bone%2Bsection%29.%0A-%20%5B%20%5D%20Don%27t%20include%20the%20word%20%22setting%22%20or%20%22option%22%20in%20setting%20headings.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Avoid%2B%2522settings%2522%2Bin%2Bsettings%2Bheadings%29.%0A-%20%5B%20%5D%20Do%20use%20sentence%20case%20in%20all%20text%20in%20UI%20elements%20to%20be%20consistent%20with%20rest%20of%20Obsidian%20UI.%20%5BLearn%20more%5D%28https%3A%2F%2Fen.wiktionary.org%2Fwiki%2Fsentence_case%29.%0A-%20%5B%20%5D%20Don%27t%20use%20%60%3Ch1%3E%60%20or%20%60%3Ch2%3E%60%20for%20setting%20header.%20Use%20Obsidian%20API%20instead.%20%5BLearn%20more%5D%28https%3A%2F%2Fdocs.obsidian.md%2FPlugins%2FReleasing%2FPlugin%2Bguidelines%23Use%2B%2560setHeading%2560%2Binstead%2Bof%2Ba%2B%2560%253Ch1%253E%2560%252C%2B%2560%253Ch2%253E%2560%29.%0A-%20%5B%20%5D%20Don%27t%20do%20%60console.log%60%20unless%20they%20are%20absolutely%20necessarily.%20Remove%20testing%20console%20logs%20that%20are%20not%20needed%20for%20production.) ## Releasing & naming - [ ] Remove placeholder names such as `MyPlugin` and `SampleSettingTab`. - [ ] Don't include the word "Obsidian" in your name unless it absolutely makes sense. Most of the time it's redundant. - [ ] Don't include your plugin name in command names. Obsidian adds this for you. - [ ] Don't prefix commands with your plugin ID. Obsidian adds this for you. - [ ] Don't include `main.js` in your repo. Only include it in your releases. - [ ] If you haven't, consider add a `fundingUrl` so that users of your plugin can show some support. [Learn more](https://docs.obsidian.md/Reference/Manifest#fundingUrl). ## Compatibility - [ ] Don't provide default hotkeys for commands. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid+setting+a+default+hotkey+for+commands). - [ ] Don't override core styling. If needed, add your own class and make the styling only apply to your class. - [ ] Do scan your code for deprecated methods (they usually show up as strikeout text in IDEs). - [ ] Don't assign styles via JavaScript or in HTML. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#No+hardcoded+styling). - [ ] Don't access the hardcoded `.obsidian` folder if you need to access the configuration directory. The location could be customized, so please use `Vault.configDir` instead. ## Mobile support Please only complete this section if you have `isDesktopOnly` set to false in your manifest. - [ ] Don't use node.js modules such as `fs`, `path`, and `electron`. - [ ] Don't use regex lookbehinds if you want to support iOS versions lower than 16.4 (ignore this if you don't use regex in your plugin). [Learn more](https://docs.obsidian.md/Plugins/Getting+started/Mobile+development#Lookbehind+in+regular+expressions). - [ ] Don't use the `FileSystemAdapter` class. - [ ] Don't use `process.platform`, use Obsidian's `Platform` instead. [Link to API](https://docs.obsidian.md/Reference/TypeScript+API/Platform). - [ ] Don't use `fetch` or `axios.get`, use Obsidian's `requestUrl` instead. [Link to API](https://docs.obsidian.md/Reference/TypeScript+API/requestUrl). ## Coding style - [ ] Don't use `var`. Use `let` or `const` instead. [Learn more](https://javascript.plainenglish.io/4-reasons-why-var-is-considered-obsolete-in-modern-javascript-a30296b5f08f). - [ ] Don't use the global `app` instance. Use `this.app` provided to your plugin instance instead. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid%20using%20global%20app%20instance). - [ ] Do break up your `main.ts` into smaller files or even folders if it gets big to make code easier to find. - [ ] Do use `async` and `await` when you can for readability, instead of using `Promise`. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Prefer+async%2Fawait+over+Promise). - [ ] Don't use global variables. Try to keep variables either in the scope of classes or functions. [Learn more](http://wiki.c2.com/?GlobalVariablesAreBad). - [ ] Do test with `instanceof` before casting into other types such as `TFile`, `TFolder`, or `FileSystemAdapter`, - [ ] Don't use use `as any` and use proper typing instead. ## API usage - [ ] Don't use `Vault.modify`. If you want to edit the active file, prefer using the `Editor` interface. If you want to edit it in the background, use `Vault.process`. - [ ] Don't manually read and write frontmatter. Instead, use `FileManager.processFrontMatter`. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Prefer+%60FileManager.processFrontMatter%60+to+modify+frontmatter+of+a+note). - [ ] Don't use `vault.delete` to delete files. Use `trashFile` instead to make sure the file is deleted according to the users preferences. [Learn more](https://docs.obsidian.md/Reference/TypeScript+API/FileManager/trashFile). - [ ] Don't use the `Adapter` API whenever possible. Use `Vault` API instead. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Prefer+the+Vault+API+over+the+Adapter+API). - [ ] Don't manage reading and write plugin data yourself. Use `Plugin.loadData()` and `Plugin.saveData()` instead. - [ ] Do use `normalizePath()` if you take user defined paths. [Learn more](https://docs.obsidian.md/Reference/TypeScript+API/normalizePath). ## Performance - [ ] Do optimize your plugin's load time. [Detailed guide](https://docs.obsidian.md/Plugins/Guides/Optimizing+plugin+load+time). - [ ] Don't iterate all files to find a file or folder by its path. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid+iterating+all+files+to+find+a+file+by+its+path). - [ ] If you want your plugins to be compatible with Obsidian 1.7.2+ (currently in early access), update your plugin to work with `DeferredViews`. [Detailed guide](https://docs.obsidian.md/Plugins/Guides/Understanding+deferred+views). - [ ] If you're using `moment`, make sure you're doing `import { moment} from 'obsidian'` so that you don't import another copy. - [ ] Do minimize your `main.js` for releasing. - [ ] Do your initial UI setup on `workspace.onLayoutReady()` instead of in the constructor or `onload()` function. [Learn more](https://docs.obsidian.md/Plugins/Guides/Optimizing+plugin+load+time#If+you+have+code+that+you+want+to+run+at+startup%2C+where+should+it+go%3F). ## User interface - [ ] Don't use setting headings unless you have more than one section. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Only+use+headings+under+settings+if+you+have+more+than+one+section). - [ ] Don't include the word "setting" or "option" in setting headings. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Avoid+%22settings%22+in+settings+headings). - [ ] Do use sentence case in all text in UI elements to be consistent with rest of Obsidian UI. [Learn more](https://en.wiktionary.org/wiki/sentence_case). - [ ] Don't use `<h1>` or `<h2>` for setting header. Use Obsidian API instead. [Learn more](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines#Use+%60setHeading%60+instead+of+a+%60%3Ch1%3E%60%2C+%60%3Ch2%3E%60). - [ ] Don't do `console.log` unless they are absolutely necessarily. Remove testing console logs that are not needed for production.