forked from clawwork-ai/ClawWork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
92 lines (91 loc) · 2.85 KB
/
eslint.config.mjs
File metadata and controls
92 lines (91 loc) · 2.85 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
86
87
88
89
90
91
92
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import reactHooks from 'eslint-plugin-react-hooks';
import eslintConfigPrettier from 'eslint-config-prettier';
export default tseslint.config(
{ ignores: ['**/dist/**', '**/out/**', '**/coverage/**', '.claude/**', 'scripts/**', '**/scripts/**'] },
js.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'no-empty': ['error', { allowEmptyCatch: true }],
},
},
{
files: ['packages/desktop/src/renderer/**/*.{ts,tsx}'],
plugins: { 'react-hooks': reactHooks },
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'electron',
message:
'Renderer code must go through preload and window.clawwork instead of importing Electron directly.',
},
{
name: 'ws',
message: 'Renderer code must not open raw Gateway sockets.',
},
{
name: 'fs',
message: 'Renderer code must not access the filesystem directly.',
},
{
name: 'fs/promises',
message: 'Renderer code must not access the filesystem directly.',
},
{
name: 'path',
message: 'Renderer code must not resolve filesystem paths directly.',
},
{
name: 'child_process',
message: 'Renderer code must not spawn system processes directly.',
},
],
patterns: [
{
group: ['node:*'],
message: 'Renderer code must not import Node builtins. Use main/preload boundaries.',
},
{
group: ['../main/**', '../../main/**', '../../../main/**', '../../../../main/**'],
message: 'Renderer code must not import main-process modules directly.',
},
],
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
languageOptions: { globals: globals.browser },
},
{
files: ['website/src/**/*.{ts,tsx}'],
plugins: { 'react-hooks': reactHooks },
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
languageOptions: { globals: globals.browser },
},
{
files: [
'packages/desktop/src/main/**/*.{ts,tsx}',
'packages/desktop/src/preload/**/*.{ts,tsx}',
'packages/shared/src/**/*.ts',
],
languageOptions: { globals: globals.node },
},
{
files: ['**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
},
},
eslintConfigPrettier,
);