-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.mjs
More file actions
55 lines (54 loc) · 1.95 KB
/
Copy patheslint.config.mjs
File metadata and controls
55 lines (54 loc) · 1.95 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 obsidianmd from "eslint-plugin-obsidianmd";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: ["dist/**", "node_modules/**", "main.js", "*.mjs"],
},
...obsidianmd.configs.recommended,
{
files: ["src/**/*.ts"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Type-aware rules the Obsidian plugin review reports
// (obsidianmd recommended turns these off via disable-type-checked).
// Detect `any` but never auto-fix to `unknown` (obsidianmd enables
// fixToUnknown, which silently breaks the build); type these by hand.
"@typescript-eslint/no-explicit-any": [
"warn",
{ fixToUnknown: false },
],
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
// Match the review's allowed "_"-prefix escape hatch.
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
// Not part of the Obsidian review report: silence to keep signal
// focused on the reported items (the unsafe-* family is a
// downstream symptom of `any` and clears once typing lands).
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/only-throw-error": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"obsidianmd/ui/sentence-case": "off",
},
},
);