diff --git a/README.md b/README.md index 2433971..beedf9d 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,31 @@ You can also override or add rules: +### Using only Obsidian-specific rules + +If you use a linter other than ESLint, you may want to only enable Obsidian-specific rules, without all the General ESLint rules. To do so, use this configuration: + +```javascript +// eslint.config.mjs +import tsparser from "@typescript-eslint/parser"; +import { defineConfig } from "eslint/config"; +import obsidianmd from "eslint-plugin-obsidianmd"; + +export default defineConfig([ + { + files: ["**/*.ts"], + languageOptions: { + parser: tsparser, + parserOptions: { project: "./tsconfig.json" }, + }, + plugins: { + obsidianmd: obsidianmd, + }, + rules: obsidianmd.configs.recommendedPluginRulesOnly, + }, +]); +``` + ## Configurations diff --git a/lib/index.ts b/lib/index.ts index 6e69bb5..1f4106b 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -260,6 +260,7 @@ plugin.configs = { } as any; }, } as any, + recommendedPluginRulesOnly: recommendedPluginRulesConfig, } as any; export default plugin;