Skip to content

Commit b432677

Browse files
committed
fix: properly scope rules to file types
- Split rule configurations into base (JS/TS) and type-checked (TS-only) - Separate package.json checks from main configuration - Add stubs for react and svelte configs - Regenerated documentation
1 parent 9f6042f commit b432677

40 files changed

Lines changed: 242 additions & 185 deletions

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import obsidianmd from "eslint-plugin-obsidianmd";
3030

3131
export default defineConfig([
3232
...obsidianmd.configs.recommended,
33+
...obsidianmd.configs.packageJson,
3334
{
3435
files: ["**/*.ts"],
3536
languageOptions: {
@@ -82,8 +83,11 @@ You can also override or add rules:
8283

8384
| | Name |
8485
| :--- | :------------------------- |
86+
| | `packageJson` |
87+
| ⚛️ | `react` |
8588
|| `recommended` |
8689
| 🇬🇧 | `recommendedWithLocalesEn` |
90+
| 🔥 | `svelte` |
8791

8892
<!-- end auto-generated configs list -->
8993

@@ -160,6 +164,7 @@ import obsidianmd from "eslint-plugin-obsidianmd";
160164

161165
export default defineConfig([
162166
...obsidianmd.configs.recommended,
167+
...obsidianmd.configs.packageJson,
163168
// Or include English locale files (JSON and TS/JS modules)
164169
// ...obsidianmd.configs.recommendedWithLocalesEn,
165170

docs/rules/commands/no-command-in-command-id.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
📝 Disallow using the word 'command' in a command ID.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
<!-- end auto-generated rule header -->

docs/rules/commands/no-command-in-command-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
📝 Disallow using the word 'command' in a command name.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
<!-- end auto-generated rule header -->

docs/rules/commands/no-default-hotkeys.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
📝 Discourage providing default hotkeys for commands.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
<!-- end auto-generated rule header -->

docs/rules/commands/no-plugin-id-in-command-id.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
📝 Disallow including the plugin ID in a command ID.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
<!-- end auto-generated rule header -->
88

docs/rules/commands/no-plugin-name-in-command-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
📝 Disallow including the plugin name in a command name.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
<!-- end auto-generated rule header -->
88

docs/rules/detach-leaves.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
📝 Don't detach leaves in onunload.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
88

docs/rules/editor-drop-paste.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
📝 Require checking `evt.defaultPrevented` and calling `evt.preventDefault()` in editor-drop/editor-paste handlers.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
<!-- end auto-generated rule header -->

docs/rules/hardcoded-config-path.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
📝 Test.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
<!-- end auto-generated rule header -->

docs/rules/no-forbidden-elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
📝 Disallow attachment of forbidden elements to the DOM in Obsidian plugins.
44

5-
💼 This rule is enabled in the following configs: ✅ `recommended`, 🇬🇧 `recommendedWithLocalesEn`.
5+
💼 This rule is enabled in the following configs: `react`, `recommended`, 🇬🇧 `recommendedWithLocalesEn`, `svelte`.
66

77
<!-- end auto-generated rule header -->

0 commit comments

Comments
 (0)