-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
74 lines (73 loc) · 2.42 KB
/
Copy patheslint.config.mjs
File metadata and controls
74 lines (73 loc) · 2.42 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// eslint.config.mjs
import tsparser from "@typescript-eslint/parser";
import { defineConfig } from "eslint/config";
import obsidianmd from "eslint-plugin-obsidianmd";
import globals from "globals";
export default defineConfig([
{
ignores: ["main.js", "node_modules/**", "dist/**", "*.js", "scripts/**", ".ref/**"]
},
...obsidianmd.configs.recommended,
{
files: ["**/*.ts"],
// Enable reporting of unused disable directives (matches Obsidian bot behavior)
linterOptions: {
reportUnusedDisableDirectives: "error"
},
languageOptions: {
parser: tsparser,
parserOptions: {
project: "./tsconfig.json",
sourceType: "module"
},
globals: {
...globals.browser,
require: "readonly", // Node.js require function (available in Obsidian's environment)
DomElementInfo: "readonly",
SvgElementInfo: "readonly",
activeDocument: "readonly",
activeWindow: "readonly",
ajax: "readonly",
ajaxPromise: "readonly",
createDiv: "readonly",
createEl: "readonly",
createFragment: "readonly",
createSpan: "readonly",
createSvg: "readonly",
fish: "readonly",
fishAll: "readonly",
isBoolean: "readonly",
nextFrame: "readonly",
ready: "readonly",
sleep: "readonly"
}
},
// Custom rule overrides
rules: {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"no-prototype-builtins": "off",
"@typescript-eslint/no-misused-promises": ["error",{"checksVoidReturn":{"attributes":false,"properties":false,"returns":false,"variables":false}}],
// Disable sample code rules for template repository
// These are intentional placeholder names and sample code that users should customize
"obsidianmd/sample-names": "off",
"obsidianmd/no-sample-code": "off",
// Console rules: Match Obsidian bot requirements (only warn/error/debug allowed)
"no-console": ["error", { "allow": ["warn", "error", "debug"] }],
// Require await in async functions (matches Obsidian bot)
"@typescript-eslint/require-await": "error",
},
},
{
files: ["**/*.mjs"],
languageOptions: {
globals: {
console: "readonly",
process: "readonly",
Buffer: "readonly",
__dirname: "readonly",
__filename: "readonly"
}
}
},
]);