mirror of
https://github.com/binhong87/obsidian-note-agent.git
synced 2026-07-22 06:52:10 +00:00
52 lines
1.4 KiB
JavaScript
52 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",
|
||
|
|
},
|
||
|
|
},
|
||
|
|
);
|