-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
85 lines (84 loc) · 2.61 KB
/
Copy patheslint.config.mjs
File metadata and controls
85 lines (84 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
export default tseslint.config(
js.configs.recommended,
{
files: ["src/**/*.{ts,tsx}", "electron/**/*.{ts,tsx}", "scripts/**/*.test.ts", "server.ts", "server.test.ts"],
extends: [tseslint.configs.recommended],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: ["./tsconfig.json", "./tsconfig.electron.json", "./tsconfig.electron.test.json"],
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
"react-hooks": reactHooks,
},
rules: {
...reactHooks.configs.recommended.rules,
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"no-console": ["warn", { allow: ["warn", "error"] }],
// CANONICAL API BOUNDARY: renderer modules must not call
// window.veniceForge.* directly. All access must route through
// src/services/desktopBridge.ts. The only exceptions are:
// - desktopBridge.ts itself (the bridge implementation)
// - electron/preload.ts (the contextBridge surface)
// - src/stores/chat-store.ts (legacy module-level hydration;
// function-level paths have been refactored — Group C will
// migrate the remaining queueMicrotask).
"no-restricted-syntax": [
"error",
{
selector: "MemberExpression[object.property.name='veniceForge']",
message: "Do not access window.veniceForge.* directly — route through src/services/desktopBridge.ts.",
},
],
},
},
{
files: ["scripts/**/*.cjs", "*.config.cjs"],
languageOptions: {
globals: {
...globals.node,
},
sourceType: "commonjs",
},
rules: {
"no-console": "off",
},
},
{
files: ["src/services/desktopBridge.ts", "electron/preload.ts", "src/stores/chat-store.ts"],
rules: {
// desktopBridge is the one allowed caller; preload is the
// contextBridge surface; chat-store.ts is documented as the
// single legacy exception that calls chat.* directly (pre-bridge).
"no-restricted-syntax": "off",
},
},
{
files: ["**/*.test.{ts,tsx}"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
},
{
ignores: [
"dist/**",
"dist-electron/**",
"release/**",
"node_modules/**",
],
}
);