@eventcatalog/core 4.10.13 → 4.10.15

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.
Files changed (164) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-SSSN5FXC.js → chunk-7LWOCX4R.js} +1 -1
  6. package/dist/{chunk-IIECZFXN.js → chunk-A4JRWRCV.js} +1 -1
  7. package/dist/{chunk-JHUICVBT.js → chunk-HBVTU6ZP.js} +1 -1
  8. package/dist/{chunk-PADMH2RJ.js → chunk-I6HUOX4R.js} +1 -1
  9. package/dist/{chunk-34RMFKFB.js → chunk-Q2ATWE7N.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/docs/api/02-config.md +60 -6
  13. package/dist/docs/development/ask-your-architecture/02-eventcatalog-assistant/02-configuration.md +18 -11
  14. package/dist/docs/development/authentication/providers/03-setting-up-github.md +29 -0
  15. package/dist/docs/development/bring-your-own-documentation/custom-pages/02-adding-custom-docs.md +2 -2
  16. package/dist/docs/development/bring-your-own-documentation/custom-pages/03-components.md +17 -0
  17. package/dist/docs/development/components/07-resource-references.md +7 -1
  18. package/dist/docs/development/components/components/05-architecture-graph.md +65 -0
  19. package/dist/docs/development/components/components/{05-attachments.md → 06-attachments.md} +1 -1
  20. package/dist/docs/development/components/components/{06-channel-information.md → 07-channel-information.md} +1 -1
  21. package/dist/docs/development/components/components/{07-custom-properties.md → 08-custom-properties.md} +1 -1
  22. package/dist/docs/development/components/components/{08-design.md → 09-design.md} +1 -1
  23. package/dist/docs/development/components/components/{09-entitymap.md → 10-entitymap.md} +1 -1
  24. package/dist/docs/development/components/components/{10-flow.md → 11-flow.md} +1 -1
  25. package/dist/docs/development/components/components/{11-link.md → 12-link.md} +1 -1
  26. package/dist/docs/development/components/components/{12-mermaid-file-loader.md → 13-mermaid-file-loader.md} +13 -1
  27. package/dist/docs/development/components/components/{13-message-table.md → 14-message-table.md} +1 -1
  28. package/dist/docs/development/components/components/{14-nodegraph.md → 15-nodegraph.md} +1 -1
  29. package/dist/docs/development/components/components/{15-openapi.md → 16-openapi.md} +1 -1
  30. package/dist/docs/development/components/components/{16-prompt.md → 17-prompt.md} +1 -1
  31. package/dist/docs/development/components/components/{17-remote-schema.md → 18-remote-schema.md} +1 -1
  32. package/dist/docs/development/components/components/{18-resource-group-table.md → 19-resource-group-table.md} +1 -1
  33. package/dist/docs/development/components/components/{19-resource-link.md → 20-resource-link.md} +1 -1
  34. package/dist/docs/development/components/components/{20-schema.md → 21-schema.md} +1 -1
  35. package/dist/docs/development/components/components/{21-schema-viewer.md → 22-schema-viewer.md} +1 -1
  36. package/dist/docs/development/components/components/{22-steps.md → 23-steps.md} +1 -1
  37. package/dist/docs/development/components/components/{23-tabs.md → 24-tabs.md} +1 -1
  38. package/dist/docs/development/components/components/{24-tiles.md → 25-tiles.md} +1 -1
  39. package/dist/docs/development/components/components/{25-visibility.md → 26-visibility.md} +1 -1
  40. package/dist/docs/development/components/diagram-syntax/06-mermaid.md +45 -6
  41. package/dist/docs/development/customization/04-documentation-sidebar.md +3 -3
  42. package/dist/docs/development/customization/05-resource-sidebar.md +235 -0
  43. package/dist/docs/development/customization/09-embed-eventcatalog.md +179 -0
  44. package/dist/docs/development/customization/_category_.json +1 -1
  45. package/dist/docs/development/deployment/build-and-deploy.md +4 -0
  46. package/dist/docs/development/deployment/hosting-options.md +1 -1
  47. package/dist/docs/development/deployment/link-validation.md +105 -0
  48. package/dist/docs/development/developer-tools/eventcatalog-linter/00-overview.md +76 -0
  49. package/dist/docs/development/developer-tools/eventcatalog-linter/01-setup.md +144 -0
  50. package/dist/docs/development/developer-tools/eventcatalog-linter/_category_.json +10 -0
  51. package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/01-configure-rules.md +130 -0
  52. package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/02-run-in-ci.md +93 -0
  53. package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/03-use-custom-frontmatter.md +81 -0
  54. package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/04-reference-external-catalogs.md +51 -0
  55. package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/05-fix-common-problems.md +120 -0
  56. package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/_category_.json +12 -0
  57. package/dist/docs/development/developer-tools/eventcatalog-linter/reference/01-cli.md +109 -0
  58. package/dist/docs/development/developer-tools/eventcatalog-linter/reference/02-configuration.md +120 -0
  59. package/dist/docs/development/developer-tools/eventcatalog-linter/reference/03-rules.md +287 -0
  60. package/dist/docs/development/developer-tools/eventcatalog-linter/reference/04-versions.md +77 -0
  61. package/dist/docs/development/developer-tools/eventcatalog-linter/reference/05-supported-resources.md +75 -0
  62. package/dist/docs/development/developer-tools/eventcatalog-linter/reference/_category_.json +12 -0
  63. package/dist/docs/development/guides/97-architecture-graph.md +78 -0
  64. package/dist/docs/development/guides/domains/02-create-domain.md +1 -1
  65. package/dist/docs/development/guides/domains/03-ownership-and-language/02-adding-ubiquitous-language.md +29 -0
  66. package/dist/docs/development/guides/domains/09-reference.md +10 -0
  67. package/dist/docs/development/guides/resources/messages/04-message-channels/02-adding-channels.md +2 -2
  68. package/dist/docs/development/guides/resources/messages/04-message-channels/04-adding-messages-to-services.md +8 -0
  69. package/dist/docs/development/guides/resources/schemas/03-add-specifications-to-services/01-add-openapi-specifications.md +2 -2
  70. package/dist/docs/development/guides/resources/schemas/03-add-specifications-to-services/02-add-asyncapi-specifications.md +3 -3
  71. package/dist/docs/development/guides/systems/05-system-context-maps.md +2 -0
  72. package/dist/docs/development/license-keys/license-validation.md +7 -3
  73. package/dist/docs/development/license-keys/overview.md +7 -3
  74. package/dist/docs/development/upgrading/upgrading.md +3 -3
  75. package/dist/docs/development/upgrading/v2.md +3 -3
  76. package/dist/docs/federation/00-overview.md +158 -0
  77. package/dist/docs/federation/01-first-federation.md +199 -0
  78. package/dist/docs/federation/_category_.json +12 -0
  79. package/dist/docs/federation/explanation/_category_.json +12 -0
  80. package/dist/docs/federation/explanation/how-it-works.md +129 -0
  81. package/dist/docs/federation/explanation/lockfile-and-cache.md +134 -0
  82. package/dist/docs/federation/explanation/mvp-status-and-feedback.md +86 -0
  83. package/dist/docs/federation/explanation/ownership-and-references.md +134 -0
  84. package/dist/docs/federation/how-to/_category_.json +12 -0
  85. package/dist/docs/federation/how-to/configure-github-sources.md +156 -0
  86. package/dist/docs/federation/how-to/configure-validation-rules.md +127 -0
  87. package/dist/docs/federation/how-to/run-in-ci.md +138 -0
  88. package/dist/docs/federation/how-to/share-assets-and-components.md +125 -0
  89. package/dist/docs/federation/how-to/use-local-sources.md +138 -0
  90. package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/00-introduction.md +11 -2
  91. package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/01-installation.md +11 -3
  92. package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/02-plugin-configuration.md +11 -2
  93. package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/03-examples.md +11 -1
  94. package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/04-configuration.md +11 -1
  95. package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/05-setup-team-catalog.md +11 -2
  96. package/dist/docs/federation/legacy-federation/_category_.json +12 -0
  97. package/dist/docs/federation/reference/_category_.json +12 -0
  98. package/dist/docs/federation/reference/cli.md +122 -0
  99. package/dist/docs/federation/reference/configuration.md +192 -0
  100. package/dist/docs/federation/reference/diagnostic-rules.md +173 -0
  101. package/dist/docs/federation/reference/generated-output.md +118 -0
  102. package/dist/docs/federation/reference/supported-content.md +86 -0
  103. package/dist/docs/federation/reference/troubleshooting.md +208 -0
  104. package/dist/docs/plugins/01-intro.md +3 -3
  105. package/dist/docs/plugins/03-all-plugins.md +2 -2
  106. package/dist/docs/plugins/asyncapi/00-intro.md +4 -4
  107. package/dist/docs/plugins/asyncapi/02-plugin-configuration.md +4 -4
  108. package/dist/docs/plugins/backstage/00-overview.md +53 -0
  109. package/dist/docs/plugins/backstage/01-get-started.md +95 -0
  110. package/dist/docs/plugins/backstage/02-embed-entity-tabs.md +109 -0
  111. package/dist/docs/plugins/backstage/03-add-overview-cards.md +79 -0
  112. package/dist/docs/plugins/backstage/04-control-theme-and-size.md +54 -0
  113. package/dist/docs/plugins/backstage/05-migrate-to-annotations.md +49 -0
  114. package/dist/docs/plugins/backstage/06-configuration.md +85 -0
  115. package/dist/docs/plugins/backstage/07-components.md +129 -0
  116. package/dist/docs/plugins/backstage/08-how-embeds-work.md +52 -0
  117. package/dist/docs/plugins/backstage/_category_.json +4 -3
  118. package/dist/docs/plugins/eventbridge/00-intro.md +5 -5
  119. package/dist/docs/plugins/eventbridge/03-api.md +3 -3
  120. package/dist/docs/plugins/graphql/00-intro.md +2 -2
  121. package/dist/docs/plugins/graphql/02-plugin-configuration.md +2 -2
  122. package/dist/docs/plugins/hookdeck/01-intro.md +1 -1
  123. package/dist/docs/plugins/openapi/00-intro.md +1 -1
  124. package/dist/eventcatalog.cjs +1 -1
  125. package/dist/eventcatalog.js +5 -5
  126. package/dist/generate.cjs +1 -1
  127. package/dist/generate.js +3 -3
  128. package/dist/utils/cli-logger.cjs +1 -1
  129. package/dist/utils/cli-logger.js +2 -2
  130. package/eventcatalog/src/components/SchemaExplorer/AvroSchemaViewer.tsx +21 -19
  131. package/eventcatalog/src/components/SchemaExplorer/JSONSchemaViewer.test.tsx +114 -0
  132. package/eventcatalog/src/components/SchemaExplorer/JSONSchemaViewer.tsx +107 -86
  133. package/eventcatalog/src/components/SchemaExplorer/ProtobufSchemaViewer.test.tsx +91 -0
  134. package/eventcatalog/src/components/SchemaExplorer/ProtobufSchemaViewer.tsx +115 -33
  135. package/eventcatalog/src/components/SchemaExplorer/SchemaViewerHover.test.tsx +33 -0
  136. package/eventcatalog/src/components/SchemaExplorer/protobuf-validation.test.ts +84 -0
  137. package/eventcatalog/src/components/SchemaExplorer/protobuf-validation.ts +149 -0
  138. package/eventcatalog/src/utils/collections/glob-loader.ts +2 -2
  139. package/eventcatalog/src/utils/protobuf-schema.ts +211 -16
  140. package/package.json +8 -8
  141. package/dist/docs/cli/channels.md +0 -180
  142. package/dist/docs/cli/commands.md +0 -183
  143. package/dist/docs/cli/custom-docs.md +0 -78
  144. package/dist/docs/cli/data-products.md +0 -177
  145. package/dist/docs/cli/data-stores.md +0 -166
  146. package/dist/docs/cli/diagrams.md +0 -147
  147. package/dist/docs/cli/domains.md +0 -280
  148. package/dist/docs/cli/entities.md +0 -138
  149. package/dist/docs/cli/events.md +0 -186
  150. package/dist/docs/cli/export.md +0 -27
  151. package/dist/docs/cli/governance.md +0 -24
  152. package/dist/docs/cli/messages.md +0 -69
  153. package/dist/docs/cli/queries.md +0 -183
  154. package/dist/docs/cli/services.md +0 -266
  155. package/dist/docs/cli/snapshots.md +0 -44
  156. package/dist/docs/cli/teams.md +0 -75
  157. package/dist/docs/cli/users.md +0 -75
  158. package/dist/docs/cli/utilities.md +0 -43
  159. package/dist/docs/development/developer-tools/eventcatalog-linter.md +0 -732
  160. package/dist/docs/plugins/backstage/00-intro.md +0 -67
  161. package/dist/docs/plugins/backstage/01-installation.md +0 -242
  162. package/dist/docs/plugins/backstage/02-api.md +0 -51
  163. package/dist/docs/plugins/backstage/03-examples.md +0 -12
  164. package/dist/docs/plugins/eventcatalog-federation/_category_.json +0 -11
@@ -0,0 +1,120 @@
1
+ ---
2
+ sidebar_position: 5
3
+ sidebar_label: Fix common problems
4
+ title: Fix common linter findings
5
+ description: What the most frequent linter messages mean and the quickest way to resolve each one.
6
+ ---
7
+
8
+ Use this guide as a lookup table when the linter reports something and you want the fix, not the theory. Findings are grouped by rule; every rule is documented in full in the [rules reference](../reference/rules).
9
+
10
+ ## "Unknown property … Did you mean …?"
11
+
12
+ ```
13
+ 6:1 ✖ error Unknown property "owner". Did you mean "owners"? [owner] (schema/unknown-field)
14
+ ```
15
+
16
+ A frontmatter key isn't part of the schema — almost always a typo. Rename it to the suggestion. If it's a deliberate custom field, prefix it with `x-` (see [Allow custom frontmatter](./use-custom-frontmatter)).
17
+
18
+ If the message says the key "is valid on service resources, but not on event resources", you've copied frontmatter from one resource type to another; remove the key or use the equivalent for that type (for example events use `producers`/`consumers`, services use `sends`/`receives`).
19
+
20
+ ## "… is not recognised as an EventCatalog resource and will be ignored"
21
+
22
+ ```
23
+ 1:1 ⚠ warning File "events/OrderCreated.mdx" is not recognised … Did you mean "events/OrderCreated/index.mdx"? (structure/unrecognised-file)
24
+ ```
25
+
26
+ The file is in a place EventCatalog never reads. Move it to the suggested path. The common shapes:
27
+
28
+ | You have | You need |
29
+ |----------|----------|
30
+ | `events/OrderCreated.mdx` | `events/OrderCreated/index.mdx` |
31
+ | `event/…`, `Services/…`, `comands/…` | `events/…`, `services/…`, `commands/…` |
32
+ | `users/john/index.mdx` | `users/john.mdx` (users and teams are flat files) |
33
+ | `events/OrderCreated/versioned/index.mdx` | `events/OrderCreated/versioned/1.0.0/index.mdx` |
34
+ | `services/order-service/notes.mdx` | `services/order-service/docs/notes.mdx` (only `index.mdx` is a resource) |
35
+
36
+ See [Supported resources](../reference/supported-resources) for every folder the linter scans.
37
+
38
+ ## "Referenced … does not exist"
39
+
40
+ ```
41
+ 9:5 ✖ error Referenced event/command/query "OrderCreatd" does not exist. Did you mean "OrderCreated"? [sends[0]] (refs/resource-exists)
42
+ ```
43
+
44
+ The id doesn't match any resource of the expected type. Check for:
45
+
46
+ - **A typo** — the message suggests the closest id.
47
+ - **The wrong type** — "`payment-service` exists as a service, not a event/command/query" means the id is real but you referenced it from a field that expects a different type.
48
+ - **A resource from another catalog** — declare it in `dependencies` (see [Reference external catalogs](./reference-external-catalogs)).
49
+ - **A resource the linter can't see** — it may be misplaced (look for an accompanying `structure/unrecognised-file` warning) or matched by an `ignorePatterns` entry.
50
+
51
+ ## "… does not have a version matching …"
52
+
53
+ ```
54
+ 9:14 ✖ error Referenced event "OrderCreated" does not have a version matching "3.0.0". Available versions: 2.0.0, 1.0.0 [sends[0]] (refs/valid-version-range)
55
+ ```
56
+
57
+ The resource exists, but not at that version. Either pick one of the listed versions, use a range (`^2.0.0`, `2.x`) or `latest`, or add the missing version under `versioned/`. Version formats and matching are described in the [versions reference](../reference/versions).
58
+
59
+ If the message says the reference "has an invalid version reference", the value isn't a version, range or `latest` at all — for example `two` or `version-1`.
60
+
61
+ ## "Referenced schema file … does not exist"
62
+
63
+ ```
64
+ 7:13 ✖ error Referenced schema file "schema.json" does not exist (looked for "events/OrderCreated/schema.json") [schemaPath] (refs/file-exists)
65
+ ```
66
+
67
+ The path in `schemaPath`, `schemas[]`, `specifications` or a data product contract doesn't resolve to a file. Paths are relative to the resource's own folder — so a versioned copy under `versioned/1.0.0/` needs its own `schema.json` next to it. The "looked for" path shows exactly where the linter checked.
68
+
69
+ For `styles.icon`, paths starting with `/` are checked against the catalog's `public/` folder. If your static assets live elsewhere, set `['error', { publicDir: 'static' }]` or disable icon checks with `{ icons: false }`.
70
+
71
+ ## "version: Expected string, but received undefined"
72
+
73
+ ```
74
+ 2:1 ✖ error version: Expected string, but received undefined [version] (schema/valid-type)
75
+ ```
76
+
77
+ A required field is missing — here `version`. Add it. The same rule reports fields of the wrong type, such as `owners: platform-team` (a string) instead of a list.
78
+
79
+ ## "Invalid semantic version format"
80
+
81
+ ```
82
+ 4:10 ✖ error version: Invalid semantic version format [version] (schema/valid-semver)
83
+ ```
84
+
85
+ Use a format EventCatalog understands: semver (`1.2.3`, `1.0.0-beta`), a number-like version (`1`, `1.2`, `v1`, `V2`) or `latest`. Values like `one`, `1.0.0.0` or `version-1` are rejected.
86
+
87
+ ## "… has no producer and no consumer"
88
+
89
+ ```
90
+ 2:5 ⚠ warning event "OrderCreated" has no producer and no consumer [id] (refs/orphan-messages)
91
+ ```
92
+
93
+ Nothing sends or receives the message, so it won't appear in any visualiser. Add it to a service's `sends` or `receives`, list `producers`/`consumers` on the message itself, or — if it's intentionally standalone — set the rule to `'off'` for that folder using an override.
94
+
95
+ ## "At least one owner is required" / "Summary is required"
96
+
97
+ Add `owners:` (a list of user or team ids) or `summary:` to the resource. If a resource type genuinely shouldn't need these in your catalog, relax the rule for that folder:
98
+
99
+ ```js title=".eventcatalogrc.js"
100
+ module.exports = {
101
+ overrides: [{ files: ['**/containers/**'], rules: { 'best-practices/owner-required': 'off' } }],
102
+ };
103
+ ```
104
+
105
+ ## "Duplicate … also defined in …"
106
+
107
+ Two files declare the same type, `id` and `version`. Usually one is a leftover copy or a versioned file whose `version` wasn't updated — delete one or correct the version.
108
+
109
+ ## "Parse error: …"
110
+
111
+ ```
112
+ 5:14 ✖ error Parse error: unexpected end of the stream within a flow collection (@eventcatalog/parse-error)
113
+ ```
114
+
115
+ The frontmatter isn't valid YAML. The position points at the failing token; look for unbalanced brackets, a missing space after a colon, or inconsistent indentation.
116
+
117
+ ## Related
118
+
119
+ - [Rules reference](../reference/rules)
120
+ - [Configure rules](./configure-rules)
@@ -0,0 +1,12 @@
1
+ {
2
+ "label": "How-to guides",
3
+ "position": 3,
4
+ "collapsible": true,
5
+ "collapsed": true,
6
+ "link": {
7
+ "type": "generated-index",
8
+ "slug": "development/developer-tools/eventcatalog-linter/how-to",
9
+ "title": "Linter how-to guides",
10
+ "description": "Task-focused guides for configuring rules, running the linter in CI, and fixing what it reports."
11
+ }
12
+ }
@@ -0,0 +1,109 @@
1
+ ---
2
+ sidebar_position: 1
3
+ sidebar_label: CLI
4
+ title: Linter CLI reference
5
+ description: Command, options, exit codes, output format and environment behaviour of eventcatalog-linter.
6
+ ---
7
+
8
+ ## Usage
9
+
10
+ ```
11
+ eventcatalog-linter [options] [directory]
12
+ ```
13
+
14
+ | Argument | Description | Default |
15
+ |----------|-------------|---------|
16
+ | `directory` | The catalog to lint — the folder containing `eventcatalog.config.js` | `.` |
17
+
18
+ Run it with `npx @eventcatalog/linter`, or install `@eventcatalog/linter` and use the `eventcatalog-linter` binary.
19
+
20
+ ## Options
21
+
22
+ | Option | Description |
23
+ |--------|-------------|
24
+ | `-v, --verbose` | Show verbose output |
25
+ | `-q, --quiet` | Report errors only. Warnings are dropped from the output and from the counts |
26
+ | `--fail-on-warning` | Exit with code 1 when any warning is reported. Equivalent to `--max-warnings 0` |
27
+ | `--max-warnings <number>` | Exit with code 1 when more than `<number>` warnings are reported. Must be a non-negative integer |
28
+ | `--no-color` | Disable coloured output |
29
+ | `--init` | Write a commented `.eventcatalogrc.js` to the catalog directory and exit without linting. See [configuration](./configuration#scaffold-a-configuration-file) |
30
+ | `--force` | With `--init`, overwrite an existing `.eventcatalogrc.js` |
31
+ | `-V, --version` | Print the linter version |
32
+ | `-h, --help` | Print help |
33
+
34
+ ## Exit codes
35
+
36
+ | Code | Meaning |
37
+ |------|---------|
38
+ | `0` | No errors. Warnings may have been reported, provided they don't exceed `--max-warnings` |
39
+ | `1` | At least one error was reported, warnings exceeded `--max-warnings` / `--fail-on-warning` was set, an option was invalid, or the linter itself failed |
40
+
41
+ `--init` exits `0` after writing the file and `1` if the file already exists (without `--force`).
42
+
43
+ ## Output
44
+
45
+ Findings are grouped by file and sorted by position:
46
+
47
+ ```
48
+ services/order-service/index.mdx
49
+ 6:1 ✖ error Unknown property "owner". Did you mean "owners"? [owner] (schema/unknown-field)
50
+ 9:5 ✖ error Referenced event/command/query "OrderCreatd" does not exist. Did you mean "OrderCreated"? [sends[0]] (refs/resource-exists)
51
+ 14:1 ⚠ warning Resource should have a markdown description (body content) beyond just frontmatter [description] (best-practices/description-required)
52
+
53
+ ✖ 3 problems
54
+
55
+ ✖ 3 problems (2 errors, 1 warning) in 1 file
56
+ 178 files checked, 3 files ignored
57
+ ```
58
+
59
+ | Part | Meaning |
60
+ |------|---------|
61
+ | `6:1` | 1-based line and column of the finding. Keys are reported at the key; references at the value; missing fields at the nearest parent (line 2 for a missing top-level field); body-content findings at the first line after the frontmatter; YAML parse errors at the failing token |
62
+ | `✖ error` / `⚠ warning` | Severity after applying your configuration |
63
+ | `[owner]` | The frontmatter field path, including array indexes (`sends[0].to[1]`) |
64
+ | `(schema/unknown-field)` | The rule name. Parse failures use `(@eventcatalog/parse-error)` |
65
+ | `in 1 file` | Number of files with at least one finding |
66
+ | `178 files checked` | Number of files scanned and validated, after `ignorePatterns` |
67
+ | `3 files ignored` | Number of recognised files skipped by `ignorePatterns` (omitted when zero) |
68
+
69
+ When nothing is found:
70
+
71
+ ```
72
+ ✔ No problems found!
73
+ 178 files checked
74
+ ```
75
+
76
+ When the directory contains no recognisable catalog files, the linter prints `⚠ No EventCatalog files found` and exits `0`.
77
+
78
+ ## Progress output and terminals
79
+
80
+ A progress spinner is written to **stderr** while the linter runs. It is shown only when stderr is an interactive terminal, the `CI` environment variable is not set, and `TERM` is not `dumb`. In pipelines and when piping output, nothing is written to stderr, so logs contain only findings.
81
+
82
+ Colour follows [chalk](https://github.com/chalk/chalk) conventions: `--no-color`, `NO_COLOR=1` or `FORCE_COLOR=0` disable it; `FORCE_COLOR=1` enables it in non-TTY output.
83
+
84
+ ## Files the linter reads
85
+
86
+ | File | Purpose |
87
+ |------|---------|
88
+ | `.eventcatalogrc.js` | Rule configuration. Optional; see [configuration](./configuration) |
89
+ | `eventcatalog.config.js` | Read for `dependencies` so references to external resources resolve. Optional |
90
+ | Resource `index.md` / `index.mdx` files | See [supported resources](./supported-resources) |
91
+ | Files referenced from frontmatter | `schemaPath`, `schemas[]`, `specifications`, contracts and `public/` icons are checked for existence by [`refs/file-exists`](./rules#refsfile-exists) |
92
+
93
+ The linter never modifies your catalog.
94
+
95
+ ## Programmatic use
96
+
97
+ The package exports the pieces the CLI is built from — `scanCatalogFiles`, `parseAllFiles`, `validateCatalog`, `validateUnrecognisedFiles`, `attachLocations`, `loadConfig`, `applyRuleSeverity`, `reportErrors`, the rule registry (`RULES`) and version helpers — for use from your own scripts:
98
+
99
+ ```ts
100
+ import { scanCatalogFiles, parseAllFiles, validateCatalog, loadConfig } from '@eventcatalog/linter';
101
+
102
+ const rootDir = process.cwd();
103
+ const config = loadConfig(rootDir);
104
+ const files = await scanCatalogFiles(rootDir);
105
+ const { parsed } = await parseAllFiles(files);
106
+ const findings = validateCatalog(parsed, undefined, config);
107
+ ```
108
+
109
+ The public API is not yet frozen; expect it to be consolidated into a single `lint()` entry point in a future release.
@@ -0,0 +1,120 @@
1
+ ---
2
+ sidebar_position: 2
3
+ sidebar_label: Configuration
4
+ title: Linter configuration reference
5
+ description: The shape of .eventcatalogrc.js — rules, options, ignore patterns, overrides — and how it merges with the defaults.
6
+ ---
7
+
8
+ The linter looks for `.eventcatalogrc.js` in the directory it lints. The file is optional; without it every rule runs at its default severity.
9
+
10
+ ## Scaffold a configuration file
11
+
12
+ ```bash
13
+ npx @eventcatalog/linter --init # writes .eventcatalogrc.js
14
+ npx @eventcatalog/linter --init --force # overwrites an existing one
15
+ ```
16
+
17
+ The generated file lists every rule grouped by category, with a description, its default severity and an example of its options. It uses `export default` when the catalog's `package.json` has `"type": "module"` and `module.exports` otherwise.
18
+
19
+ ## Shape
20
+
21
+ ```js title=".eventcatalogrc.js"
22
+ module.exports = {
23
+ rules: {
24
+ '<rule-name>': '<severity>',
25
+ '<rule-name>': ['<severity>', { /* options */ }],
26
+ },
27
+ ignorePatterns: ['<glob>', '<glob>'],
28
+ overrides: [
29
+ {
30
+ files: ['<glob>', '<glob>'],
31
+ rules: {
32
+ '<rule-name>': '<severity>',
33
+ '<rule-name>': ['<severity>', { /* options */ }],
34
+ },
35
+ },
36
+ ],
37
+ };
38
+ ```
39
+
40
+ Every top-level key is optional.
41
+
42
+ ### `rules`
43
+
44
+ An object keyed by rule name. Rule names are listed in the [rules reference](./rules).
45
+
46
+ | Value | Effect |
47
+ |-------|--------|
48
+ | `'error'` | Report and fail the run |
49
+ | `'warn'` | Report; fail only with `--fail-on-warning` / `--max-warnings` |
50
+ | `'off'` | Don't check |
51
+ | `[severity, options]` | As above, with rule-specific options. See each rule for its options |
52
+
53
+ Unknown rule names are ignored silently.
54
+
55
+ ### `ignorePatterns`
56
+
57
+ Glob patterns, matched against each file's path relative to the catalog root (forward slashes). Matching files are not validated, not counted, and not reported by `structure/unrecognised-file`.
58
+
59
+ `dependencies/**` is always ignored in addition to what you list.
60
+
61
+ Supported syntax is deliberately simple: `*` matches within a path segment and `**` matches across segments. A pattern beginning with `**/` needs at least one leading folder to match, so prefer `drafts/**` to `**/drafts/**` for a top-level folder.
62
+
63
+ ### `overrides`
64
+
65
+ An ordered list. Each entry has `files` (glob patterns, same syntax as `ignorePatterns`) and `rules` (same shape as the top-level `rules`). For a given file, the top-level rules are applied first, then every override whose `files` matches, in order — later entries win.
66
+
67
+ ## Merging with the defaults
68
+
69
+ At load time the linter merges your file over the built-in defaults:
70
+
71
+ - `rules` — your entries override the default severity for that rule; rules you don't mention keep their default.
72
+ - `ignorePatterns` — your patterns are appended to the default `['dependencies/**']`.
73
+ - `overrides` — used as given (the default is an empty list).
74
+
75
+ If the file exists but can't be loaded (syntax error, wrong module format), the linter prints a warning and continues with the defaults.
76
+
77
+ ## Module format
78
+
79
+ `.eventcatalogrc.js` is loaded with Node's `require`. Use `module.exports` in a CommonJS project. In a project with `"type": "module"`, use `export default`; this is supported on Node.js 20.19 / 22.12 and later, where `require` can load ES modules. `--init` picks the right form automatically.
80
+
81
+ ## `eventcatalog.config.js`
82
+
83
+ The linter also reads your catalog's `eventcatalog.config.js`, but only for `dependencies`, so that references to resources documented in other catalogs resolve. See [Reference external catalogs](../how-to/reference-external-catalogs). Nothing else in that file affects linting.
84
+
85
+ ## Full example
86
+
87
+ ```js title=".eventcatalogrc.js"
88
+ module.exports = {
89
+ rules: {
90
+ // Findings that mean EventCatalog will fail or silently drop something
91
+ 'schema/unknown-field': ['error', { allow: ['legacy*'] }],
92
+ 'refs/resource-exists': 'error',
93
+ 'refs/file-exists': ['error', { publicDir: 'static' }],
94
+ 'structure/unrecognised-file': 'error',
95
+
96
+ // Documentation quality
97
+ 'best-practices/description-required': 'warn',
98
+ 'best-practices/schema-required': 'warn',
99
+ 'refs/orphan-messages': 'warn',
100
+ },
101
+
102
+ ignorePatterns: ['drafts/**'],
103
+
104
+ overrides: [
105
+ {
106
+ files: ['domains/Legacy/**'],
107
+ rules: {
108
+ 'best-practices/owner-required': 'warn',
109
+ 'best-practices/summary-required': 'off',
110
+ },
111
+ },
112
+ {
113
+ files: ['**/containers/**'],
114
+ rules: {
115
+ 'best-practices/description-required': 'off',
116
+ },
117
+ },
118
+ ],
119
+ };
120
+ ```
@@ -0,0 +1,287 @@
1
+ ---
2
+ sidebar_position: 3
3
+ sidebar_label: Rules
4
+ title: Linter rules reference
5
+ description: Every rule the EventCatalog Linter can report — what it checks, its default severity, its options, an example message and how to fix it.
6
+ ---
7
+
8
+ import AddedIn from '@site/src/components/MDX/AddedIn';
9
+
10
+ Rules are grouped into five categories. Each rule can be set to `'error'`, `'warn'` or `'off'` in [`.eventcatalogrc.js`](./configuration); rules marked **options** also accept `[severity, { ... }]`.
11
+
12
+ | Rule | Default | Options |
13
+ |------|---------|---------|
14
+ | [`schema/required-fields`](#schemarequired-fields) | error | |
15
+ | [`schema/valid-type`](#schemavalid-type) | error | |
16
+ | [`schema/valid-semver`](#schemavalid-semver) | error | |
17
+ | [`schema/valid-email`](#schemavalid-email) | error | |
18
+ | [`schema/validation-error`](#schemavalidation-error) | error | |
19
+ | [`schema/unknown-field`](#schemaunknown-field) | error | `allow`, `suggestions` |
20
+ | [`schema/unknown-nested-field`](#schemaunknown-nested-field) | warn | `allow`, `suggestions` |
21
+ | [`refs/owner-exists`](#refsowner-exists) | error | |
22
+ | [`refs/resource-exists`](#refsresource-exists) | error | |
23
+ | [`refs/valid-version-range`](#refsvalid-version-range) | error | |
24
+ | [`refs/channel-exists`](#refschannel-exists) | error | |
25
+ | [`refs/container-exists`](#refscontainer-exists) | error | |
26
+ | [`refs/file-exists`](#refsfile-exists) | error | `icons`, `publicDir` |
27
+ | [`refs/orphan-messages`](#refsorphan-messages) | warn | |
28
+ | [`best-practices/summary-required`](#best-practicessummary-required) | error | |
29
+ | [`best-practices/owner-required`](#best-practicesowner-required) | error | |
30
+ | [`best-practices/description-required`](#best-practicesdescription-required) | warn | |
31
+ | [`best-practices/schema-required`](#best-practicesschema-required) | warn | |
32
+ | [`versions/no-deprecated-references`](#versionsno-deprecated-references) | warn | |
33
+ | [`structure/duplicate-resource-ids`](#structureduplicate-resource-ids) | error | |
34
+ | [`structure/unrecognised-file`](#structureunrecognised-file) | warn | |
35
+
36
+ YAML that cannot be parsed at all is reported as `(@eventcatalog/parse-error)`. It is always an error and cannot be configured.
37
+
38
+ ## Schema validation
39
+
40
+ These rules validate frontmatter against the same schemas EventCatalog uses.
41
+
42
+ ### `schema/required-fields`
43
+
44
+ A required field is missing from the frontmatter. Which fields are required depends on the resource type; `id`, `name` and `version` are required almost everywhere.
45
+
46
+ ```
47
+ 2:1 ✖ error name: Required [name] (schema/required-fields)
48
+ ```
49
+
50
+ **Fix:** add the field.
51
+
52
+ ### `schema/valid-type`
53
+
54
+ A field has the wrong type — a string where a list is expected, a missing required field reported as `undefined`, and so on.
55
+
56
+ ```
57
+ 2:1 ✖ error version: Expected string, but received undefined [version] (schema/valid-type)
58
+ 7:9 ✖ error owners: Expected array, but received string [owners] (schema/valid-type)
59
+ ```
60
+
61
+ **Fix:** correct the value's shape. Lists in YAML are written with `- ` items or `[a, b]`.
62
+
63
+ ### `schema/valid-semver`
64
+
65
+ A `version` (or a version inside a reference) isn't a format EventCatalog understands.
66
+
67
+ ```
68
+ 4:10 ✖ error version: Invalid semantic version format [version] (schema/valid-semver)
69
+ ```
70
+
71
+ **Fix:** use semver (`1.2.3`, `1.0.0-beta`), a number-like version (`1`, `1.2`, `v1`, `V2`), `latest`, or a range (`^1.0.0`, `1.x`). See the [versions reference](./versions).
72
+
73
+ ### `schema/valid-email`
74
+
75
+ An `email` field on a user or team isn't a valid email address.
76
+
77
+ **Fix:** correct the address.
78
+
79
+ ### `schema/validation-error`
80
+
81
+ A schema problem that doesn't fit the categories above. The message carries the underlying detail.
82
+
83
+ ### `schema/unknown-field`
84
+
85
+ <AddedIn version="1.1.17" pkg="@eventcatalog/linter" url="https://github.com/event-catalog/eventcatalog" />
86
+
87
+ A top-level frontmatter key isn't part of the resource's schema. EventCatalog rejects unknown top-level keys at build time unless they start with `x-`, so this rule catches typos and stray custom fields before the build does. The message suggests the closest known key, or tells you when the key belongs to a different resource type.
88
+
89
+ ```
90
+ 6:1 ✖ error Unknown property "owner". Did you mean "owners"? [owner] (schema/unknown-field)
91
+ 8:1 ✖ error Unknown property "costCenter". Custom properties must start with "x-". [costCenter] (schema/unknown-field)
92
+ 5:1 ✖ error Unknown property "sends". "sends" is valid on service, agent, domain resources, but not on event resources. [sends] (schema/unknown-field)
93
+ ```
94
+
95
+ **Options**
96
+
97
+ | Option | Type | Default | Description |
98
+ |--------|------|---------|-------------|
99
+ | `allow` | `string[]` | `[]` | Keys, or `prefix*` patterns, to accept. Matched against the key name and the full path |
100
+ | `suggestions` | `boolean` | `true` | Include "Did you mean" and other-resource-type hints |
101
+
102
+ ```js
103
+ 'schema/unknown-field': ['error', { allow: ['costCenter', 'legacy*'], suggestions: true }]
104
+ ```
105
+
106
+ Keys starting with `x-` are always allowed, as are the `catalog`, `versions` and `latestVersion` fields the SDK writes into generated content.
107
+
108
+ **Fix:** rename the key, or prefix it with `x-`. See [Allow custom frontmatter](../how-to/use-custom-frontmatter).
109
+
110
+ ### `schema/unknown-nested-field`
111
+
112
+ <AddedIn version="1.1.17" pkg="@eventcatalog/linter" url="https://github.com/event-catalog/eventcatalog" />
113
+
114
+ The same check for keys inside nested objects and arrays (`sends[0].too`, `detailsPanel.ownerz`). EventCatalog silently ignores these rather than failing, which is why the default is `warn` — but a typo here usually means a relationship or setting is being dropped. Options are the same as `schema/unknown-field`, and an `allow` list set on either rule applies to both.
115
+
116
+ ```
117
+ 12:9 ⚠ warning Unknown property "sends[0].too". Did you mean "to"? [sends[0].too] (schema/unknown-nested-field)
118
+ ```
119
+
120
+ Arbitrary keys are permitted where the schema allows them — flow step `custom.properties`, channel `parameters`, and any `producers`/`consumers` object.
121
+
122
+ ## Reference validation
123
+
124
+ These rules check that everything your frontmatter points at actually exists. References can be plain ids (`- order-service`) or objects (`- id: order-service`, optionally with `version`). Version matching follows the [versions reference](./versions).
125
+
126
+ ### `refs/owner-exists`
127
+
128
+ An entry in `owners` (or an ADR's `decisionMakers`) doesn't match any user or team.
129
+
130
+ ```
131
+ 6:5 ✖ error Referenced user/team "platfrom-team" does not exist. Did you mean "platform-team"? [owners[0]] (refs/owner-exists)
132
+ ```
133
+
134
+ **Fix:** correct the id, or add the user (`users/<id>.mdx`) or team (`teams/<id>.mdx`).
135
+
136
+ ### `refs/resource-exists`
137
+
138
+ A referenced resource id doesn't exist among the resource types the field accepts — `sends`/`receives` (events, commands, queries), `services`, `domains`, `entities`, `flows`, flow steps, ADR `appliesTo`, data product `inputs`/`outputs`, and so on. The message adds a "did you mean" suggestion for near-miss ids, or points out when the id exists as a different resource type.
139
+
140
+ ```
141
+ 9:5 ✖ error Referenced event/command/query "OrderCreatd" does not exist. Did you mean "OrderCreated"? [sends[0]] (refs/resource-exists)
142
+ 9:5 ✖ error Referenced flow "PlaceOrder" does not exist. "PlaceOrder" exists as a command, not a flow. [appliesTo[0]] (refs/resource-exists)
143
+ ```
144
+
145
+ This rule fires whether or not the reference has a version — if the id itself is unknown, the version is irrelevant.
146
+
147
+ **Fix:** correct the id, create the resource, or declare it as an external [dependency](../how-to/reference-external-catalogs).
148
+
149
+ ### `refs/valid-version-range`
150
+
151
+ The referenced resource exists, but no version of it satisfies the reference. The message lists the versions that do exist, newest first. It also fires when the version reference isn't a version, range or `latest` at all.
152
+
153
+ ```
154
+ 9:14 ✖ error Referenced event "OrderCreated" does not have a version matching "3.0.0". Available versions: 2.0.0, 1.0.0 [sends[0]] (refs/valid-version-range)
155
+ 9:14 ✖ error Referenced event "OrderCreated" has an invalid version reference "two". Use a version (1.0.0, v1), a range (^1.0.0, 1.x) or "latest". Available versions: 1.0.0 [sends[0]] (refs/valid-version-range)
156
+ ```
157
+
158
+ **Fix:** reference an existing version or a range that matches one, or add the version under `versioned/`.
159
+
160
+ ### `refs/channel-exists`
161
+
162
+ A channel referenced from `sends[].to`, `receives[].from`, a message's `channels`, or a channel's `routes`/`channels` doesn't exist (or doesn't exist at that version).
163
+
164
+ ```
165
+ 11:9 ✖ error Referenced channel "orders-topic" does not exist. Did you mean "orders"? [sends[0].to[0]] (refs/channel-exists)
166
+ ```
167
+
168
+ ### `refs/container-exists`
169
+
170
+ A container referenced from `writesTo`, `readsFrom`, a system's `containers`, or a container-typed flow step doesn't exist. `dataStore` is accepted as a legacy alias for `container`.
171
+
172
+ ```
173
+ 13:5 ✖ error Referenced container "orders-db" does not have a version matching "9.0.0". Available versions: 1.0.0 [writesTo[0]] (refs/container-exists)
174
+ ```
175
+
176
+ ### `refs/file-exists`
177
+
178
+ <AddedIn version="1.1.17" pkg="@eventcatalog/linter" url="https://github.com/event-catalog/eventcatalog" />
179
+
180
+ A file referenced from frontmatter doesn't exist. The linter resolves each path the way EventCatalog does:
181
+
182
+ | Field | Resolved against |
183
+ |-------|------------------|
184
+ | `schemaPath` | the resource's own folder |
185
+ | `schemas[].file`, `schemas[].path` | the resource's own folder |
186
+ | `schemas[].ref` | `file://<relative>` against the resource folder; `file:///<absolute>` as given. Other refs (schema registries) are skipped |
187
+ | `specifications.openapiPath` / `asyncapiPath` / `graphqlPath`, `specifications[].path` | the resource's own folder; `http(s)://` values are skipped |
188
+ | data product `outputs[].contract.path` | the resource's own folder |
189
+ | `styles.icon` starting with `/` | the catalog's `public/` folder; icon names and URLs are skipped |
190
+
191
+ Because paths resolve against the resource's own folder, a versioned copy under `versioned/1.0.0/` must have its own schema file next to it.
192
+
193
+ ```
194
+ 7:13 ✖ error Referenced schema file "schema.json" does not exist (looked for "events/OrderCreated/schema.json") [schemaPath] (refs/file-exists)
195
+ 15:9 ✖ error Referenced icon "/icons/go.svg" does not exist (looked for "public/icons/go.svg") [styles.icon] (refs/file-exists)
196
+ ```
197
+
198
+ **Options**
199
+
200
+ | Option | Type | Default | Description |
201
+ |--------|------|---------|-------------|
202
+ | `icons` | `boolean` | `true` | Check `styles.icon` paths |
203
+ | `publicDir` | `string` | `'public'` | Folder, relative to the catalog root, that `/`-prefixed icon paths are served from |
204
+
205
+ ```js
206
+ 'refs/file-exists': ['error', { icons: false, publicDir: 'static' }]
207
+ ```
208
+
209
+ ### `refs/orphan-messages`
210
+
211
+ An event, command or query that nothing produces or consumes: no service, agent or domain lists it in `sends`/`receives`, and the message itself has no `producers`/`consumers`. Messages declared as external dependencies are never orphans.
212
+
213
+ ```
214
+ 2:5 ⚠ warning event "OrderCreated" has no producer and no consumer [id] (refs/orphan-messages)
215
+ ```
216
+
217
+ **Fix:** connect the message to a service, or turn the rule off for intentionally standalone messages.
218
+
219
+ ## Best practices
220
+
221
+ Documentation-quality checks. They don't affect whether EventCatalog builds, so tune them to your team's standards.
222
+
223
+ ### `best-practices/summary-required`
224
+
225
+ The resource has no `summary`, or it's blank. Users are exempt (the user schema has no summary field).
226
+
227
+ ```
228
+ 2:1 ✖ error Summary is required for better documentation [summary] (best-practices/summary-required)
229
+ ```
230
+
231
+ ### `best-practices/owner-required`
232
+
233
+ The resource has no `owners`, or the list is empty. Users and teams are exempt.
234
+
235
+ ```
236
+ 2:1 ✖ error At least one owner is required [owners] (best-practices/owner-required)
237
+ ```
238
+
239
+ ### `best-practices/description-required`
240
+
241
+ The file has no markdown body after the frontmatter.
242
+
243
+ ```
244
+ 14:1 ⚠ warning Resource should have a markdown description (body content) beyond just frontmatter [description] (best-practices/description-required)
245
+ ```
246
+
247
+ ### `best-practices/schema-required`
248
+
249
+ An event, command or query has no `schemaPath`.
250
+
251
+ ```
252
+ 2:1 ⚠ warning event should have a schemaPath defined for consumers to understand the contract [schemaPath] (best-practices/schema-required)
253
+ ```
254
+
255
+ ## Versioning
256
+
257
+ ### `versions/no-deprecated-references`
258
+
259
+ A reference points at a resource marked `deprecated`. A reference without a version (or `latest`) is flagged if any version of the target is deprecated; a versioned reference is flagged only if that version is. Owner and team-member references are not checked.
260
+
261
+ ```
262
+ 9:5 ⚠ warning Referenced event "OrderCreated" (version: 1.0.0) is deprecated [sends[0]] (versions/no-deprecated-references)
263
+ ```
264
+
265
+ ## Catalog structure
266
+
267
+ ### `structure/duplicate-resource-ids`
268
+
269
+ Two files declare the same resource type, `id` and `version`.
270
+
271
+ ```
272
+ 2:5 ✖ error Duplicate event "OrderCreated" (version: 1.0.0) — also defined in domains/Orders/events/OrderCreated/index.mdx [id] (structure/duplicate-resource-ids)
273
+ ```
274
+
275
+ ### `structure/unrecognised-file`
276
+
277
+ <AddedIn version="1.1.17" pkg="@eventcatalog/linter" url="https://github.com/event-catalog/eventcatalog" />
278
+
279
+ A `.md`/`.mdx` file lives under a resource folder but matches none of the locations EventCatalog loads resources from, so it will be silently ignored. The message suggests where the file probably belongs. Markdown that EventCatalog loads through other means — `docs/` folders, `pages/`, `changelog.md`, `ubiquitous-language.md` — and build artifacts are not reported. Files matched by `ignorePatterns` are skipped.
280
+
281
+ ```
282
+ 1:1 ⚠ warning File "events/OrderCreated.mdx" is not recognised as an EventCatalog resource and will be ignored. Did you mean "events/OrderCreated/index.mdx"? (structure/unrecognised-file)
283
+ 1:1 ⚠ warning File "event/OrderCreated/index.mdx" is not recognised … Did you mean "events/OrderCreated/index.mdx"? (structure/unrecognised-file)
284
+ 1:1 ⚠ warning File "users/john/index.mdx" is not recognised … users are flat files. Did you mean "users/john.mdx"? (structure/unrecognised-file)
285
+ ```
286
+
287
+ Recognised locations are listed in [Supported resources](./supported-resources). Because a misplaced file means the catalog is missing content, consider promoting this rule to `'error'`.