-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
126 lines (125 loc) · 3.85 KB
/
Copy patheslint.config.mjs
File metadata and controls
126 lines (125 loc) · 3.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'apps/demo/.vite/**',
'.smoke/**',
'apps/spike/results/**',
'apps/storybook/storybook-static/**',
'.evidence/**',
],
},
...tseslint.configs.recommended,
{
// Pragmatic repo-wide relaxations: `any` is used deliberately at engine
// boundaries, and `_`-prefixed bindings are the intentional-unused idiom.
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
},
},
{
// Core must stay framework-free and headless: only the vanilla
// zustand store, and no ambient browser globals. orbit-data shares the
// purity bar (Node-import-safe, consumes supplied bytes/streams
// and NEVER fetches — no DOM, no network).
files: ['packages/core/src/**', 'packages/data/src/**'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'zustand',
message: 'orbit-core may only use zustand/vanilla.',
},
],
patterns: [
{
group: ['zustand/*', '!zustand/vanilla'],
message: 'orbit-core may only use zustand/vanilla.',
},
],
},
],
'no-restricted-globals': [
'error',
'window',
'document',
'navigator',
'fetch',
'XMLHttpRequest',
'WebSocket',
// Frame-loop policy: core owns no requestAnimationFrame loop;
// every per-frame consumer rides the engine's onFrame fan-out. The
// testing rafAudit instrument wraps rAF without calling it and
// passes this rule on its own.
{
name: 'requestAnimationFrame',
message:
'One frame loop per instance: ride the engine onFrame fan-out.',
},
],
'no-restricted-syntax': [
'error',
{
selector: "CallExpression[callee.property.name='requestAnimationFrame']",
message:
'One frame loop per instance: ride the engine onFrame fan-out.',
},
],
},
},
{
// React binding & packaged components: label/announcement text
// must reach the DOM as text nodes only — raw HTML injection is banned.
files: ['packages/react/src/**'],
rules: {
'no-restricted-syntax': [
'error',
{
selector: "JSXAttribute[name.name='dangerouslySetInnerHTML']",
message:
'dangerouslySetInnerHTML is banned in orbit-react: render text nodes only.',
},
{
selector: "AssignmentExpression[left.property.name='innerHTML']",
message: 'innerHTML assignment is banned in orbit-react: render text nodes only.',
},
// Frame-loop policy: components ride the core onFrame
// fan-out or subscription channels — never their own rAF loop.
{
selector: "CallExpression[callee.property.name='requestAnimationFrame']",
message:
'One frame loop per instance: ride the core onFrame fan-out.',
},
],
'no-restricted-globals': [
'error',
{
name: 'requestAnimationFrame',
message:
'One frame loop per instance: ride the core onFrame fan-out.',
},
],
},
},
{
// Sanctioned exception: Lasso's ONE-SHOT pointer-move coalescing during
// an active drag gesture — not a loop; it exists only while the pointer
// is captured and dies with the gesture.
files: ['packages/react/src/Lasso.tsx'],
rules: {
'no-restricted-globals': 'off',
},
},
);