mirror of
https://github.com/yazanammar/obsidian-theme-engine.git
synced 2026-07-22 06:44:37 +00:00
- extracted core logic into dedicated modules - simplified main.ts and settingsTab.ts - improved maintainability and separation of concerns - no functional changes intended
85 lines
2.5 KiB
JavaScript
85 lines
2.5 KiB
JavaScript
import js from "@eslint/js";
|
|
import tseslint from "typescript-eslint";
|
|
import obsidianmd from "eslint-plugin-obsidianmd";
|
|
import eslintComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
import globals from "globals";
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: [
|
|
"dist/",
|
|
"build/",
|
|
"main.js",
|
|
"styles.css",
|
|
"*.min.js",
|
|
"**/*.scss",
|
|
"esbuild.config.mjs",
|
|
"node_modules/",
|
|
".git/",
|
|
],
|
|
},
|
|
|
|
js.configs.recommended,
|
|
...obsidianmd.configs.recommendedWithLocalesEn,
|
|
|
|
{
|
|
files: ["src/**/*.ts", "src/**/*.tsx"],
|
|
plugins: {
|
|
"@eslint-community/eslint-comments": eslintComments,
|
|
},
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: "module",
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
...globals.es2021,
|
|
},
|
|
parserOptions: {
|
|
project: "./tsconfig.json",
|
|
},
|
|
},
|
|
rules: {
|
|
"@typescript-eslint/no-explicit-any": "error",
|
|
"no-console": ["error", { allow: ["warn", "error", "debug"] }],
|
|
"@typescript-eslint/no-floating-promises": "error",
|
|
"@typescript-eslint/no-misused-promises": "error",
|
|
"obsidianmd/hardcoded-config-path": "error",
|
|
"obsidianmd/no-forbidden-elements": "error",
|
|
"@typescript-eslint/await-thenable": "error",
|
|
"@eslint-community/eslint-comments/require-description": "error",
|
|
"@eslint-community/eslint-comments/no-unused-disable": "error",
|
|
"@eslint-community/eslint-comments/no-restricted-disable": [
|
|
"error",
|
|
"obsidianmd/no-forbidden-elements",
|
|
"obsidianmd/ui/sentence-case",
|
|
],
|
|
|
|
"@typescript-eslint/no-unsafe-function-type": "error",
|
|
"obsidianmd/settings-tab/no-manual-html-headings": "error",
|
|
|
|
"prefer-spread": "error",
|
|
"@typescript-eslint/require-await": "error",
|
|
"@typescript-eslint/no-this-alias": "error",
|
|
"obsidianmd/no-static-styles-assignment": "error",
|
|
|
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
"@typescript-eslint/no-unsafe-call": "off",
|
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
"@typescript-eslint/no-unsafe-return": "off",
|
|
"@typescript-eslint/no-unsafe-argument": "off",
|
|
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{ argsIgnorePattern: "^_" },
|
|
],
|
|
"no-restricted-globals": [
|
|
"error",
|
|
{
|
|
name: "fetch",
|
|
message: "Use requestUrl from 'obsidian' instead.",
|
|
},
|
|
],
|
|
},
|
|
}
|
|
);
|