mirror of
https://github.com/mprojectscode/obsidian-safe-js-plugin.git
synced 2026-07-22 06:55:38 +00:00
1.5 KiB
1.5 KiB
Contributing to Safe JS
Thanks for wanting to contribute to Safe JS. For security-sensitive changes, also read SECURITY.md.
Development setup
This project uses Bun, Vite, TypeScript, and ESLint. First install the dependencies via bun install. Then bun run dev builds the development plugin bundle into exampleVault/.obsidian/plugins/safe-js and watches for changes.
Common commands
bun run buildbuilds the production plugin bundle.bun run typecheckruns TypeScript checks.bun run lintruns ESLint.bun run testruns the Bun test suite.bun run checkruns formatting checks, type checks, linting, and tests.bun run check:fixruns the above while trying to fix formatting and fixable lint errors.
Run bun run check before opening a pull request when possible.
Project conventions
- Follow the Obsidian plugin guidelines and the privacy expectations in README.md.
- Register cleanup for DOM, app, and interval listeners with Obsidian's
register*helpers. - Prefer
asyncandawaitover promise chains. - Prefer
interfaceovertypeandfunctionoverconstlambdas where it fits the existing code.
Pull requests
Good pull requests are small enough to review carefully and include:
- A short explanation of the change.
- Any new permissions, settings, commands, or user-facing behavior.
- Tests for changed behavior.
- Notes about security or privacy impact, especially for RPC, storage, vault, network, or execution changes.