-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
55 lines (51 loc) · 2.29 KB
/
Copy patheslint.config.mjs
File metadata and controls
55 lines (51 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import tsparser from "@typescript-eslint/parser";
import tseslint from "typescript-eslint";
import { defineConfig } from "eslint/config";
import obsidianmd from "eslint-plugin-obsidianmd";
import globals from "globals";
export default defineConfig([
{ ignores: ["**/tests/**", "node_modules/", "*.mjs", "main.js", "dev/**"] },
...obsidianmd.configs.recommended,
{
files: ["**/*.{js,ts}"],
languageOptions: {
globals: {
...globals.browser,
// Obsidian-injected globals for popout-window-aware code
activeDocument: "readonly",
activeWindow: "readonly",
},
parser: tsparser,
parserOptions: { project: "./tsconfig.json" },
},
plugins: {
obsidianmd, // Explicitly include the plugin
"@typescript-eslint": tseslint.plugin,
},
// You can add your own configuration to override or add rules
rules: {
"obsidianmd/sample-names": "off",
"obsidianmd/ui/sentence-case": ["warn", { allowAutoFix: true }],
// Allow console.warn/error for genuine error reporting; block debug console.log
"no-console": ["warn", { allow: ["warn", "error"] }],
// Enforce no-static-styles-assignment as an error so the local lint
// breaks instead of waiting for the upstream obsidianmd reviewer bot
// to catch it. The rule means: no direct `.style.foo = ...` and no
// `setCssProps({ transform: ... })` for arbitrary CSS properties.
// Set CSS custom properties (`--duckmage-...`) via setCssProps and
// reference them from CSS rules instead.
//
// The other patterns the obsidianmd reviewer flags but that don't
// have shipped rules in eslint-plugin-obsidianmd yet — `document` →
// `activeDocument`, deprecated `setDynamicTooltip` — are documented
// as conventions in CLAUDE.md and audited manually.
"obsidianmd/no-static-styles-assignment": "error",
// Reviewer-bot parity (2026-08-09): the bot runs the LATEST
// eslint-plugin-obsidianmd plus type-aware typescript-eslint rules.
// Keep the plugin dependency current (a stale 0.1.9 pin let 22
// prefer-create-el sites through) and mirror the type-aware rule
// the bot flags so local lint breaks first.
"@typescript-eslint/no-unnecessary-type-assertion": "error",
},
},
]);