npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-obsidianmd

v0.1.9

Published

Validates guidelines for Obsidian plugins

Readme

eslint-plugin-obsidianmd

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-obsidianmd:

npm install eslint-plugin-obsidianmd --save-dev

Usage

With the release of ESLint v9, the default configuration file is now eslint.config.js.

Flat Config (eslint.config.js) - Recommended for ESLint v9+

To use the recommended configuration, add it to your eslint.config.js file. This will enable all the recommended rules.

// eslint.config.mjs
import tsparser from "@typescript-eslint/parser";
import { defineConfig } from "eslint/config";
import obsidianmd from "eslint-plugin-obsidianmd";

export default defineConfig([
  ...obsidianmd.configs.recommended,
  {
    files: ["**/*.ts"],
    languageOptions: {
      parser: tsparser,
      parserOptions: { project: "./tsconfig.json" },
    },

    // You can add your own configuration to override or add rules
    rules: {
      // example: turn off a rule from the recommended set
      "obsidianmd/sample-names": "off",
      // example: add a rule not in the recommended set and set its severity
      "obsidianmd/prefer-file-manager-trash": "error",
    },
  },
]);

Legacy Config (.eslintrc)

To use the recommended configuration, extend it in your .eslintrc file:

{
  "extends": ["plugin:obsidianmd/recommended"]
}

You can also override or add rules:

{
  "extends": ["plugin:obsidianmd/recommended"],
  "rules": {
    "obsidianmd/sample-names": "off",
    "obsidianmd/prefer-file-manager-trash": "error"
  }
}

Configurations

| | Name | | :--- | :------------------------- | | ✅ | recommended | | 🇬🇧 | recommendedWithLocalesEn |

Rules

🔧 Automatically fixable by the --fix CLI option.

| Name                                          | Description | 🔧 | | :----------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------- | :- | | commands/no-command-in-command-id | Disallow using the word 'command' in a command ID. | | | commands/no-command-in-command-name | Disallow using the word 'command' in a command name. | | | commands/no-default-hotkeys | Discourage providing default hotkeys for commands. | | | commands/no-plugin-id-in-command-id | Disallow including the plugin ID in a command ID. | | | commands/no-plugin-name-in-command-name | Disallow including the plugin name in a command name. | | | detach-leaves | Don't detach leaves in onunload. | 🔧 | | hardcoded-config-path | test | | | no-forbidden-elements | Disallow attachment of forbidden elements to the DOM in Obsidian plugins. | | | no-plugin-as-component | Disallow anti-patterns when passing a component to MarkdownRenderer.render to prevent memory leaks. | | | no-sample-code | Disallow sample code snippets from the Obsidian plugin template. | 🔧 | | no-static-styles-assignment | Disallow setting styles directly on DOM elements, favoring CSS classes instead. | | | no-tfile-tfolder-cast | Disallow type casting to TFile or TFolder, suggesting instanceof checks instead. | | | no-view-references-in-plugin | Disallow storing references to custom views directly in the plugin, which can cause memory leaks. | | | object-assign | Discourage using Object.assign with two arguments | | | platform | Disallow use of navigator API for OS detection | | | prefer-abstract-input-suggest | Disallow Liam's frequently copied TextInputSuggest implementation in favor of the built-in AbstractInputSuggest. | | | prefer-file-manager-trash-file | Prefer FileManager.trashFile() over Vault.trash() or Vault.delete() to respect user settings. | | | regex-lookbehind | Using lookbehinds in Regex is not supported in some iOS versions | | | sample-names | Rename sample plugin class names | | | settings-tab/no-manual-html-headings | Disallow using HTML heading elements for settings headings. | 🔧 | | settings-tab/no-problematic-settings-headings | Discourage anti-patterns in settings headings. | 🔧 | | ui/sentence-case | Enforce sentence case for UI strings | 🔧 | | ui/sentence-case-json | Enforce sentence case for English JSON locale strings | 🔧 | | ui/sentence-case-locale-module | Enforce sentence case for English TS/JS locale module strings | 🔧 | | validate-license | Validate the structure of copyright notices in LICENSE files for Obsidian plugins. | | | validate-manifest | Validate the structure of manifest.json for Obsidian plugins. | | | vault/iterate | Avoid iterating all files to find a file by its path | 🔧 |

UI sentence case

Checks UI strings for sentence case. The rule reports warnings but doesn't change text unless you run ESLint with --fix and enable allowAutoFix.

  • Included at warn level in recommended config
  • Extended locale checks available via recommendedWithLocalesEn
  • By default allows CamelCase words like AutoReveal
  • Set enforceCamelCaseLower: true to flag CamelCase as incorrect

Usage (flat config)

// eslint.config.mjs
import tsparser from "@typescript-eslint/parser";
import { defineConfig } from "eslint/config";
import obsidianmd from "eslint-plugin-obsidianmd";

export default defineConfig([
  ...obsidianmd.configs.recommended,
  // Or include English locale files (JSON and TS/JS modules)
  // ...obsidianmd.configs.recommendedWithLocalesEn,

  {
    files: ["**/*.ts"],
    languageOptions: {
      parser: tsparser,
      parserOptions: { project: "./tsconfig.json" },
    },

    // Optional project overrides
    rules: {
      "obsidianmd/ui/sentence-case": [
        "warn",
        {
          brands: ["YourBrand"],
          acronyms: ["OK"],
          enforceCamelCaseLower: true,
        },
      ],
    },
  },
]);

Notes

  • Hyphenated words: Auto-Reveal becomes auto-reveal
  • Locale file patterns in recommendedWithLocalesEn: en*.json, en*.ts, en*.js, en/**/*

Known limitations

Sentence detection may incorrectly split on abbreviations (Dr., Inc., etc.). Use single sentences or adjust rule options when needed.