mirror of
https://github.com/jheddings/obsidian-stomp.git
synced 2026-07-22 06:44:59 +00:00
40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
import typescriptParser from "@typescript-eslint/parser";
|
|
import { defineConfig } from "eslint/config";
|
|
import obsidianmd from "eslint-plugin-obsidianmd";
|
|
import globals from "globals";
|
|
|
|
// Disable all obsidianmd rules for non-TS files. Several rules in the
|
|
// plugin's recommended config call getParserServices() but are applied
|
|
// globally (no files filter), which crashes on package.json and other
|
|
// non-TypeScript files that lack type information.
|
|
const obsidianmdOff = Object.fromEntries(
|
|
Object.keys(obsidianmd.rules ?? {}).map((name) => [`obsidianmd/${name}`, "off"])
|
|
);
|
|
|
|
export default defineConfig([
|
|
{
|
|
ignores: ["main.js", "dist/**", "node_modules/**", "tmp/**", "**/*.d.ts", "**/*.mjs"],
|
|
},
|
|
...obsidianmd.configs.recommended,
|
|
{
|
|
files: ["**/*.ts", "**/*.tsx"],
|
|
languageOptions: {
|
|
parser: typescriptParser,
|
|
globals: globals.browser,
|
|
parserOptions: {
|
|
project: "./tsconfig.json",
|
|
},
|
|
},
|
|
rules: {
|
|
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
},
|
|
},
|
|
{
|
|
files: ["package.json"],
|
|
rules: {
|
|
...obsidianmdOff,
|
|
"depend/ban-dependencies": "off",
|
|
},
|
|
},
|
|
]);
|