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.

Compatibility

  • Don't provide default hotkeys for commands. Learn more.
  • 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.
  • 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.
  • Don't use the FileSystemAdapter class.
  • Don't use process.platform, use Obsidian's Platform instead. Link to API.
  • Don't use fetch or axios.get, use Obsidian's requestUrl instead. Link to API.

Coding style

  • Don't use var. Use let or const instead. Learn more.
  • Don't use the global app instance. Use this.app provided to your plugin instance instead. Learn more.
  • 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.
  • Don't use global variables. Try to keep variables either in the scope of classes or functions. Learn more.
  • 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.
  • 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.
  • Don't use the Adapter API whenever possible. Use Vault API instead. Learn more.
  • 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.

Performance

  • Do optimize your plugin's load time. Detailed guide.
  • Don't iterate all files to find a file or folder by its path. Learn more.
  • 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.
  • 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.

User interface

  • Don't use setting headings unless you have more than one section. Learn more.
  • Don't include the word "setting" or "option" in setting headings. Learn more.
  • Do use sentence case in all text in UI elements to be consistent with rest of Obsidian UI. Learn more.
  • Don't use <h1> or <h2> for setting header. Use Obsidian API instead. Learn more.
  • Don't do console.log unless they are absolutely necessarily. Remove testing console logs that are not needed for production.
Obsidian October O_O 2024 plugin self-critique checklist
Interactive graph