mirror of
https://github.com/binhong87/obsidian-note-agent.git
synced 2026-07-22 06:52:10 +00:00
Migrate to ESLint v9 flat config, integrate obsidianmd plugin, fix all required errors (prefer-active-window-timers, no-tfile-tfolder-cast, no-unsupported-api, floating promises, etc.), and bump minAppVersion to 1.7.2 to match revealLeaf API requirement. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
import js from "@eslint/js";
|
|
import tseslint from "typescript-eslint";
|
|
import svelte from "eslint-plugin-svelte";
|
|
import obsidianmd from "eslint-plugin-obsidianmd";
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ["node_modules/**", "main.js", "styles.css", "esbuild.config.mjs", "tests/**"],
|
|
},
|
|
|
|
// Enable typed linting for all TS and Svelte files
|
|
{
|
|
languageOptions: {
|
|
parserOptions: {
|
|
project: "./tsconfig.json",
|
|
tsconfigRootDir: import.meta.dirname,
|
|
extraFileExtensions: [".svelte"],
|
|
},
|
|
},
|
|
},
|
|
|
|
// obsidianmd recommended bundles js:recommended, typescript-eslint, and all obsidian rules
|
|
...obsidianmd.configs.recommended,
|
|
|
|
// Svelte support
|
|
...svelte.configs["flat/recommended"],
|
|
{
|
|
files: ["**/*.svelte"],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
parser: tseslint.parser,
|
|
project: "./tsconfig.json",
|
|
extraFileExtensions: [".svelte"],
|
|
},
|
|
},
|
|
},
|
|
|
|
// Project-level overrides
|
|
{
|
|
plugins: { "@typescript-eslint": tseslint.plugin },
|
|
rules: {
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
"@typescript-eslint/no-unsafe-call": "warn",
|
|
"@typescript-eslint/no-unsafe-return": "warn",
|
|
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
"no-console": "off",
|
|
},
|
|
},
|
|
);
|