You'll first need to install ESLint:
npm i eslint --save-devNext, install eslint-plugin-obsidianmd:
npm install eslint-plugin-obsidianmd --save-devAdd the recommended configuration to your eslint.config.mjs. This enables all recommended rules, including ESLint core, typescript-eslint type-checked rules, and Obsidian-specific rules.
// eslint.config.mjs
import { defineConfig } from "eslint/config";
import obsidianmd from "eslint-plugin-obsidianmd";
export default defineConfig([
...obsidianmd.configs.recommended,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ["eslint.config.*"],
},
},
},
rules: {
// example: turn off a rule from the recommended set
"obsidianmd/sample-names": "off",
},
},
]);The parserOptions block is required because the recommended config includes type-checked rules that need access to your TypeScript project. allowDefaultProject ensures files not listed in your tsconfig.json (like the ESLint config file itself) are still linted without errors. See the configuration guide for details on why this is needed and how to customize it.
Note: You do not need to separately add
eslint.configs.recommendedortseslint.configs.recommended— both are already included in the recommended config.
For advanced usage — layering stricter typescript-eslint configs, ignoring files, disabling rules for non-plugin code, and troubleshooting common errors — see the configuration guide.
| Name | |
|---|---|
| ✅ | recommended |
| 🇬🇧 | recommendedWithLocalesEn |
💼 Configurations enabled in.
🚫 Configurations disabled in.
✅ Set in the recommended configuration.
🇬🇧 Set in the recommendedWithLocalesEn configuration.
🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.
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
recommendedconfig - Extended locale checks available via
recommendedWithLocalesEn - By default allows CamelCase words like
AutoReveal - Set
enforceCamelCaseLower: trueto flag CamelCase as incorrect
// eslint.config.mjs
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,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ["eslint.config.*"],
},
},
},
// Optional project overrides
rules: {
"obsidianmd/ui/sentence-case": [
"warn",
{
brands: ["YourBrand"],
acronyms: ["OK"],
enforceCamelCaseLower: true,
},
],
},
},
]);- Hyphenated words:
Auto-Revealbecomesauto-reveal - Locale file patterns in
recommendedWithLocalesEn:en*.json,en*.ts,en*.js,en/**/*
Sentence detection may incorrectly split on abbreviations (Dr., Inc., etc.). Use single sentences or adjust rule options when needed.
