davidvkimball_obsidian-astr.../CONTRIBUTING.md
David V. Kimball ec556b8ec8 Bump to 0.12.3 with scorecard improvements.
Hygiene and scaffolding:
- Add CONTRIBUTING.md
- Add release workflow that reads version from manifest.json and
  attests build provenance, with workflow_dispatch fallback

Dependency hygiene:
- Add pnpm.overrides for vulnerable transitive dev dependencies
- Update eslint-plugin-obsidianmd to 0.3.0, typescript-eslint to
  8.50.1+, obsidian-dev-skills to 1.2.0

ESLint config:
- Scope obsidianmd recommended rules to TypeScript files only
- Configure obsidianmd/ui/sentence-case with project-specific
  acronyms (MDX, URL, ID, JSON, CSS), brand names (Obsidian, Astro,
  PowerShell, iTerm, Markdown, Alacritty, Git), and ignoreRegex for
  date-format placeholders (YYYY-MM-DD, HH:MM)
- Configure import/no-nodejs-modules with allow list for the four
  Node modules (os, child_process, fs, path) used by the terminal
  launch feature, which is guarded by Platform.isDesktop at runtime

Risks resolved:
- Remove the 6 per-line disables of import/no-nodejs-modules from
  src/commands/index.ts. The rule still runs and still flags new
  imports; only the allowed list is exempt
- Other disable annotations (no-require-imports, no-undef) on the
  same lines stay because they are not prohibited by the scorecard
  and the require() pattern is intentional for the desktop-only
  terminal feature

Code fixes:
- Replace document.* with activeDocument.* across all source files
  (23 lint warnings resolved)
- Type the AstroComposerPluginInterface frontmatterService and
  fileOps fields with minimal structural interfaces in types.ts
  (FrontmatterServiceLike, FileOperationsLike), eliminating the
  unsafe-any-access errors at every call site
- Rewrite FrontmatterService.getNestedProperty and setNestedProperty
  to use a typed Indexable record helper, eliminating implicit any
  indexing
- Narrow calculateIsDraft settings parameter to AstroComposerSettings
- Refactor FileOperations.getContentTypeByPath to use a new
  determineTypeByPath helper instead of casting a partial object to
  TFile, satisfying the obsidianmd/no-tfile-tfolder-cast rule
- Type processFrontMatter callback's frontmatter argument as
  Record<string, unknown> so it's compatible with the Indexable
  helpers without unsafe argument errors
- Wrap setTimeout's async callback with void IIFE to satisfy
  no-misused-promises
- Restrict calculateIsDraft string conversion to primitive types
  to avoid "[object Object]" stringification
- Remove unused waitForElement import
- Fix sentence-case in user-facing strings: capitalize Astro
  references where it appears as a brand, lowercase generic dropdown
  option labels, capitalize property name placeholders
2026-05-14 11:00:15 -07:00

2.2 KiB

Contributing

Thanks for your interest in contributing. This document describes how to report issues, propose changes, and get a local development environment running.

Reporting issues

  • Search existing issues before opening a new one.
  • For bugs, include: Obsidian version, plugin version, operating system, reproduction steps, and what you expected vs. what happened. Screenshots or a short screen recording help.
  • For feature requests, describe the use case and the problem the feature would solve, not just the proposed solution.

Development setup

Requirements:

  • Node.js (LTS recommended)
  • pnpm. This repo pins a specific version via packageManager in package.json.
pnpm install
pnpm dev      # watch mode build
pnpm build    # production build
pnpm lint     # check code style
pnpm lint:fix # auto-fix where possible

Build artifacts (main.js, manifest.json, styles.css) are produced at the repo root.

To test against a real vault, point the build output at <vault>/.obsidian/plugins/<plugin-id>/ (symlink the three files, or use a tool like hot-reload).

Pull requests

  • Open an issue first for anything non-trivial so we can agree on direction before you spend time on it.
  • Keep PRs focused. One concern per PR is easier to review.
  • Run pnpm lint and pnpm build before submitting; CI will run these too.
  • Follow the existing code style. Use "properties" (not "frontmatter") when referring to YAML metadata. "Markdown" is always capitalized.
  • Update the README if you change user-facing behavior.

Code style

  • TypeScript strict mode, no any unless unavoidable.
  • Prefer Obsidian's API (Vault, MetadataCache, Workspace) over Node fs for vault access.
  • No network requests from the plugin runtime.

Releases

Maintainers cut releases by bumping the version in manifest.json, package.json, and versions.json, committing, then tagging and pushing the tag. The release workflow builds and attaches main.js, manifest.json, and styles.css with build provenance attestation.

License

By contributing, you agree that your contributions will be licensed under the MIT License.