-
Notifications
You must be signed in to change notification settings - Fork 445
Expand file tree
/
Copy patheslint.config.mjs
More file actions
88 lines (86 loc) · 3.11 KB
/
eslint.config.mjs
File metadata and controls
88 lines (86 loc) · 3.11 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
import {includeIgnoreFile} from '@eslint/compat'
import oclif from 'eslint-config-oclif'
import prettier from 'eslint-config-prettier'
import path from 'node:path'
import {fileURLToPath} from 'node:url'
const gitignorePath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '.gitignore')
export default [
includeIgnoreFile(gitignorePath),
...oclif,
prettier,
{
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
},
},
},
// Web UI (browser environment) — allow browser globals and React naming conventions
{
files: ['src/webui/**/*.ts', 'src/webui/**/*.tsx'],
languageOptions: {
globals: {
document: 'readonly',
fetch: 'readonly',
sessionStorage: 'readonly',
window: 'readonly',
},
},
rules: {
'n/no-unsupported-features/node-builtins': 'off',
// Prevent Web UI from importing server code directly
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['**/server/**', '../server/**', '../../server/**', '../../../server/**', '../../../../server/**'],
message: 'Web UI should not import from server. Use transport events or feature APIs instead.',
},
{
group: ['**/agent/**', '../agent/**', '../../agent/**', '../../../agent/**', '../../../../agent/**'],
message: 'Web UI should not import from agent. Use transport events or feature APIs instead.',
},
{
group: ['**/oclif/**', '../oclif/**', '../../oclif/**', '../../../oclif/**', '../../../../oclif/**'],
message: 'Web UI should not import from oclif. Use transport events or feature APIs instead.',
},
{
group: ['**/tui/**', '../tui/**', '../../tui/**', '../../../tui/**', '../../../../tui/**'],
message: 'Web UI should not import from tui. Use transport events or feature APIs instead.',
},
],
},
],
'unicorn/filename-case': 'off',
},
},
// Prevent TUI from importing server code directly
{
files: ['src/tui/**/*.ts', 'src/tui/**/*.tsx'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['**/server/**', '../server/**', '../../server/**', '../../../server/**', '../../../../server/**'],
message: 'TUI should not import from server. Use transport events or feature APIs instead.',
},
{
group: ['**/agent/**', '../agent/**', '../../agent/**', '../../../agent/**', '../../../../agent/**'],
message: 'TUI should not import from agent. Use transport events or feature APIs instead.',
},
{
group: ['**/oclif/**', '../oclif/**', '../../oclif/**', '../../../oclif/**', '../../../../oclif/**'],
message: 'TUI should not import from oclif. Use transport events or feature APIs instead.',
},
],
},
],
},
},
]