@eventcatalog/core 4.10.12 → 4.10.14
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/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-7URQ754Q.js → chunk-HERAHLM2.js} +1 -1
- package/dist/{chunk-Y5XU3YLT.js → chunk-LITOQH56.js} +1 -1
- package/dist/{chunk-S4LLGOO4.js → chunk-LUW6RDA7.js} +1 -1
- package/dist/{chunk-VFSEVDCQ.js → chunk-ONDFEA5R.js} +1 -1
- package/dist/{chunk-A53VCEEA.js → chunk-V2SKOQYF.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/docs/api/02-config.md +55 -1
- package/dist/docs/development/authentication/providers/03-setting-up-github.md +29 -0
- package/dist/docs/development/bring-your-own-documentation/custom-pages/02-adding-custom-docs.md +2 -2
- package/dist/docs/development/bring-your-own-documentation/custom-pages/03-components.md +17 -0
- package/dist/docs/development/components/07-resource-references.md +7 -1
- package/dist/docs/development/components/components/05-architecture-graph.md +65 -0
- package/dist/docs/development/components/components/{05-attachments.md → 06-attachments.md} +1 -1
- package/dist/docs/development/components/components/{06-channel-information.md → 07-channel-information.md} +1 -1
- package/dist/docs/development/components/components/{07-custom-properties.md → 08-custom-properties.md} +1 -1
- package/dist/docs/development/components/components/{08-design.md → 09-design.md} +1 -1
- package/dist/docs/development/components/components/{09-entitymap.md → 10-entitymap.md} +1 -1
- package/dist/docs/development/components/components/{10-flow.md → 11-flow.md} +1 -1
- package/dist/docs/development/components/components/{11-link.md → 12-link.md} +1 -1
- package/dist/docs/development/components/components/{12-mermaid-file-loader.md → 13-mermaid-file-loader.md} +1 -1
- package/dist/docs/development/components/components/{13-message-table.md → 14-message-table.md} +1 -1
- package/dist/docs/development/components/components/{14-nodegraph.md → 15-nodegraph.md} +1 -1
- package/dist/docs/development/components/components/{15-openapi.md → 16-openapi.md} +1 -1
- package/dist/docs/development/components/components/{16-prompt.md → 17-prompt.md} +1 -1
- package/dist/docs/development/components/components/{17-remote-schema.md → 18-remote-schema.md} +1 -1
- package/dist/docs/development/components/components/{18-resource-group-table.md → 19-resource-group-table.md} +1 -1
- package/dist/docs/development/components/components/{19-resource-link.md → 20-resource-link.md} +1 -1
- package/dist/docs/development/components/components/{20-schema.md → 21-schema.md} +1 -1
- package/dist/docs/development/components/components/{21-schema-viewer.md → 22-schema-viewer.md} +1 -1
- package/dist/docs/development/components/components/{22-steps.md → 23-steps.md} +1 -1
- package/dist/docs/development/components/components/{23-tabs.md → 24-tabs.md} +1 -1
- package/dist/docs/development/components/components/{24-tiles.md → 25-tiles.md} +1 -1
- package/dist/docs/development/components/components/{25-visibility.md → 26-visibility.md} +1 -1
- package/dist/docs/development/customization/04-documentation-sidebar.md +3 -3
- package/dist/docs/development/customization/05-resource-sidebar.md +235 -0
- package/dist/docs/development/customization/09-embed-eventcatalog.md +179 -0
- package/dist/docs/development/customization/_category_.json +1 -1
- package/dist/docs/development/deployment/build-and-deploy.md +4 -0
- package/dist/docs/development/deployment/hosting-options.md +1 -1
- package/dist/docs/development/deployment/link-validation.md +105 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/00-overview.md +76 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/01-setup.md +144 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/_category_.json +10 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/01-configure-rules.md +130 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/02-run-in-ci.md +93 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/03-use-custom-frontmatter.md +81 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/04-reference-external-catalogs.md +51 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/05-fix-common-problems.md +120 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/_category_.json +12 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/reference/01-cli.md +109 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/reference/02-configuration.md +120 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/reference/03-rules.md +287 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/reference/04-versions.md +77 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/reference/05-supported-resources.md +75 -0
- package/dist/docs/development/developer-tools/eventcatalog-linter/reference/_category_.json +12 -0
- package/dist/docs/development/guides/97-architecture-graph.md +78 -0
- package/dist/docs/development/guides/domains/02-create-domain.md +1 -1
- package/dist/docs/development/guides/domains/03-ownership-and-language/02-adding-ubiquitous-language.md +29 -0
- package/dist/docs/development/guides/domains/09-reference.md +10 -0
- package/dist/docs/development/guides/resources/messages/04-message-channels/02-adding-channels.md +2 -2
- package/dist/docs/development/guides/resources/messages/04-message-channels/04-adding-messages-to-services.md +8 -0
- package/dist/docs/development/guides/resources/schemas/03-add-specifications-to-services/01-add-openapi-specifications.md +2 -2
- package/dist/docs/development/guides/resources/schemas/03-add-specifications-to-services/02-add-asyncapi-specifications.md +3 -3
- package/dist/docs/development/guides/systems/05-system-context-maps.md +2 -0
- package/dist/docs/development/license-keys/license-validation.md +7 -3
- package/dist/docs/development/license-keys/overview.md +7 -3
- package/dist/docs/development/upgrading/upgrading.md +3 -3
- package/dist/docs/development/upgrading/v2.md +3 -3
- package/dist/docs/federation/00-overview.md +158 -0
- package/dist/docs/federation/01-first-federation.md +199 -0
- package/dist/docs/federation/_category_.json +12 -0
- package/dist/docs/federation/explanation/_category_.json +12 -0
- package/dist/docs/federation/explanation/how-it-works.md +129 -0
- package/dist/docs/federation/explanation/lockfile-and-cache.md +134 -0
- package/dist/docs/federation/explanation/mvp-status-and-feedback.md +86 -0
- package/dist/docs/federation/explanation/ownership-and-references.md +134 -0
- package/dist/docs/federation/how-to/_category_.json +12 -0
- package/dist/docs/federation/how-to/configure-github-sources.md +156 -0
- package/dist/docs/federation/how-to/configure-validation-rules.md +127 -0
- package/dist/docs/federation/how-to/run-in-ci.md +138 -0
- package/dist/docs/federation/how-to/share-assets-and-components.md +125 -0
- package/dist/docs/federation/how-to/use-local-sources.md +138 -0
- package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/00-introduction.md +11 -2
- package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/01-installation.md +11 -3
- package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/02-plugin-configuration.md +11 -2
- package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/03-examples.md +11 -1
- package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/04-configuration.md +11 -1
- package/dist/docs/{plugins/eventcatalog-federation → federation/legacy-federation}/05-setup-team-catalog.md +11 -2
- package/dist/docs/federation/legacy-federation/_category_.json +12 -0
- package/dist/docs/federation/reference/_category_.json +12 -0
- package/dist/docs/federation/reference/cli.md +122 -0
- package/dist/docs/federation/reference/configuration.md +192 -0
- package/dist/docs/federation/reference/diagnostic-rules.md +173 -0
- package/dist/docs/federation/reference/generated-output.md +118 -0
- package/dist/docs/federation/reference/supported-content.md +86 -0
- package/dist/docs/federation/reference/troubleshooting.md +208 -0
- package/dist/docs/plugins/01-intro.md +3 -3
- package/dist/docs/plugins/03-all-plugins.md +2 -2
- package/dist/docs/plugins/asyncapi/00-intro.md +4 -4
- package/dist/docs/plugins/asyncapi/02-plugin-configuration.md +4 -4
- package/dist/docs/plugins/backstage/00-overview.md +53 -0
- package/dist/docs/plugins/backstage/01-get-started.md +95 -0
- package/dist/docs/plugins/backstage/02-embed-entity-tabs.md +109 -0
- package/dist/docs/plugins/backstage/03-add-overview-cards.md +79 -0
- package/dist/docs/plugins/backstage/04-control-theme-and-size.md +54 -0
- package/dist/docs/plugins/backstage/05-migrate-to-annotations.md +49 -0
- package/dist/docs/plugins/backstage/06-configuration.md +85 -0
- package/dist/docs/plugins/backstage/07-components.md +129 -0
- package/dist/docs/plugins/backstage/08-how-embeds-work.md +52 -0
- package/dist/docs/plugins/backstage/_category_.json +4 -3
- package/dist/docs/plugins/eventbridge/00-intro.md +5 -5
- package/dist/docs/plugins/eventbridge/03-api.md +3 -3
- package/dist/docs/plugins/graphql/00-intro.md +2 -2
- package/dist/docs/plugins/graphql/02-plugin-configuration.md +2 -2
- package/dist/docs/plugins/hookdeck/01-intro.md +1 -1
- package/dist/docs/plugins/openapi/00-intro.md +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +208 -119
- package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +28 -8
- package/eventcatalog/src/components/ChatPanel/OfflineReply.tsx +45 -0
- package/eventcatalog/src/components/Header.astro +11 -6
- package/eventcatalog/src/components/MDX/Design/Design.astro +2 -2
- package/eventcatalog/src/components/MDX/EntityMap/EntityMap.astro +2 -2
- package/eventcatalog/src/components/MDX/Flow/Flow.astro +2 -2
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +2 -2
- package/eventcatalog/src/components/SchemaExplorer/AvroSchemaViewer.tsx +21 -19
- package/eventcatalog/src/components/SchemaExplorer/JSONSchemaViewer.tsx +79 -77
- package/eventcatalog/src/components/SchemaExplorer/ProtobufSchemaViewer.test.tsx +91 -0
- package/eventcatalog/src/components/SchemaExplorer/ProtobufSchemaViewer.tsx +115 -33
- package/eventcatalog/src/components/SchemaExplorer/SchemaViewerHover.test.tsx +33 -0
- package/eventcatalog/src/components/SchemaExplorer/protobuf-validation.test.ts +84 -0
- package/eventcatalog/src/components/SchemaExplorer/protobuf-validation.ts +149 -0
- package/eventcatalog/src/components/Search/Search.astro +11 -4
- package/eventcatalog/src/components/Settings/AssistantSettingsForm.tsx +29 -24
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +3 -3
- package/eventcatalog/src/pages/diagrams/[id]/[version]/index.astro +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +5 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +10 -4
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +2 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +3 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/[filename].astro +2 -2
- package/eventcatalog/src/pages/visualiser/designs/[id]/index.astro +2 -2
- package/eventcatalog/src/utils/feature.ts +1 -0
- package/eventcatalog/src/utils/protobuf-schema.ts +211 -16
- package/package.json +3 -3
- package/dist/docs/cli/channels.md +0 -180
- package/dist/docs/cli/commands.md +0 -183
- package/dist/docs/cli/custom-docs.md +0 -78
- package/dist/docs/cli/data-products.md +0 -177
- package/dist/docs/cli/data-stores.md +0 -166
- package/dist/docs/cli/diagrams.md +0 -147
- package/dist/docs/cli/domains.md +0 -280
- package/dist/docs/cli/entities.md +0 -138
- package/dist/docs/cli/events.md +0 -186
- package/dist/docs/cli/export.md +0 -27
- package/dist/docs/cli/governance.md +0 -24
- package/dist/docs/cli/messages.md +0 -69
- package/dist/docs/cli/queries.md +0 -183
- package/dist/docs/cli/services.md +0 -266
- package/dist/docs/cli/snapshots.md +0 -44
- package/dist/docs/cli/teams.md +0 -75
- package/dist/docs/cli/users.md +0 -75
- package/dist/docs/cli/utilities.md +0 -43
- package/dist/docs/development/developer-tools/eventcatalog-linter.md +0 -732
- package/dist/docs/plugins/backstage/00-intro.md +0 -67
- package/dist/docs/plugins/backstage/01-installation.md +0 -242
- package/dist/docs/plugins/backstage/02-api.md +0 -51
- package/dist/docs/plugins/backstage/03-examples.md +0 -12
- package/dist/docs/plugins/eventcatalog-federation/_category_.json +0 -11
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
sidebar_label: Setup linter
|
|
4
|
+
title: Set up the linter
|
|
5
|
+
description: Run the EventCatalog Linter for the first time, read its output, fix a problem, create a configuration file, and add the check to CI.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
This guide takes you from a fresh catalog to a linted, CI-checked one: run the linter, read what it reports, fix a problem, create a configuration file, and add a pull-request check. It takes about ten minutes.
|
|
9
|
+
|
|
10
|
+
## What you need
|
|
11
|
+
|
|
12
|
+
- An EventCatalog project. If you don't have one, `npx @eventcatalog/create-eventcatalog@latest my-catalog` creates one with example content.
|
|
13
|
+
- Node.js 18 or later.
|
|
14
|
+
|
|
15
|
+
## 1. Run the linter
|
|
16
|
+
|
|
17
|
+
From the root of your catalog (the folder containing `eventcatalog.config.js`):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @eventcatalog/linter
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
You don't need to install anything first. The linter scans your `domains/`, `services/`, `events/` and other resource folders, validates every file, and prints what it found:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
✔ No problems found!
|
|
27
|
+
178 files checked
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If your catalog is already clean, congratulations — skip to [step 4](#4-create-a-configuration-file) to see how to customise it. Otherwise, keep reading.
|
|
31
|
+
|
|
32
|
+
## 2. Read the output
|
|
33
|
+
|
|
34
|
+
Let's introduce a couple of mistakes on purpose so there is something to look at. Open any service — for example `services/order-service/index.mdx` — and change `owners:` to `owner:`, then misspell one of the events it sends:
|
|
35
|
+
|
|
36
|
+
```yaml title="services/order-service/index.mdx"
|
|
37
|
+
---
|
|
38
|
+
id: order-service
|
|
39
|
+
name: Order Service
|
|
40
|
+
version: 1.0.0
|
|
41
|
+
summary: Handles orders
|
|
42
|
+
owner:
|
|
43
|
+
- platform-team
|
|
44
|
+
sends:
|
|
45
|
+
- id: OrderCreatd
|
|
46
|
+
---
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Run the linter again:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
services/order-service/index.mdx
|
|
53
|
+
2:1 ✖ error At least one owner is required [owners] (best-practices/owner-required)
|
|
54
|
+
6:1 ✖ error Unknown property "owner". Did you mean "owners"? [owner] (schema/unknown-field)
|
|
55
|
+
9:5 ✖ error Referenced event/command/query "OrderCreatd" does not exist. Did you mean "OrderCreated"? [sends[0]] (refs/resource-exists)
|
|
56
|
+
|
|
57
|
+
✖ 3 problems (3 errors, 0 warnings) in 1 file
|
|
58
|
+
178 files checked
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Each line has the same shape:
|
|
62
|
+
|
|
63
|
+
| Part | Meaning |
|
|
64
|
+
|------|---------|
|
|
65
|
+
| `6:1` | Line and column in the file. Most terminals let you click `path:line:col`. |
|
|
66
|
+
| `✖ error` / `⚠ warning` | Severity. Errors fail the run; warnings don't unless you ask them to. |
|
|
67
|
+
| The message | What is wrong, and a suggestion when the linter can work one out. |
|
|
68
|
+
| `[owner]` | The frontmatter field the finding is about. |
|
|
69
|
+
| `(schema/unknown-field)` | The rule that produced it — look it up in the [rules reference](./reference/rules). |
|
|
70
|
+
|
|
71
|
+
Notice that one typo produced two findings: `owner` is unknown **and** `owners` is missing. That's expected — fixing the typo clears both.
|
|
72
|
+
|
|
73
|
+
## 3. Fix the problems
|
|
74
|
+
|
|
75
|
+
Change `owner` back to `owners` and `OrderCreatd` to `OrderCreated`, then re-run. You should be back to `✔ No problems found!`.
|
|
76
|
+
|
|
77
|
+
That loop — run, read, fix — is how you'll use the linter day to day. Because the message includes the line number and a suggestion, most fixes are a single edit. The [fix common problems](./how-to/fix-common-problems) guide covers the messages you're most likely to meet.
|
|
78
|
+
|
|
79
|
+
## 4. Create a configuration file
|
|
80
|
+
|
|
81
|
+
Defaults are sensible, but every team has its own standards. Let the linter write a starting point for you:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx @eventcatalog/linter --init
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
✔ Created .eventcatalogrc.js
|
|
89
|
+
178 catalog files found, CommonJS config written
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Open `.eventcatalogrc.js`. Every rule is listed with a one-line description and its default severity:
|
|
93
|
+
|
|
94
|
+
```js title=".eventcatalogrc.js"
|
|
95
|
+
module.exports = {
|
|
96
|
+
rules: {
|
|
97
|
+
// Best practices
|
|
98
|
+
// Resources have a summary
|
|
99
|
+
'best-practices/summary-required': 'error',
|
|
100
|
+
// Resources have at least one owner
|
|
101
|
+
'best-practices/owner-required': 'error',
|
|
102
|
+
// Resources have markdown body content beyond the frontmatter
|
|
103
|
+
'best-practices/description-required': 'warn',
|
|
104
|
+
// ...
|
|
105
|
+
},
|
|
106
|
+
ignorePatterns: [],
|
|
107
|
+
overrides: [],
|
|
108
|
+
};
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Try changing one rule. Perhaps your team doesn't want body content to be a warning yet:
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
'best-practices/description-required': 'off',
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Run the linter again and the warning is gone. The three values are `'error'`, `'warn'` and `'off'`; the [configure rules guide](./how-to/configure-rules) covers options, ignore patterns and per-folder overrides.
|
|
118
|
+
|
|
119
|
+
## 5. Add the check to your pipeline
|
|
120
|
+
|
|
121
|
+
The linter exits with code `1` when it finds errors, which is all a CI system needs. For GitHub Actions:
|
|
122
|
+
|
|
123
|
+
```yaml title=".github/workflows/lint-catalog.yml"
|
|
124
|
+
name: Lint catalog
|
|
125
|
+
on: [pull_request]
|
|
126
|
+
|
|
127
|
+
jobs:
|
|
128
|
+
lint:
|
|
129
|
+
runs-on: ubuntu-latest
|
|
130
|
+
steps:
|
|
131
|
+
- uses: actions/checkout@v4
|
|
132
|
+
- uses: actions/setup-node@v4
|
|
133
|
+
with:
|
|
134
|
+
node-version: 20
|
|
135
|
+
- run: npx @eventcatalog/linter --max-warnings 0
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`--max-warnings 0` makes warnings fail the build too. If you'd rather let warnings through, drop the flag. In CI the linter automatically keeps its progress spinner out of the logs, so you only see findings. See [Run in CI](./how-to/run-in-ci) for GitLab and other pipelines.
|
|
139
|
+
|
|
140
|
+
## Next steps
|
|
141
|
+
|
|
142
|
+
- [Configure rules](./how-to/configure-rules) for your team's standards, including per-folder overrides.
|
|
143
|
+
- [Reference resources from other catalogs](./how-to/reference-external-catalogs) if your services consume events documented elsewhere.
|
|
144
|
+
- Browse the [rules reference](./reference/rules) to see everything the linter can catch.
|
package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/01-configure-rules.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
sidebar_label: Configure rules
|
|
4
|
+
title: Configure linter rules
|
|
5
|
+
description: Change rule severities, pass rule options, ignore files, and apply different rules to different parts of the catalog.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use this guide when the defaults don't match your team's standards. All configuration lives in a `.eventcatalogrc.js` file in the catalog root; see the [configuration reference](../reference/configuration) for the full shape.
|
|
9
|
+
|
|
10
|
+
## Create the file
|
|
11
|
+
|
|
12
|
+
The fastest start is the scaffold, which lists every rule with its description and default:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx @eventcatalog/linter --init
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or write it by hand. Anything you leave out keeps its default, so a config can be as small as one line:
|
|
19
|
+
|
|
20
|
+
```js title=".eventcatalogrc.js"
|
|
21
|
+
module.exports = {
|
|
22
|
+
rules: {
|
|
23
|
+
'best-practices/description-required': 'off',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
:::tip ESM catalogs
|
|
29
|
+
If your catalog's `package.json` has `"type": "module"`, write `export default { ... }` instead of `module.exports = { ... }`. `--init` detects this for you.
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
## Change a rule's severity
|
|
33
|
+
|
|
34
|
+
Each rule takes one of three values:
|
|
35
|
+
|
|
36
|
+
| Value | Effect |
|
|
37
|
+
|-------|--------|
|
|
38
|
+
| `'error'` | Reported and fails the run (exit code 1) |
|
|
39
|
+
| `'warn'` | Reported but doesn't fail the run, unless you pass `--fail-on-warning` or `--max-warnings` |
|
|
40
|
+
| `'off'` | Not checked |
|
|
41
|
+
|
|
42
|
+
```js title=".eventcatalogrc.js"
|
|
43
|
+
module.exports = {
|
|
44
|
+
rules: {
|
|
45
|
+
'best-practices/owner-required': 'warn', // soften
|
|
46
|
+
'refs/orphan-messages': 'error', // tighten
|
|
47
|
+
'best-practices/schema-required': 'off', // disable
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Rule names are listed in the [rules reference](../reference/rules).
|
|
53
|
+
|
|
54
|
+
## Pass options to a rule
|
|
55
|
+
|
|
56
|
+
Some rules accept options. Use the array form `[severity, options]`:
|
|
57
|
+
|
|
58
|
+
```js title=".eventcatalogrc.js"
|
|
59
|
+
module.exports = {
|
|
60
|
+
rules: {
|
|
61
|
+
'schema/unknown-field': ['error', { allow: ['costCenter', 'legacy*'] }],
|
|
62
|
+
'refs/file-exists': ['error', { icons: false }],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The [rules reference](../reference/rules) documents which rules take options and what they mean.
|
|
68
|
+
|
|
69
|
+
## Ignore files
|
|
70
|
+
|
|
71
|
+
`ignorePatterns` skips files entirely — they are neither validated nor counted:
|
|
72
|
+
|
|
73
|
+
```js title=".eventcatalogrc.js"
|
|
74
|
+
module.exports = {
|
|
75
|
+
ignorePatterns: ['drafts/**', 'domains/Legacy/**'],
|
|
76
|
+
};
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`dependencies/**` is always ignored (it's where EventCatalog writes mocked external resources).
|
|
80
|
+
|
|
81
|
+
:::note
|
|
82
|
+
Patterns are matched against the path relative to the catalog root, and `**/` at the very start of a pattern currently requires at least one leading folder — write `drafts/**` rather than `**/drafts/**` to ignore a top-level `drafts` folder.
|
|
83
|
+
:::
|
|
84
|
+
|
|
85
|
+
## Apply different rules to different folders
|
|
86
|
+
|
|
87
|
+
`overrides` re-configures rules for files matching a glob. Later overrides win over earlier ones, and all of them win over the top-level `rules`:
|
|
88
|
+
|
|
89
|
+
```js title=".eventcatalogrc.js"
|
|
90
|
+
module.exports = {
|
|
91
|
+
rules: {
|
|
92
|
+
'best-practices/owner-required': 'error',
|
|
93
|
+
},
|
|
94
|
+
overrides: [
|
|
95
|
+
{
|
|
96
|
+
files: ['domains/Legacy/**'],
|
|
97
|
+
rules: {
|
|
98
|
+
'best-practices/owner-required': 'warn',
|
|
99
|
+
'best-practices/summary-required': 'off',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
files: ['**/containers/**'],
|
|
104
|
+
rules: {
|
|
105
|
+
'best-practices/description-required': 'off',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
};
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Options work inside overrides too: `'schema/unknown-field': ['warn', { allow: ['legacyId'] }]`.
|
|
113
|
+
|
|
114
|
+
## Which rules to keep strict
|
|
115
|
+
|
|
116
|
+
Rules fall into two groups. `schema/*`, `refs/*` and `structure/*` findings mean EventCatalog will fail the build, drop data or mis-render something — keep those as `'error'`. `best-practices/*`, `refs/orphan-messages` and `versions/no-deprecated-references` are documentation-quality opinions; tune them to your team's standards, and use overrides to relax them for legacy areas while enforcing them for new content.
|
|
117
|
+
|
|
118
|
+
## Check what's in effect
|
|
119
|
+
|
|
120
|
+
The config merges with the defaults at load time. If a rule doesn't behave the way you expect:
|
|
121
|
+
|
|
122
|
+
1. Check the rule name against the [rules reference](../reference/rules) — a misspelled rule name is silently ignored.
|
|
123
|
+
2. Check whether an override matches the file; overrides are applied in order.
|
|
124
|
+
3. Run with `--quiet` to confirm whether a finding is an error or a warning.
|
|
125
|
+
|
|
126
|
+
## Related
|
|
127
|
+
|
|
128
|
+
- [Configuration reference](../reference/configuration)
|
|
129
|
+
- [Rules reference](../reference/rules)
|
|
130
|
+
- [Allow custom frontmatter](./use-custom-frontmatter)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
sidebar_label: Run in CI
|
|
4
|
+
title: Run the linter in CI
|
|
5
|
+
description: Fail pull requests on catalog problems with GitHub Actions, GitLab CI, or any pipeline that can run npx.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use this guide to make the linter a required check on every change to your catalog.
|
|
9
|
+
|
|
10
|
+
## How the linter signals failure
|
|
11
|
+
|
|
12
|
+
- Exit code `1` when any **error** is reported, or when warnings exceed `--max-warnings`.
|
|
13
|
+
- Exit code `0` otherwise, including when only warnings are reported.
|
|
14
|
+
- Progress output (the spinner) is written to stderr and switched off automatically when the process is not attached to a terminal or `CI=true` is set, so logs contain only findings.
|
|
15
|
+
|
|
16
|
+
Pick the strictness you want:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @eventcatalog/linter # fail on errors only
|
|
20
|
+
npx @eventcatalog/linter --max-warnings 0 # fail on any warning too
|
|
21
|
+
npx @eventcatalog/linter --max-warnings 10 # tolerate up to 10 warnings
|
|
22
|
+
npx @eventcatalog/linter --quiet # hide warnings from the log entirely
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`--fail-on-warning` is the same as `--max-warnings 0`.
|
|
26
|
+
|
|
27
|
+
## GitHub Actions
|
|
28
|
+
|
|
29
|
+
```yaml title=".github/workflows/lint-catalog.yml"
|
|
30
|
+
name: Lint catalog
|
|
31
|
+
on:
|
|
32
|
+
pull_request:
|
|
33
|
+
push:
|
|
34
|
+
branches: [main]
|
|
35
|
+
|
|
36
|
+
jobs:
|
|
37
|
+
lint:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
- uses: actions/setup-node@v4
|
|
42
|
+
with:
|
|
43
|
+
node-version: 20
|
|
44
|
+
- run: npx @eventcatalog/linter --max-warnings 0
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If the catalog lives in a subfolder of the repository, pass the path: `npx @eventcatalog/linter ./catalog`.
|
|
48
|
+
|
|
49
|
+
## GitLab CI
|
|
50
|
+
|
|
51
|
+
```yaml title=".gitlab-ci.yml"
|
|
52
|
+
lint-catalog:
|
|
53
|
+
stage: test
|
|
54
|
+
image: node:20
|
|
55
|
+
script:
|
|
56
|
+
- npx @eventcatalog/linter --max-warnings 0
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Pin the version
|
|
60
|
+
|
|
61
|
+
`npx @eventcatalog/linter` resolves the latest release every time. For reproducible builds, add it to your catalog's `package.json` and run the local copy:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install --save-dev @eventcatalog/linter
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```json title="package.json"
|
|
68
|
+
{
|
|
69
|
+
"scripts": {
|
|
70
|
+
"lint": "eventcatalog-linter --max-warnings 0"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then use `npm run lint` in the pipeline. The version is bumped through your normal dependency-update process.
|
|
76
|
+
|
|
77
|
+
## Run before every commit
|
|
78
|
+
|
|
79
|
+
If you use a pre-commit tool such as Husky or lefthook, call the same script. The linter checks the whole catalog rather than only changed files, which keeps reference checks accurate — a change to one service can break a reference in another.
|
|
80
|
+
|
|
81
|
+
## Keep CI green while you adopt the linter
|
|
82
|
+
|
|
83
|
+
On an existing catalog the first run may report a lot. Two approaches that work well:
|
|
84
|
+
|
|
85
|
+
1. **Start permissive, tighten over time.** Set noisy rules to `'warn'` in `.eventcatalogrc.js`, run with `--max-warnings <current count>`, and lower the number as you fix things.
|
|
86
|
+
2. **Scope by folder.** Use [`overrides`](./configure-rules#apply-different-rules-to-different-folders) to relax rules for legacy areas while enforcing them fully for new content.
|
|
87
|
+
|
|
88
|
+
Either way, keep `schema/*`, `refs/*` and `structure/*` as errors — those are the findings that mean EventCatalog will silently drop or fail to build something.
|
|
89
|
+
|
|
90
|
+
## Related
|
|
91
|
+
|
|
92
|
+
- [CLI reference](../reference/cli) — every option and exit code
|
|
93
|
+
- [Configure rules](./configure-rules)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 3
|
|
3
|
+
sidebar_label: Allow custom frontmatter
|
|
4
|
+
title: Allow custom frontmatter fields
|
|
5
|
+
description: Add your own metadata to resources without tripping the unknown-field rule.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use this guide when you need extra fields in frontmatter — a cost centre, a data classification, a Jira key — and the linter reports them as unknown.
|
|
9
|
+
|
|
10
|
+
## Why the linter complains
|
|
11
|
+
|
|
12
|
+
EventCatalog validates frontmatter against a schema and rejects top-level keys it doesn't know at build time. The linter's [`schema/unknown-field`](../reference/rules#schemaunknown-field) rule mirrors that, so a typo like `owner:` is caught before the build, and so is any custom field:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
services/order-service/index.mdx
|
|
16
|
+
8:1 ✖ error Unknown property "costCenter". Custom properties must start with "x-". [costCenter] (schema/unknown-field)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Option 1: use the `x-` prefix (recommended)
|
|
20
|
+
|
|
21
|
+
EventCatalog reserves the `x-` prefix for custom properties. Both EventCatalog and the linter accept any key that starts with it, at any level of the frontmatter:
|
|
22
|
+
|
|
23
|
+
```yaml title="services/order-service/index.mdx"
|
|
24
|
+
---
|
|
25
|
+
id: order-service
|
|
26
|
+
name: Order Service
|
|
27
|
+
version: 1.0.0
|
|
28
|
+
x-cost-center: CC-1234
|
|
29
|
+
x-jira-project: ORD
|
|
30
|
+
sends:
|
|
31
|
+
- id: OrderCreated
|
|
32
|
+
x-internal: true
|
|
33
|
+
---
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Custom properties are rendered in the catalog and available to your own components — see [Custom properties on resources](/docs/development/customization/custom-properties).
|
|
37
|
+
|
|
38
|
+
## Option 2: allow specific keys
|
|
39
|
+
|
|
40
|
+
If you can't rename a field yet, tell the rule to ignore it. `allow` takes exact key names or `prefix*` patterns and applies to both the top-level and nested rules:
|
|
41
|
+
|
|
42
|
+
```js title=".eventcatalogrc.js"
|
|
43
|
+
module.exports = {
|
|
44
|
+
rules: {
|
|
45
|
+
'schema/unknown-field': ['error', { allow: ['costCenter', 'legacy*'] }],
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
:::warning
|
|
51
|
+
Allowed keys are still unknown to EventCatalog. Top-level ones will fail `eventcatalog build`; nested ones are silently ignored. Treat `allow` as a stepping stone to the `x-` prefix, not a destination.
|
|
52
|
+
:::
|
|
53
|
+
|
|
54
|
+
## Turn off the suggestions
|
|
55
|
+
|
|
56
|
+
The rule adds "Did you mean …?" hints and tells you when a key belongs to a different resource type. To keep only the bare message:
|
|
57
|
+
|
|
58
|
+
```js title=".eventcatalogrc.js"
|
|
59
|
+
module.exports = {
|
|
60
|
+
rules: {
|
|
61
|
+
'schema/unknown-field': ['error', { suggestions: false }],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Relax nested-field checks
|
|
67
|
+
|
|
68
|
+
Unknown keys inside nested objects (`sends[0].too`) are reported by a separate rule, [`schema/unknown-nested-field`](../reference/rules#schemaunknown-nested-field), which defaults to `warn` because EventCatalog ignores them rather than failing. Adjust it independently:
|
|
69
|
+
|
|
70
|
+
```js title=".eventcatalogrc.js"
|
|
71
|
+
module.exports = {
|
|
72
|
+
rules: {
|
|
73
|
+
'schema/unknown-nested-field': 'off',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Related
|
|
79
|
+
|
|
80
|
+
- [Custom properties on resources](/docs/development/customization/custom-properties)
|
|
81
|
+
- [Rules reference: schema rules](../reference/rules#schema-validation)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 4
|
|
3
|
+
sidebar_label: Reference external catalogs
|
|
4
|
+
title: Reference resources documented in other catalogs
|
|
5
|
+
description: Stop the linter reporting missing resources when a service sends or receives messages that another team documents.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use this guide when your catalog references resources that live somewhere else — typically another team's catalog — and the linter reports them as missing:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
services/order-service/index.mdx
|
|
12
|
+
11:9 ✖ error Referenced event/command/query "PaymentAuthorised" does not exist [receives[0]] (refs/resource-exists)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Declare the resources as dependencies
|
|
16
|
+
|
|
17
|
+
EventCatalog lets you list external resources in the `dependencies` section of `eventcatalog.config.js`. EventCatalog renders a placeholder page for each one, and the linter treats them as existing:
|
|
18
|
+
|
|
19
|
+
```js title="eventcatalog.config.js"
|
|
20
|
+
export default {
|
|
21
|
+
// ...
|
|
22
|
+
dependencies: {
|
|
23
|
+
events: [
|
|
24
|
+
{ id: 'PaymentAuthorised' },
|
|
25
|
+
{ id: 'PaymentDeclined', version: '2.0.0' },
|
|
26
|
+
],
|
|
27
|
+
services: [{ id: 'payment-service' }],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- Without a `version`, the dependency satisfies any reference to that id (it behaves like `latest`).
|
|
33
|
+
- With a `version`, references must match that version, using the same [matching rules](../reference/versions) as local resources.
|
|
34
|
+
- Dependency messages are never reported as orphans.
|
|
35
|
+
|
|
36
|
+
Any resource type can be listed: `events`, `commands`, `queries`, `services`, `domains`, `systems`, `channels`, `flows`, `entities`, `containers`, `data-products`, `diagrams`, `agents`, `adrs`, `users`, `teams`.
|
|
37
|
+
|
|
38
|
+
The linter reads `eventcatalog.config.js` from the directory you point it at. Both CommonJS and ES module configs are supported on current Node.js versions; if the file can't be loaded, the linter prints a warning and continues without dependencies.
|
|
39
|
+
|
|
40
|
+
## Federated content
|
|
41
|
+
|
|
42
|
+
If you use [EventCatalog Federation](/docs/federation/overview), resources materialised under `federated/<catalog>/` are scanned like local ones. Owners, services and messages from federated catalogs resolve without any extra configuration.
|
|
43
|
+
|
|
44
|
+
## Ignore the generated `dependencies` folder
|
|
45
|
+
|
|
46
|
+
EventCatalog writes placeholder files for dependencies into a `dependencies/` folder. The linter ignores that folder by default, so you don't need to add it to `ignorePatterns`.
|
|
47
|
+
|
|
48
|
+
## Related
|
|
49
|
+
|
|
50
|
+
- [Mocking out dependencies (legacy federation guide)](/docs/federation/legacy-federation/setup-team-catalog#mocking-out-dependencies-in-your-catalog)
|
|
51
|
+
- [Version formats and matching](../reference/versions)
|
package/dist/docs/development/developer-tools/eventcatalog-linter/how-to/05-fix-common-problems.md
ADDED
|
@@ -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
|
+
}
|