mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
60 lines
1.5 KiB
JavaScript
60 lines
1.5 KiB
JavaScript
import tsParser from "@typescript-eslint/parser";
|
|
import tsPlugin from "@typescript-eslint/eslint-plugin";
|
|
import obsidianmd from "eslint-plugin-obsidianmd";
|
|
|
|
const sourceFiles = ["src/**/*.ts", "src/**/*.tsx"];
|
|
|
|
export default [
|
|
{
|
|
ignores: ["main.js", "node_modules/**", "src/generated/**"],
|
|
},
|
|
...obsidianmd.configs.recommended.map((config) => ({
|
|
...config,
|
|
basePath: "src",
|
|
})),
|
|
{
|
|
files: ["src/**/*.ts", "tests/**/*.ts"],
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: "module",
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
project: "./tsconfig.json",
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
globals: {
|
|
HTMLElement: "readonly",
|
|
HTMLTextAreaElement: "readonly",
|
|
KeyboardEvent: "readonly",
|
|
NodeJS: "readonly",
|
|
console: "readonly",
|
|
document: "readonly",
|
|
requestAnimationFrame: "readonly",
|
|
},
|
|
},
|
|
plugins: {
|
|
"@typescript-eslint": tsPlugin,
|
|
},
|
|
rules: {
|
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
"@typescript-eslint/no-explicit-any": "error",
|
|
"@typescript-eslint/no-floating-promises": "error",
|
|
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
},
|
|
},
|
|
{
|
|
files: sourceFiles,
|
|
plugins: {
|
|
obsidianmd,
|
|
},
|
|
rules: {
|
|
"obsidianmd/ui/sentence-case": [
|
|
"error",
|
|
{
|
|
acronyms: ["MCP"],
|
|
brands: ["Codex", "Codex Panel", "Obsidian"],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|