saberzero1 f8667cee6b feat: modernize sample plugin
Check whether the target version key already exists in versions.json
instead of whether the minAppVersion value exists. The old check
incorrectly skipped writing a new entry when a prior version mapped
to the same minAppVersion.

Modernize TypeScript and esbuild configuration

- Set target to ES2021 (Obsidian runs on modern Electron/Chromium)
- Replace individual strict flags with strict: true
- Update lib to ES2021 + DOM
- Remove importHelpers and allowJs
- Add skipLibCheck, forceConsistentCasingInFileNames,
noFallthroughCasesInSwitch
- Align esbuild target to es2021

Update dependencies

- Bump @types/node from ^16.11.6 to ^22.15.17 (Node 16 is EOL)
- Bump eslint-plugin-obsidianmd from 0.1.9 to 0.2.4
- Bump globals from 14.0.0 to 16.1.0
- Bump typescript-eslint from 8.35.1 to 8.32.1
- Remove tslib (no longer needed without importHelpers)

Fix code issues and update minimum app version

- Prefix unused parameters with _ (evt, view)
- Use definite assignment assertion on settings property
- Fix editorCallback parameter type (MarkdownView | MarkdownFileInfo)
- Replace document/window with activeDocument/activeWindow
- Replace let with const in SampleModal.onOpen
- Bump minAppVersion from 0.15.0 to 1.0.0
- Update eslint config for obsidianmd plugin 0.2.4 compatibility

Update documentation

- Fix entry point references (main.ts -> src/main.ts)
- Update minimum Node.js version to v18
- Replace outdated eslint instructions with npm run lint
- Update code examples for strict mode and activeWindow
- Remove yarn as alternative to npm

Update eslint configuration

Bump to eslint 10

Return to eslint 9

chore: formatting

feat: add release CI

chore: bumped obsidian eslint plugin to latest version

chore: cleanup redundant code

chore: moved obsidian to devDependencies

fix: apply ignore patterns before rulesets

docs: updated AGENTS.md to match codebase

fix: set quote_style to single

chore: formatting
2026-05-29 19:15:56 +02:00
2026-05-29 19:15:56 +02:00
2026-05-29 19:15:56 +02:00
2022-01-28 10:34:53 -05:00
2022-01-22 16:13:50 -05:00
2026-05-29 19:15:56 +02:00
2025-01-27 21:38:01 +00:00
2026-05-29 19:15:56 +02:00
2026-05-29 19:15:56 +02:00
2026-05-29 19:15:56 +02:00
2022-08-09 13:39:02 -04:00
2026-05-29 19:15:56 +02:00
2026-05-29 19:15:56 +02:00
2026-05-29 19:15:56 +02:00

Obsidian Sample Plugin

This is a sample plugin for Obsidian (https://obsidian.md).

This project uses TypeScript to provide type checking and documentation. The repo depends on the latest plugin API (obsidian.d.ts) in TypeScript Definition format, which contains TSDoc comments describing what it does.

This sample plugin demonstrates some of the basic functionality the plugin API can do.

  • Adds a ribbon icon, which shows a Notice when clicked.
  • Adds a command "Open modal (simple)" which opens a Modal.
  • Adds a plugin setting tab to the settings page.
  • Registers a global click event and outputs a Notice on click.
  • Registers a global interval which logs 'setInterval' to the console.

First time developing plugins?

Quick starting guide for new plugin devs:

  • Check if someone already developed a plugin for what you want! There might be an existing plugin similar enough that you can partner up with.
  • Make a copy of this repo as a template with the "Use this template" button (login to GitHub if you don't see it).
  • Clone your repo to a local development folder. For convenience, you can place this folder in your .obsidian/plugins/your-plugin-name folder.
  • Install NodeJS, then run npm i in the command line under your repo folder.
  • Run npm run dev to compile your plugin from src/main.ts to main.js.
  • Make changes to src/main.ts (or create new .ts files). Those changes should be automatically compiled into main.js.
  • Reload Obsidian to load the new version of your plugin.
  • Enable plugin in settings window.
  • For updates to the Obsidian API run npm update in the command line under your repo folder.

Releasing new releases

  • Update your manifest.json with your new version number, such as 1.0.1, and the minimum Obsidian version required for your latest release.
  • Update your versions.json file with "new-plugin-version": "minimum-obsidian-version" so older versions of Obsidian can download an older version of your plugin that's compatible.
  • Create new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix v. See here for an example: https://github.com/obsidianmd/obsidian-sample-plugin/releases
  • Upload the files manifest.json, main.js, styles.css as binary attachments. Note: The manifest.json file must be in two places, first the root path of your repository and also in the release.
  • Publish the release.

You can simplify the version bump process by running npm version patch, npm version minor or npm version major after updating minAppVersion manually in manifest.json. The command will bump version in manifest.json and package.json, and add the entry for the new version to versions.json

Adding your plugin to the community plugin list

How to use

  • Clone this repo.
  • Make sure your NodeJS is at least v18 (node --version).
  • npm i to install dependencies.
  • npm run dev to start compilation in watch mode.

Manually installing the plugin

  • Copy over main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/your-plugin-id/.

Improve code quality with eslint

  • ESLint is a tool that analyzes your code to quickly find problems. You can run ESLint against your plugin to find common bugs and ways to improve your code.
  • This project already has eslint preconfigured, you can invoke a check by runningnpm run lint
  • Together with a custom eslint plugin for Obsidan specific code guidelines.
  • A GitHub action is preconfigured to automatically lint every commit on all branches.

Funding URL

You can include funding URLs where people who use your plugin can financially support it.

The simple way is to set the fundingUrl field to your link in your manifest.json file:

{
	"fundingUrl": "https://buymeacoffee.com"
}

If you have multiple URLs, you can also do:

{
	"fundingUrl": {
		"Buy Me a Coffee": "https://buymeacoffee.com",
		"GitHub Sponsor": "https://github.com/sponsors",
		"Patreon": "https://www.patreon.com/"
	}
}

API Documentation

See https://docs.obsidian.md

S
Description
No description provided
Readme 0BSD
48 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 70.9%
JavaScript 26.6%
CSS 2.5%