-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
157 lines (156 loc) · 5.8 KB
/
Copy patheslint.config.mjs
File metadata and controls
157 lines (156 loc) · 5.8 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import nx from '@nx/eslint-plugin';
export default [
...nx.configs['flat/base'],
...nx.configs['flat/typescript'],
...nx.configs['flat/javascript'],
{
ignores: [
'**/dist',
'**/out-tsc',
'**/.next',
'**/.next/**',
'**/.vercel',
'**/.vercel/**',
'**/next-env.d.ts',
'**/.install-collector/**',
// Vendored byte-identical from upstream; its hash is pinned by a spec.
'apps/website/src/vendor/scrollcraft/scrollcraft.js',
'apps/website/e2e/scroll-craft/shoot.mjs',
],
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [
'^.*/eslint(\\.base)?\\.config\\.[cm]?[jt]s$',
'^.*/libs/cockpit-(docs|registry|shell|testing|ui)/src/index$',
// The repo-root pricing config is shared with the website and
// lives outside any Nx project on purpose.
'^.*/pricing/tiers\\.config$',
],
depConstraints: [
{
sourceTag: 'layer:core',
onlyDependOnLibsWithTags: ['layer:core'],
bannedExternalImports: ['@angular/*', 'react', 'react-dom', 'rxjs', '@langchain/*', '@ag-ui/*'],
},
{
sourceTag: 'layer:content',
onlyDependOnLibsWithTags: ['layer:core', 'layer:content'],
bannedExternalImports: ['@angular/*', 'react', 'react-dom', 'rxjs', '@langchain/*', '@ag-ui/*'],
},
{
sourceTag: 'layer:backend',
onlyDependOnLibsWithTags: ['layer:core', 'layer:content', 'layer:backend'],
bannedExternalImports: ['@angular/*', 'react', 'react-dom'],
},
{
sourceTag: 'layer:angular',
onlyDependOnLibsWithTags: ['layer:core', 'layer:content', 'layer:render', 'layer:a2ui', 'layer:angular'],
bannedExternalImports: ['react', 'react/*', 'react-dom', 'react-dom/*', '@types/react', '@types/react-dom', '@langchain/*', '@ag-ui/*'],
},
{
sourceTag: 'layer:react',
onlyDependOnLibsWithTags: ['layer:core', 'layer:content', 'layer:react'],
bannedExternalImports: ['@angular/*', '@langchain/*', '@ag-ui/*'],
},
{
sourceTag: '*',
onlyDependOnLibsWithTags: ['*'],
},
],
},
],
},
},
{
files: [
'**/*.ts',
'**/*.tsx',
'**/*.cts',
'**/*.mts',
'**/*.js',
'**/*.jsx',
'**/*.cjs',
'**/*.mjs',
],
// Override or add rules here
rules: {},
},
// Growth libraries own shared server behavior, not application or publishing
// orchestration. Keep deployment-specific imports at the app boundary.
{
files: ['libs/growth/src/**/*.ts', 'libs/growth-capture/src/**/*.ts'],
rules: {
'no-restricted-imports': ['error', {
patterns: [{
group: ['**/apps/**', '**/marketing/**', '@threadplane-internal/marketing-*'],
message: 'Shared Growth code must not depend on apps or publishing tools.',
}],
}],
},
},
{
files: ['apps/growth-research/src/**/*.ts', 'apps/growth-research/scripts/**/*.mts'],
rules: {
'no-restricted-imports': ['error', {
patterns: [{
group: ['**/lifecycle/**', '**/website/**'],
message: 'Research must consume shared libraries rather than another app implementation.',
}],
}],
},
},
{
files: ['marketing/**/*.ts', 'marketing/**/*.tsx'],
rules: {
'no-restricted-imports': ['error', {
patterns: [{
group: ['**/apps/**', '**/libs/growth/**', '@threadplane-internal/growth'],
message: 'Publishing tools must not access contact or lifecycle internals.',
}],
}],
},
},
// Inline-style guard — apps/website migrated off static inline styles
// (docs/superpowers/specs/2026-08-29-inline-style-substrate-migration-design.md,
// batches #848–#857). Flags identifier-keyed members of a style object
// literal. The escape hatch for dynamic values — style={{ '--x': value }} —
// uses string-literal keys and passes. Genuinely dynamic identifier-keyed
// values (rare) get a targeted eslint-disable-next-line with a reason.
// Escalated to 'error' after v0.0.61 per the plan's two-step; every former
// warning site now uses the escape hatch or a data-* state, so the rule
// guards at zero suppressions.
{
files: ['apps/website/src/**/*.tsx'],
ignores: [
// Satori-rendered OG images: inline styles are the only mechanism there.
'apps/website/src/app/opengraph-image.tsx',
// NOTE: [slug] would be a glob character class, so match by wildcard.
'apps/website/src/app/blog/*/opengraph-image.tsx',
// The shared card kit every card route renders through. Same reason:
// Satori has no stylesheet, so every value is an inline style.
'apps/website/src/app/card/**/*.tsx',
// The GitHub Social Preview card, rendered by Satori through that same
// kit. A Route Handler rather than a file-convention image, so it does
// not match either opengraph-image pattern above.
'apps/website/src/app/github-card/route.tsx',
'apps/website/src/**/*.spec.tsx',
],
rules: {
'no-restricted-syntax': [
'error',
{
selector:
'JSXAttribute[name.name="style"] > JSXExpressionContainer > ObjectExpression > Property[key.type="Identifier"]',
message:
"Static presentation belongs in src/styles/*.css (see the substrate-migration spec). For dynamic values, set a CSS custom property: style={{ '--x': value }}.",
},
],
},
},
];