-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
87 lines (86 loc) · 2.65 KB
/
eslint.config.mjs
File metadata and controls
87 lines (86 loc) · 2.65 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
75
76
77
78
79
80
81
82
83
84
85
86
87
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import svelte from "eslint-plugin-svelte";
import globals from "globals";
import { defineConfig } from "eslint/config";
import obsidianmd from "eslint-plugin-obsidianmd";
export default defineConfig(
{
ignores: ["node_modules/**", "main.js", "versions.json"],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
...svelte.configs["flat/recommended"],
{
files: ["**/*.ts"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
},
},
},
{
plugins: {
obsidianmd,
},
rules: {
// Obsidian-specific rules
"obsidianmd/commands/no-command-in-command-id": "error",
"obsidianmd/commands/no-command-in-command-name": "error",
"obsidianmd/commands/no-default-hotkeys": "error",
"obsidianmd/commands/no-plugin-id-in-command-id": "error",
"obsidianmd/commands/no-plugin-name-in-command-name": "error",
"obsidianmd/detach-leaves": "error",
"obsidianmd/hardcoded-config-path": "error",
"obsidianmd/no-forbidden-elements": "error",
"obsidianmd/no-plugin-as-component": "error",
"obsidianmd/no-sample-code": "error",
"obsidianmd/no-static-styles-assignment": "error",
"obsidianmd/no-tfile-tfolder-cast": "error",
"obsidianmd/no-view-references-in-plugin": "error",
"obsidianmd/object-assign": "error",
"obsidianmd/platform": "error",
"obsidianmd/prefer-abstract-input-suggest": "error",
"obsidianmd/prefer-file-manager-trash-file": "warn",
"obsidianmd/regex-lookbehind": "error",
"obsidianmd/sample-names": "error",
"obsidianmd/settings-tab/no-manual-html-headings": "error",
"obsidianmd/settings-tab/no-problematic-settings-headings": "error",
"obsidianmd/ui/sentence-case": ["warn", { enforceCamelCaseLower: true }],
"obsidianmd/ui/sentence-case-json": "warn",
"obsidianmd/ui/sentence-case-locale-module": "warn",
"obsidianmd/validate-license": "error",
"obsidianmd/validate-manifest": "error",
"obsidianmd/vault/iterate": "error",
},
},
{
languageOptions: {
globals: {
...globals.browser,
},
},
},
{
files: ["**/*.svelte", "**/*.svelte.ts", "**/*.svelte.js"],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: [".svelte"],
parser: tseslint.parser,
},
},
},
{
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
},
},
);