-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
64 lines (63 loc) · 2.36 KB
/
eslint.config.ts
File metadata and controls
64 lines (63 loc) · 2.36 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
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import eslintConfigPrettier from 'eslint-config-prettier'
import globals from 'globals'
import obsidianmd from 'eslint-plugin-obsidianmd'
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
// @ts-expect-error - obsidianmd types are incomplete but the config works at runtime
...obsidianmd.configs['recommended'],
eslintConfigPrettier,
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'scripts/**',
'.cz-config.cjs',
'prettier.config.cjs',
'package.json'
]
},
{
files: ['**/*.{js,mjs,cjs,ts}'],
languageOptions: {
globals: {
...globals.node,
...globals.browser,
// Obsidian global functions
createDiv: 'readonly',
createEl: 'readonly',
createSpan: 'readonly',
createFragment: 'readonly'
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }
],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-deprecated': 'off',
// These are too strict for dynamic plugin APIs
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
// Obsidian methods are dynamically added to prototypes
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'no-prototype-builtins': 'off',
// Disable dependency ban rule - lint-staged is intentionally used
'depend/ban-dependencies': 'off',
// Allow confirm for delete confirmations
'no-alert': 'off',
// Disable sentence case rule - it has false positives for already-correct text
'obsidianmd/ui/sentence-case': 'off'
}
}
)