mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Tighten ESLint configuration
This commit is contained in:
parent
7fed46d7d5
commit
c8a23e2b48
3 changed files with 26 additions and 16 deletions
|
|
@ -1,28 +1,31 @@
|
|||
import tsParser from "@typescript-eslint/parser";
|
||||
import tsPlugin from "@typescript-eslint/eslint-plugin";
|
||||
import js from "@eslint/js";
|
||||
import { defineConfig } from "eslint/config";
|
||||
import obsidianmd from "eslint-plugin-obsidianmd";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
const sourceFiles = ["src/**/*.ts", "src/**/*.tsx"];
|
||||
const typeScriptFiles = ["src/**/*.ts", "tests/**/*.ts"];
|
||||
|
||||
export default [
|
||||
export default defineConfig([
|
||||
{
|
||||
ignores: ["main.js", "node_modules/**", "src/generated/**"],
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommendedTypeChecked,
|
||||
...obsidianmd.configs.recommended.map((config) => ({
|
||||
...config,
|
||||
basePath: "src",
|
||||
})),
|
||||
{
|
||||
files: ["src/**/*.ts", "tests/**/*.ts"],
|
||||
files: typeScriptFiles,
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: "module",
|
||||
parser: tsParser,
|
||||
parserOptions: {
|
||||
project: "./tsconfig.json",
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
globals: {
|
||||
AbortSignal: "readonly",
|
||||
HTMLElement: "readonly",
|
||||
HTMLTextAreaElement: "readonly",
|
||||
KeyboardEvent: "readonly",
|
||||
|
|
@ -32,9 +35,6 @@ export default [
|
|||
requestAnimationFrame: "readonly",
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
"@typescript-eslint": tsPlugin,
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/consistent-type-imports": "error",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
|
|
@ -43,7 +43,17 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
files: sourceFiles,
|
||||
files: ["tests/**/*.ts"],
|
||||
rules: {
|
||||
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
||||
"@typescript-eslint/require-await": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["src/**/*.ts", "src/**/*.tsx"],
|
||||
plugins: {
|
||||
obsidianmd,
|
||||
},
|
||||
|
|
@ -57,4 +67,4 @@ export default [
|
|||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
]);
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -9,9 +9,8 @@
|
|||
"version": "1.1.0",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.4",
|
||||
"@types/node": "^25.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.59.2",
|
||||
"@typescript-eslint/parser": "^8.59.2",
|
||||
"esbuild": "^0.28.0",
|
||||
"eslint": "^10.3.0",
|
||||
"eslint-plugin-obsidianmd": "^0.3.0",
|
||||
|
|
@ -19,6 +18,7 @@
|
|||
"obsidian": "~1.12.3",
|
||||
"prettier": "^3.8.3",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.59.4",
|
||||
"vitest": "^4.1.7"
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -31,15 +31,15 @@
|
|||
"check": "npm run typecheck && npm run test && npm run lint && npm run format:check && npm run build:prod"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.4",
|
||||
"@types/node": "^25.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.59.2",
|
||||
"@typescript-eslint/parser": "^8.59.2",
|
||||
"esbuild": "^0.28.0",
|
||||
"eslint": "^10.3.0",
|
||||
"eslint-plugin-obsidianmd": "^0.3.0",
|
||||
"jsdom": "^29.1.1",
|
||||
"obsidian": "~1.12.3",
|
||||
"prettier": "^3.8.3",
|
||||
"typescript-eslint": "^8.59.4",
|
||||
"typescript": "^6.0.3",
|
||||
"vitest": "^4.1.7"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue