@starci/eslint-canon-fe 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/file-layout.mjs +22 -2
- package/package.json +1 -1
package/file-layout.mjs
CHANGED
|
@@ -164,7 +164,7 @@ export const noRuntimeNamespace = {
|
|
|
164
164
|
const FEATURE_TIERS = /\/packages\/[^/]+\/src\/(blocks|overlays|pages|layouts)\//
|
|
165
165
|
|
|
166
166
|
/** Tiers that know no feature, and therefore belong to the shared package. */
|
|
167
|
-
const VOCABULARY_TIERS = /\/apps\/[^/]+\/src\/(?:components\/)?(contracts|leaves|composites|branches
|
|
167
|
+
const VOCABULARY_TIERS = /\/apps\/[^/]+\/src\/(?:components\/)?(contracts|leaves|composites|branches)\//
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
170
|
* In a monorepo, the shared package stops below the block.
|
|
@@ -183,7 +183,7 @@ export const monorepoTierBelongsToItsSide = {
|
|
|
183
183
|
type: "problem",
|
|
184
184
|
docs: {
|
|
185
185
|
description:
|
|
186
|
-
"In a monorepo the shared package holds contracts, leaves, composites
|
|
186
|
+
"In a monorepo the shared package holds contracts, leaves, composites and branches; blocks, overlays, layouts and pages belong to the app that owns the feature.",
|
|
187
187
|
},
|
|
188
188
|
schema: [],
|
|
189
189
|
messages: {
|
|
@@ -343,7 +343,27 @@ export const sourceTierMarkerMatchesFolder = {
|
|
|
343
343
|
},
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
const SHELL_TIER = /\/(?:src\/components|packages\/[^/]+\/src|apps\/[^/]+\/src\/(?:components\/)?)\/shells\//
|
|
347
|
+
|
|
348
|
+
/** `shells/` no longer exists; vendor mechanics are closed named branches. */
|
|
349
|
+
export const noShellTier = {
|
|
350
|
+
meta: {
|
|
351
|
+
type: "problem",
|
|
352
|
+
docs: { description: "The component vocabulary has no shell tier." },
|
|
353
|
+
schema: [],
|
|
354
|
+
messages: {
|
|
355
|
+
shell:
|
|
356
|
+
"`shells/` is an untyped branch exemption. Move the owner to a named branch, replace children with typed contract content, and keep vendor mechanics closed there.",
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
create(context) {
|
|
360
|
+
if (!SHELL_TIER.test(normalizePath(context.filename || context.getFilename()))) return {}
|
|
361
|
+
return { Program(node) { context.report({ node, messageId: "shell" }) } }
|
|
362
|
+
},
|
|
363
|
+
}
|
|
364
|
+
|
|
346
365
|
export const rules = {
|
|
366
|
+
"no-shell-tier": noShellTier,
|
|
347
367
|
"source-tier-marker-matches-folder": sourceTierMarkerMatchesFolder,
|
|
348
368
|
"surface-folder-two-files-only": surfaceFolderTwoFilesOnly,
|
|
349
369
|
"route-tree-holds-routes-only": routeTreeHoldsRoutesOnly,
|
package/package.json
CHANGED