@sfdxy/mule-lint 1.18.0 → 1.19.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.
Files changed (245) hide show
  1. package/README.md +154 -150
  2. package/dist/bin/mule-lint-mcp.js.map +1 -1
  3. package/dist/bin/mule-lint.js +4 -3
  4. package/dist/bin/mule-lint.js.map +1 -1
  5. package/dist/package.json +26 -15
  6. package/dist/src/core/ComplexityCalculator.d.ts.map +1 -1
  7. package/dist/src/core/ComplexityCalculator.js.map +1 -1
  8. package/dist/src/core/FileScanner.d.ts.map +1 -1
  9. package/dist/src/core/FileScanner.js.map +1 -1
  10. package/dist/src/core/MetricsAggregator.d.ts.map +1 -1
  11. package/dist/src/core/MetricsAggregator.js.map +1 -1
  12. package/dist/src/core/MetricsCollector.d.ts.map +1 -1
  13. package/dist/src/core/MetricsCollector.js +1 -2
  14. package/dist/src/core/MetricsCollector.js.map +1 -1
  15. package/dist/src/core/QualityGateEvaluator.d.ts.map +1 -1
  16. package/dist/src/core/QualityGateEvaluator.js.map +1 -1
  17. package/dist/src/core/XPathHelper.d.ts +9 -1
  18. package/dist/src/core/XPathHelper.d.ts.map +1 -1
  19. package/dist/src/core/XPathHelper.js +4 -9
  20. package/dist/src/core/XPathHelper.js.map +1 -1
  21. package/dist/src/core/XmlParser.d.ts.map +1 -1
  22. package/dist/src/core/XmlParser.js.map +1 -1
  23. package/dist/src/core/YamlParser.d.ts.map +1 -1
  24. package/dist/src/core/YamlParser.js.map +1 -1
  25. package/dist/src/core/errors.js.map +1 -1
  26. package/dist/src/engine/LintEngine.d.ts.map +1 -1
  27. package/dist/src/engine/LintEngine.js +2 -4
  28. package/dist/src/engine/LintEngine.js.map +1 -1
  29. package/dist/src/formatter/MuleXmlFormatter.d.ts.map +1 -1
  30. package/dist/src/formatter/MuleXmlFormatter.js +7 -1
  31. package/dist/src/formatter/MuleXmlFormatter.js.map +1 -1
  32. package/dist/src/formatter/index.d.ts +2 -2
  33. package/dist/src/formatter/index.d.ts.map +1 -1
  34. package/dist/src/formatter/index.js.map +1 -1
  35. package/dist/src/formatters/CsvFormatter.js.map +1 -1
  36. package/dist/src/formatters/HtmlFormatter.js +0 -1
  37. package/dist/src/formatters/HtmlFormatter.js.map +1 -1
  38. package/dist/src/formatters/JsonFormatter.d.ts.map +1 -1
  39. package/dist/src/formatters/JsonFormatter.js.map +1 -1
  40. package/dist/src/formatters/SarifFormatter.js.map +1 -1
  41. package/dist/src/formatters/TableFormatter.js.map +1 -1
  42. package/dist/src/formatters/html/components/Icons.js +1 -1
  43. package/dist/src/formatters/html/components/Icons.js.map +1 -1
  44. package/dist/src/formatters/html/components/MetricCard.d.ts.map +1 -1
  45. package/dist/src/formatters/html/components/MetricCard.js.map +1 -1
  46. package/dist/src/formatters/html/components/Modal.d.ts.map +1 -1
  47. package/dist/src/formatters/html/components/Modal.js.map +1 -1
  48. package/dist/src/formatters/html/components/RatingBadge.d.ts.map +1 -1
  49. package/dist/src/formatters/html/components/RatingBadge.js +6 -6
  50. package/dist/src/formatters/html/components/RatingBadge.js.map +1 -1
  51. package/dist/src/formatters/html/index.d.ts +2 -2
  52. package/dist/src/formatters/html/index.d.ts.map +1 -1
  53. package/dist/src/formatters/html/index.js.map +1 -1
  54. package/dist/src/formatters/html/scripts/charts.d.ts.map +1 -1
  55. package/dist/src/formatters/html/scripts/charts.js +45 -12
  56. package/dist/src/formatters/html/scripts/charts.js.map +1 -1
  57. package/dist/src/formatters/html/scripts/index.d.ts.map +1 -1
  58. package/dist/src/formatters/html/scripts/index.js.map +1 -1
  59. package/dist/src/formatters/html/scripts/renderer.d.ts.map +1 -1
  60. package/dist/src/formatters/html/scripts/renderer.js +175 -35
  61. package/dist/src/formatters/html/scripts/renderer.js.map +1 -1
  62. package/dist/src/formatters/html/sections/Header.d.ts.map +1 -1
  63. package/dist/src/formatters/html/sections/Header.js.map +1 -1
  64. package/dist/src/formatters/html/sections/LintSummary.d.ts.map +1 -1
  65. package/dist/src/formatters/html/sections/LintSummary.js.map +1 -1
  66. package/dist/src/formatters/html/sections/QualityRatings.js.map +1 -1
  67. package/dist/src/formatters/html/sections/Sidebar.d.ts.map +1 -1
  68. package/dist/src/formatters/html/sections/Sidebar.js.map +1 -1
  69. package/dist/src/formatters/html/styles/badges.d.ts.map +1 -1
  70. package/dist/src/formatters/html/styles/badges.js.map +1 -1
  71. package/dist/src/formatters/html/styles/index.d.ts.map +1 -1
  72. package/dist/src/formatters/html/styles/index.js.map +1 -1
  73. package/dist/src/formatters/html/theme.js.map +1 -1
  74. package/dist/src/formatters/html/views/Dashboard.js +5 -5
  75. package/dist/src/formatters/html/views/Dashboard.js.map +1 -1
  76. package/dist/src/formatters/html/views/IssuesView.d.ts.map +1 -1
  77. package/dist/src/formatters/html/views/IssuesView.js.map +1 -1
  78. package/dist/src/formatters/index.js.map +1 -1
  79. package/dist/src/mcp/index.d.ts.map +1 -1
  80. package/dist/src/mcp/index.js +12 -511
  81. package/dist/src/mcp/index.js.map +1 -1
  82. package/dist/src/mcp/prompts/index.d.ts +6 -0
  83. package/dist/src/mcp/prompts/index.d.ts.map +1 -0
  84. package/dist/src/mcp/prompts/index.js +87 -0
  85. package/dist/src/mcp/prompts/index.js.map +1 -0
  86. package/dist/src/mcp/resources/index.d.ts +6 -0
  87. package/dist/src/mcp/resources/index.d.ts.map +1 -0
  88. package/dist/src/mcp/resources/index.js +189 -0
  89. package/dist/src/mcp/resources/index.js.map +1 -0
  90. package/dist/src/mcp/tools/formatMuleXml.d.ts +6 -0
  91. package/dist/src/mcp/tools/formatMuleXml.d.ts.map +1 -0
  92. package/dist/src/mcp/tools/formatMuleXml.js +133 -0
  93. package/dist/src/mcp/tools/formatMuleXml.js.map +1 -0
  94. package/dist/src/mcp/tools/getRuleDetails.d.ts +6 -0
  95. package/dist/src/mcp/tools/getRuleDetails.d.ts.map +1 -0
  96. package/dist/src/mcp/tools/getRuleDetails.js +44 -0
  97. package/dist/src/mcp/tools/getRuleDetails.js.map +1 -0
  98. package/dist/src/mcp/tools/runLintAnalysis.d.ts +7 -0
  99. package/dist/src/mcp/tools/runLintAnalysis.d.ts.map +1 -0
  100. package/dist/src/mcp/tools/runLintAnalysis.js +76 -0
  101. package/dist/src/mcp/tools/runLintAnalysis.js.map +1 -0
  102. package/dist/src/mcp/tools/validateSnippet.d.ts +6 -0
  103. package/dist/src/mcp/tools/validateSnippet.d.ts.map +1 -0
  104. package/dist/src/mcp/tools/validateSnippet.js +59 -0
  105. package/dist/src/mcp/tools/validateSnippet.js.map +1 -0
  106. package/dist/src/quality/calculator.d.ts.map +1 -1
  107. package/dist/src/quality/calculator.js +1 -1
  108. package/dist/src/quality/calculator.js.map +1 -1
  109. package/dist/src/quality/index.d.ts.map +1 -1
  110. package/dist/src/quality/index.js.map +1 -1
  111. package/dist/src/quality/thresholds.js.map +1 -1
  112. package/dist/src/quality/types.d.ts.map +1 -1
  113. package/dist/src/rules/api-led/ApiLedRules.d.ts.map +1 -1
  114. package/dist/src/rules/api-led/ApiLedRules.js +6 -2
  115. package/dist/src/rules/api-led/ApiLedRules.js.map +1 -1
  116. package/dist/src/rules/api-led/SingleSystemSapiRule.d.ts.map +1 -1
  117. package/dist/src/rules/api-led/SingleSystemSapiRule.js.map +1 -1
  118. package/dist/src/rules/base/BaseRule.d.ts.map +1 -1
  119. package/dist/src/rules/base/BaseRule.js.map +1 -1
  120. package/dist/src/rules/base/ProjectRule.d.ts.map +1 -1
  121. package/dist/src/rules/base/ProjectRule.js.map +1 -1
  122. package/dist/src/rules/complexity/FlowComplexityRule.d.ts.map +1 -1
  123. package/dist/src/rules/complexity/FlowComplexityRule.js.map +1 -1
  124. package/dist/src/rules/dataweave/DataWeaveRules.d.ts.map +1 -1
  125. package/dist/src/rules/dataweave/DataWeaveRules.js +1 -3
  126. package/dist/src/rules/dataweave/DataWeaveRules.js.map +1 -1
  127. package/dist/src/rules/dataweave/Java17DWErrorHandlingRule.d.ts.map +1 -1
  128. package/dist/src/rules/dataweave/Java17DWErrorHandlingRule.js.map +1 -1
  129. package/dist/src/rules/documentation/DisplayNameRule.d.ts.map +1 -1
  130. package/dist/src/rules/documentation/DisplayNameRule.js.map +1 -1
  131. package/dist/src/rules/documentation/FlowDescriptionRule.d.ts.map +1 -1
  132. package/dist/src/rules/documentation/FlowDescriptionRule.js.map +1 -1
  133. package/dist/src/rules/documentation/MissingDocNameRule.d.ts.map +1 -1
  134. package/dist/src/rules/documentation/MissingDocNameRule.js.map +1 -1
  135. package/dist/src/rules/error-handling/CorrelationIdRule.d.ts.map +1 -1
  136. package/dist/src/rules/error-handling/CorrelationIdRule.js.map +1 -1
  137. package/dist/src/rules/error-handling/GenericErrorRule.d.ts.map +1 -1
  138. package/dist/src/rules/error-handling/GenericErrorRule.js.map +1 -1
  139. package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts.map +1 -1
  140. package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js.map +1 -1
  141. package/dist/src/rules/error-handling/HttpStatusRule.d.ts.map +1 -1
  142. package/dist/src/rules/error-handling/HttpStatusRule.js.map +1 -1
  143. package/dist/src/rules/error-handling/MissingErrorHandlerRule.d.ts.map +1 -1
  144. package/dist/src/rules/error-handling/MissingErrorHandlerRule.js.map +1 -1
  145. package/dist/src/rules/error-handling/TryScopeRule.d.ts.map +1 -1
  146. package/dist/src/rules/error-handling/TryScopeRule.js.map +1 -1
  147. package/dist/src/rules/experimental/ExperimentalRules.d.ts.map +1 -1
  148. package/dist/src/rules/experimental/ExperimentalRules.js +6 -2
  149. package/dist/src/rules/experimental/ExperimentalRules.js.map +1 -1
  150. package/dist/src/rules/governance/GovernanceRules.d.ts +2 -2
  151. package/dist/src/rules/governance/GovernanceRules.d.ts.map +1 -1
  152. package/dist/src/rules/governance/GovernanceRules.js +2 -2
  153. package/dist/src/rules/governance/GovernanceRules.js.map +1 -1
  154. package/dist/src/rules/http/HttpContentTypeRule.d.ts.map +1 -1
  155. package/dist/src/rules/http/HttpContentTypeRule.js.map +1 -1
  156. package/dist/src/rules/http/HttpTimeoutRule.d.ts.map +1 -1
  157. package/dist/src/rules/http/HttpTimeoutRule.js.map +1 -1
  158. package/dist/src/rules/http/HttpUserAgentRule.d.ts.map +1 -1
  159. package/dist/src/rules/http/HttpUserAgentRule.js.map +1 -1
  160. package/dist/src/rules/index.js.map +1 -1
  161. package/dist/src/rules/logging/ExcessiveLoggersRule.d.ts.map +1 -1
  162. package/dist/src/rules/logging/ExcessiveLoggersRule.js.map +1 -1
  163. package/dist/src/rules/logging/LoggerCategoryRule.d.ts.map +1 -1
  164. package/dist/src/rules/logging/LoggerCategoryRule.js.map +1 -1
  165. package/dist/src/rules/logging/LoggerInUntilSuccessfulRule.d.ts.map +1 -1
  166. package/dist/src/rules/logging/LoggerInUntilSuccessfulRule.js.map +1 -1
  167. package/dist/src/rules/logging/LoggerPayloadRule.d.ts.map +1 -1
  168. package/dist/src/rules/logging/LoggerPayloadRule.js.map +1 -1
  169. package/dist/src/rules/logging/NewLoggingRules.d.ts.map +1 -1
  170. package/dist/src/rules/logging/NewLoggingRules.js.map +1 -1
  171. package/dist/src/rules/naming/FlowCasingRule.d.ts.map +1 -1
  172. package/dist/src/rules/naming/FlowCasingRule.js.map +1 -1
  173. package/dist/src/rules/naming/FlowNamingRule.d.ts.map +1 -1
  174. package/dist/src/rules/naming/FlowNamingRule.js +3 -1
  175. package/dist/src/rules/naming/FlowNamingRule.js.map +1 -1
  176. package/dist/src/rules/naming/VariableNamingRule.d.ts.map +1 -1
  177. package/dist/src/rules/naming/VariableNamingRule.js.map +1 -1
  178. package/dist/src/rules/operations/CommentedCodeRule.d.ts.map +1 -1
  179. package/dist/src/rules/operations/CommentedCodeRule.js.map +1 -1
  180. package/dist/src/rules/operations/UnusedFlowRule.d.ts.map +1 -1
  181. package/dist/src/rules/operations/UnusedFlowRule.js.map +1 -1
  182. package/dist/src/rules/performance/AsyncErrorHandlerRule.d.ts.map +1 -1
  183. package/dist/src/rules/performance/AsyncErrorHandlerRule.js.map +1 -1
  184. package/dist/src/rules/performance/ConnectionPoolingRule.d.ts.map +1 -1
  185. package/dist/src/rules/performance/ConnectionPoolingRule.js.map +1 -1
  186. package/dist/src/rules/performance/LargeChoiceBlockRule.d.ts.map +1 -1
  187. package/dist/src/rules/performance/LargeChoiceBlockRule.js.map +1 -1
  188. package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts.map +1 -1
  189. package/dist/src/rules/performance/ReconnectionStrategyRule.js.map +1 -1
  190. package/dist/src/rules/performance/ScatterGatherRoutesRule.d.ts.map +1 -1
  191. package/dist/src/rules/performance/ScatterGatherRoutesRule.js.map +1 -1
  192. package/dist/src/rules/security/EncryptionKeyInLogsRule.d.ts.map +1 -1
  193. package/dist/src/rules/security/EncryptionKeyInLogsRule.js.map +1 -1
  194. package/dist/src/rules/security/HardcodedCredentialsRule.d.ts.map +1 -1
  195. package/dist/src/rules/security/HardcodedCredentialsRule.js.map +1 -1
  196. package/dist/src/rules/security/HardcodedHttpRule.d.ts.map +1 -1
  197. package/dist/src/rules/security/HardcodedHttpRule.js +1 -9
  198. package/dist/src/rules/security/HardcodedHttpRule.js.map +1 -1
  199. package/dist/src/rules/security/InputValidationRule.d.ts.map +1 -1
  200. package/dist/src/rules/security/InputValidationRule.js +1 -3
  201. package/dist/src/rules/security/InputValidationRule.js.map +1 -1
  202. package/dist/src/rules/security/InsecureTlsRule.d.ts.map +1 -1
  203. package/dist/src/rules/security/InsecureTlsRule.js.map +1 -1
  204. package/dist/src/rules/security/RateLimitingRule.d.ts.map +1 -1
  205. package/dist/src/rules/security/RateLimitingRule.js.map +1 -1
  206. package/dist/src/rules/security/TlsVersionRule.d.ts.map +1 -1
  207. package/dist/src/rules/security/TlsVersionRule.js.map +1 -1
  208. package/dist/src/rules/standards/ApiKitValidationRule.d.ts.map +1 -1
  209. package/dist/src/rules/standards/ApiKitValidationRule.js.map +1 -1
  210. package/dist/src/rules/standards/AutoDiscoveryRule.d.ts.map +1 -1
  211. package/dist/src/rules/standards/AutoDiscoveryRule.js.map +1 -1
  212. package/dist/src/rules/standards/ChoiceAntiPatternRule.d.ts.map +1 -1
  213. package/dist/src/rules/standards/ChoiceAntiPatternRule.js.map +1 -1
  214. package/dist/src/rules/standards/CronExternalizedRule.d.ts.map +1 -1
  215. package/dist/src/rules/standards/CronExternalizedRule.js.map +1 -1
  216. package/dist/src/rules/standards/DeprecatedComponentRule.d.ts.map +1 -1
  217. package/dist/src/rules/standards/DeprecatedComponentRule.js.map +1 -1
  218. package/dist/src/rules/standards/DwlStandardsRule.d.ts.map +1 -1
  219. package/dist/src/rules/standards/DwlStandardsRule.js.map +1 -1
  220. package/dist/src/rules/standards/HttpPortPlaceholderRule.d.ts.map +1 -1
  221. package/dist/src/rules/standards/HttpPortPlaceholderRule.js.map +1 -1
  222. package/dist/src/rules/structure/StructureRules.d.ts.map +1 -1
  223. package/dist/src/rules/structure/StructureRules.js.map +1 -1
  224. package/dist/src/rules/yaml/YamlRules.d.ts.map +1 -1
  225. package/dist/src/rules/yaml/YamlRules.js +2 -7
  226. package/dist/src/rules/yaml/YamlRules.js.map +1 -1
  227. package/dist/src/types/Config.d.ts.map +1 -1
  228. package/dist/src/types/Config.js.map +1 -1
  229. package/dist/src/types/QualityGate.d.ts.map +1 -1
  230. package/dist/src/types/QualityGate.js.map +1 -1
  231. package/dist/src/types/Report.d.ts.map +1 -1
  232. package/dist/src/types/Rule.d.ts +1 -1
  233. package/dist/src/types/Rule.d.ts.map +1 -1
  234. package/docs/README.md +27 -27
  235. package/docs/best-practices/documentation-standards.md +20 -11
  236. package/docs/best-practices/folder-structure.md +16 -10
  237. package/docs/best-practices/mulesoft-best-practices.md +96 -94
  238. package/docs/best-practices/rules-catalog.md +316 -287
  239. package/docs/linter/architecture.md +70 -64
  240. package/docs/linter/extending.md +137 -128
  241. package/docs/linter/folder-structure.md +39 -38
  242. package/docs/linter/naming-conventions.md +80 -78
  243. package/docs/linter/rule-engine.md +306 -306
  244. package/docs/mcp-design.md +35 -21
  245. package/package.json +84 -73
@@ -7,6 +7,7 @@
7
7
  ## Table of Contents
8
8
 
9
9
  ### Linter-Enforced Practices
10
+
10
11
  - [API-Led Connectivity](#api-led-connectivity)
11
12
  - [Error Handling](#error-handling)
12
13
  - [Logging Standards](#logging-standards)
@@ -19,6 +20,7 @@
19
20
  - [Documentation Standards](#documentation-standards)
20
21
 
21
22
  ### General Developer Guidelines
23
+
22
24
  - [Testing with MUnit](#testing-with-munit)
23
25
  - [CI/CD Integration](#cicd-integration)
24
26
  - [API Versioning](#api-versioning)
@@ -55,11 +57,11 @@ MuleSoft's API-Led Connectivity approach organizes APIs into three layers, each
55
57
 
56
58
  ### Layer Guidelines
57
59
 
58
- | Layer | Should Have | Should NOT Have |
59
- |-------|-------------|-----------------|
60
+ | Layer | Should Have | Should NOT Have |
61
+ | -------------- | ------------------------------------------------ | ---------------------------------------------- |
60
62
  | **Experience** | HTTP listeners, channel-specific transformations | Direct database access, complex business logic |
61
- | **Process** | Flow-refs to other APIs, orchestration logic | Direct system connections, database queries |
62
- | **System** | Database operations, HTTP requests to backends | Business logic, data aggregation |
63
+ | **Process** | Flow-refs to other APIs, orchestration logic | Direct system connections, database queries |
64
+ | **System** | Database operations, HTTP requests to backends | Business logic, data aggregation |
63
65
 
64
66
  ### Example Flow Structure
65
67
 
@@ -121,16 +123,16 @@ output application/json
121
123
  }]]></ee:set-payload>
122
124
  </ee:transform>
123
125
  </on-error-propagate>
124
-
126
+
125
127
  <on-error-propagate type="APIKIT:NOT_FOUND">
126
128
  <set-variable variableName="httpStatus" value="404"/>
127
129
  <!-- ... -->
128
130
  </on-error-propagate>
129
-
131
+
130
132
  <!-- Catch-all for unexpected errors -->
131
133
  <on-error-propagate>
132
134
  <set-variable variableName="httpStatus" value="500"/>
133
- <logger category="com.myorg.errors" level="ERROR"
135
+ <logger category="com.myorg.errors" level="ERROR"
134
136
  message="#['Error: ' ++ error.description ++ ' | CorrelationId: ' ++ correlationId]"/>
135
137
  <!-- ... -->
136
138
  </on-error-propagate>
@@ -168,10 +170,10 @@ Use hierarchical category names:
168
170
 
169
171
  ```xml
170
172
  <!-- ✅ Good - Hierarchical categories -->
171
- <logger category="com.myorg.orders.api" level="INFO"
173
+ <logger category="com.myorg.orders.api" level="INFO"
172
174
  message="#['Processing order: ' ++ vars.orderId]"/>
173
175
 
174
- <logger category="com.myorg.orders.db" level="DEBUG"
176
+ <logger category="com.myorg.orders.db" level="DEBUG"
175
177
  message="#['Query executed in ' ++ vars.queryTime ++ 'ms']"/>
176
178
  ```
177
179
 
@@ -232,12 +234,12 @@ Protect sensitive data and follow secure development practices.
232
234
  ```xml
233
235
  <!-- ❌ Bad - Hardcoded credentials -->
234
236
  <http:request-config host="api.example.com"
235
- username="admin"
237
+ username="admin"
236
238
  password="secret123"/>
237
239
 
238
240
  <!-- ✅ Good - Property placeholders -->
239
241
  <http:request-config host="${api.host}"
240
- username="${api.username}"
242
+ username="${api.username}"
241
243
  password="${secure::api.password}"/>
242
244
  ```
243
245
 
@@ -258,8 +260,8 @@ Use MuleSoft Secure Properties:
258
260
  ```yaml
259
261
  # secure.yaml (encrypted)
260
262
  api:
261
- password: "![encryptedValue]"
262
- clientSecret: "![encryptedValue]"
263
+ password: '![encryptedValue]'
264
+ clientSecret: '![encryptedValue]'
263
265
  ```
264
266
 
265
267
  ### TLS Configuration
@@ -272,7 +274,7 @@ api:
272
274
 
273
275
  <!-- ✅ Good - Proper certificate validation -->
274
276
  <tls:context name="Secure_TLS">
275
- <tls:trust-store path="${tls.truststore.path}"
277
+ <tls:trust-store path="${tls.truststore.path}"
276
278
  password="${secure::tls.truststore.password}"/>
277
279
  </tls:context>
278
280
  ```
@@ -301,7 +303,7 @@ Async scopes don't propagate errors to parent flows:
301
303
  <http:request config-ref="HTTP_Config" path="/webhook"/>
302
304
  <error-handler>
303
305
  <on-error-continue>
304
- <logger category="com.myorg.async" level="ERROR"
306
+ <logger category="com.myorg.async" level="ERROR"
305
307
  message="#['Async failed: ' ++ error.description]"/>
306
308
  </on-error-continue>
307
309
  </error-handler>
@@ -340,9 +342,9 @@ handlers[vars.status] default "default-handler-subflow"
340
342
 
341
343
  ```xml
342
344
  <!-- ✅ Always set explicit timeouts -->
343
- <http:request-config name="HTTP_Request_Config"
345
+ <http:request-config name="HTTP_Request_Config"
344
346
  responseTimeout="30000">
345
- <http:request-connection host="${api.host}"
347
+ <http:request-connection host="${api.host}"
346
348
  port="${api.port}"/>
347
349
  </http:request-config>
348
350
  ```
@@ -395,12 +397,12 @@ my-mule-project/
395
397
 
396
398
  ### File Organization Guidelines
397
399
 
398
- | Guideline | Recommendation |
399
- |-----------|----------------|
400
- | Flows per file | Max 10 flows/sub-flows per XML file |
401
- | File responsibility | One domain/feature per file |
402
- | Global configs | Centralize in `global.xml` |
403
- | Error handling | Separate `global-error-handler.xml` |
400
+ | Guideline | Recommendation |
401
+ | ------------------- | ----------------------------------- |
402
+ | Flows per file | Max 10 flows/sub-flows per XML file |
403
+ | File responsibility | One domain/feature per file |
404
+ | Global configs | Centralize in `global.xml` |
405
+ | Error handling | Separate `global-error-handler.xml` |
404
406
 
405
407
  **Related Rules:** `MULE-802`, `MULE-803`, `MULE-804`
406
408
 
@@ -449,17 +451,17 @@ Create separate files for each environment:
449
451
  ```yaml
450
452
  # dev.yaml
451
453
  http:
452
- host: "0.0.0.0"
453
- port: "8081"
454
+ host: '0.0.0.0'
455
+ port: '8081'
454
456
 
455
457
  api:
456
458
  orders:
457
- baseUrl: "http://localhost:8082/api"
458
- timeout: "30000"
459
+ baseUrl: 'http://localhost:8082/api'
460
+ timeout: '30000'
459
461
 
460
462
  db:
461
- host: "localhost"
462
- port: "5432"
463
+ host: 'localhost'
464
+ port: '5432'
463
465
  ```
464
466
 
465
467
  ### Property Naming
@@ -508,10 +510,10 @@ Write maintainable and reusable DataWeave code.
508
510
  // src/main/resources/dwl/common.dwl
509
511
  %dw 2.0
510
512
 
511
- fun formatDate(date: DateTime) =
513
+ fun formatDate(date: DateTime) =
512
514
  date as String {format: "yyyy-MM-dd"}
513
515
 
514
- fun maskPII(value: String) =
516
+ fun maskPII(value: String) =
515
517
  value[0 to 2] ++ "****" ++ value[-2 to -1]
516
518
 
517
519
  fun toErrorResponse(error, correlationId: String) = {
@@ -525,6 +527,7 @@ fun toErrorResponse(error, correlationId: String) = {
525
527
  ### File Naming
526
528
 
527
529
  Use kebab-case for DWL files:
530
+
528
531
  - `transform-order.dwl`
529
532
  - `validate-input.dwl`
530
533
  - `common-utils.dwl`
@@ -540,16 +543,16 @@ Document for maintainability.
540
543
  ### Flow Documentation
541
544
 
542
545
  ```xml
543
- <flow name="orders-api-create-order-flow"
544
- doc:name="Create Order"
546
+ <flow name="orders-api-create-order-flow"
547
+ doc:name="Create Order"
545
548
  doc:description="Creates a new order in the system. Validates input, checks inventory, and persists to database.">
546
549
  ```
547
550
 
548
551
  ### Component Documentation
549
552
 
550
553
  ```xml
551
- <logger doc:name="Log Order Received"
552
- category="com.myorg.orders"
554
+ <logger doc:name="Log Order Received"
555
+ category="com.myorg.orders"
553
556
  message="#['Order received: ' ++ payload.orderId]"/>
554
557
 
555
558
  <ee:transform doc:name="Transform to Database Format">
@@ -563,16 +566,16 @@ Document for maintainability.
563
566
 
564
567
  ## Quick Reference Card
565
568
 
566
- | Practice | Do | Don't |
567
- |----------|-----|-------|
568
- | **Error Handling** | Use global handler, set httpStatus | Catch `type="ANY"`, ignore errors |
569
- | **Logging** | Use categories, log specific fields | Log `#[payload]`, log in retry loops |
570
- | **Security** | Use `${property}`, encrypt secrets | Hardcode URLs, passwords, keys |
571
- | **Performance** | Set timeouts, handle async errors | Unlimited retries, huge choice blocks |
572
- | **Naming** | kebab-case flows, camelCase vars | Inconsistent casing, no suffixes |
573
- | **Structure** | Separate files by domain | Monolithic XML files |
574
- | **Config** | Environment-specific YAML files | Hardcoded values |
575
- | **DataWeave** | External .dwl files, reusable modules | Large inline transforms |
569
+ | Practice | Do | Don't |
570
+ | ------------------ | ------------------------------------- | ------------------------------------- |
571
+ | **Error Handling** | Use global handler, set httpStatus | Catch `type="ANY"`, ignore errors |
572
+ | **Logging** | Use categories, log specific fields | Log `#[payload]`, log in retry loops |
573
+ | **Security** | Use `${property}`, encrypt secrets | Hardcode URLs, passwords, keys |
574
+ | **Performance** | Set timeouts, handle async errors | Unlimited retries, huge choice blocks |
575
+ | **Naming** | kebab-case flows, camelCase vars | Inconsistent casing, no suffixes |
576
+ | **Structure** | Separate files by domain | Monolithic XML files |
577
+ | **Config** | Environment-specific YAML files | Hardcoded values |
578
+ | **DataWeave** | External .dwl files, reusable modules | Large inline transforms |
576
579
 
577
580
  ---
578
581
 
@@ -588,11 +591,11 @@ MUnit is MuleSoft's native testing framework. Comprehensive testing is essential
588
591
 
589
592
  ### Test Coverage Goals
590
593
 
591
- | Test Type | Coverage Target | Purpose |
592
- |-----------|-----------------|---------|
593
- | Unit Tests | 80%+ flow coverage | Validate individual flow logic |
594
- | Integration Tests | All critical paths | Validate end-to-end scenarios |
595
- | Error Scenario Tests | All error handlers | Validate error responses |
594
+ | Test Type | Coverage Target | Purpose |
595
+ | -------------------- | ------------------ | ------------------------------ |
596
+ | Unit Tests | 80%+ flow coverage | Validate individual flow logic |
597
+ | Integration Tests | All critical paths | Validate end-to-end scenarios |
598
+ | Error Scenario Tests | All error handlers | Validate error responses |
596
599
 
597
600
  ### MUnit Best Practices
598
601
 
@@ -600,12 +603,12 @@ MUnit is MuleSoft's native testing framework. Comprehensive testing is essential
600
603
  <!-- test/munit/orders-api-test-suite.xml -->
601
604
  <munit:test name="create-order-success-test"
602
605
  description="Validates successful order creation">
603
-
606
+
604
607
  <!-- Mock external dependencies -->
605
608
  <munit:behavior>
606
609
  <munit-tools:mock-when processor="http:request">
607
610
  <munit-tools:with-attributes>
608
- <munit-tools:with-attribute attributeName="config-ref"
611
+ <munit-tools:with-attribute attributeName="config-ref"
609
612
  whereValue="Orders_HTTP_Config"/>
610
613
  </munit-tools:with-attributes>
611
614
  <munit-tools:then-return>
@@ -613,15 +616,15 @@ MUnit is MuleSoft's native testing framework. Comprehensive testing is essential
613
616
  </munit-tools:then-return>
614
617
  </munit-tools:mock-when>
615
618
  </munit:behavior>
616
-
619
+
617
620
  <!-- Execute -->
618
621
  <munit:execution>
619
622
  <flow-ref name="create-order-flow"/>
620
623
  </munit:execution>
621
-
624
+
622
625
  <!-- Assert -->
623
626
  <munit:validation>
624
- <munit-tools:assert-that expression="#[payload.orderId]"
627
+ <munit-tools:assert-that expression="#[payload.orderId]"
625
628
  is="#[MunitTools::notNullValue()]"/>
626
629
  </munit:validation>
627
630
  </munit:test>
@@ -678,28 +681,28 @@ jobs:
678
681
  runs-on: ubuntu-latest
679
682
  steps:
680
683
  - uses: actions/checkout@v4
681
-
684
+
682
685
  - name: Set up JDK 11
683
686
  uses: actions/setup-java@v3
684
687
  with:
685
688
  java-version: '11'
686
689
  distribution: 'adopt'
687
-
690
+
688
691
  - name: Cache Maven packages
689
692
  uses: actions/cache@v3
690
693
  with:
691
694
  path: ~/.m2
692
695
  key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
693
-
696
+
694
697
  - name: Build with Maven
695
698
  run: mvn -B clean compile
696
-
699
+
697
700
  - name: Run mule-lint
698
701
  run: npx @sfdxy/mule-lint ./src/main/mule -f sarif -o lint-results.sarif
699
-
702
+
700
703
  - name: Run MUnit tests
701
704
  run: mvn -B test
702
-
705
+
703
706
  - name: Upload SARIF results
704
707
  uses: github/codeql-action/upload-sarif@v2
705
708
  with:
@@ -708,12 +711,12 @@ jobs:
708
711
 
709
712
  ### Git Branch Strategy
710
713
 
711
- | Branch | Purpose | Deployment Target |
712
- |--------|---------|-------------------|
713
- | `main` | Production-ready code | Production |
714
- | `develop` | Integration branch | QA/Staging |
715
- | `feature/*` | New features | Development |
716
- | `hotfix/*` | Production fixes | Production |
714
+ | Branch | Purpose | Deployment Target |
715
+ | ----------- | --------------------- | ----------------- |
716
+ | `main` | Production-ready code | Production |
717
+ | `develop` | Integration branch | QA/Staging |
718
+ | `feature/*` | New features | Development |
719
+ | `hotfix/*` | Production fixes | Production |
717
720
 
718
721
  ---
719
722
 
@@ -776,14 +779,14 @@ Development → QA → Staging → Production
776
779
 
777
780
  ### Deployment Checklist
778
781
 
779
- | Item | Description |
780
- |------|-------------|
781
- | ✅ All tests pass | MUnit and integration tests |
782
- | ✅ Lint checks pass | No errors from mule-lint |
783
- | ✅ Properties configured | Environment YAML verified |
784
- | ✅ Secrets encrypted | No plaintext credentials |
785
- | ✅ API Manager policies | Authentication, rate limiting |
786
- | ✅ Monitoring configured | Dashboards and alerts ready |
782
+ | Item | Description |
783
+ | ------------------------ | ----------------------------- |
784
+ | ✅ All tests pass | MUnit and integration tests |
785
+ | ✅ Lint checks pass | No errors from mule-lint |
786
+ | ✅ Properties configured | Environment YAML verified |
787
+ | ✅ Secrets encrypted | No plaintext credentials |
788
+ | ✅ API Manager policies | Authentication, rate limiting |
789
+ | ✅ Monitoring configured | Dashboards and alerts ready |
787
790
 
788
791
  ### Blue-Green Deployment
789
792
 
@@ -814,11 +817,11 @@ Production applications need comprehensive monitoring.
814
817
 
815
818
  ### The Three Pillars
816
819
 
817
- | Pillar | Tool | Purpose |
818
- |--------|------|---------|
819
- | **Logs** | Anypoint Monitoring, Splunk, ELK | Debug issues, audit trail |
820
- | **Metrics** | Anypoint Monitoring, Grafana | Performance, health status |
821
- | **Traces** | Anypoint Monitoring, Jaeger | Request flow, latency analysis |
820
+ | Pillar | Tool | Purpose |
821
+ | ----------- | -------------------------------- | ------------------------------ |
822
+ | **Logs** | Anypoint Monitoring, Splunk, ELK | Debug issues, audit trail |
823
+ | **Metrics** | Anypoint Monitoring, Grafana | Performance, health status |
824
+ | **Traces** | Anypoint Monitoring, Jaeger | Request flow, latency analysis |
822
825
 
823
826
  ### Key Metrics to Monitor
824
827
 
@@ -839,11 +842,11 @@ Business Metrics:
839
842
 
840
843
  ### Alerting Best Practices
841
844
 
842
- | Alert Level | Condition | Response |
843
- |-------------|-----------|----------|
844
- | **Critical** | Error rate > 10%, App down | Immediate on-call response |
845
- | **Warning** | Error rate > 5%, Latency > 5s | Investigate within 1 hour |
846
- | **Info** | Unusual patterns, Resource > 70% | Review in daily standup |
845
+ | Alert Level | Condition | Response |
846
+ | ------------ | -------------------------------- | -------------------------- |
847
+ | **Critical** | Error rate > 10%, App down | Immediate on-call response |
848
+ | **Warning** | Error rate > 5%, Latency > 5s | Investigate within 1 hour |
849
+ | **Info** | Unusual patterns, Resource > 70% | Review in daily standup |
847
850
 
848
851
  ### Correlation ID Pattern
849
852
 
@@ -851,7 +854,7 @@ Ensure correlation IDs flow through all systems:
851
854
 
852
855
  ```xml
853
856
  <!-- Set correlation ID at entry point -->
854
- <set-variable variableName="correlationId"
857
+ <set-variable variableName="correlationId"
855
858
  value="#[correlationId default uuid()]"/>
856
859
 
857
860
  <!-- Include in all outbound requests -->
@@ -862,7 +865,7 @@ Ensure correlation IDs flow through all systems:
862
865
  </http:request>
863
866
 
864
867
  <!-- Include in all log messages -->
865
- <logger category="com.myorg"
868
+ <logger category="com.myorg"
866
869
  message="#['[' ++ vars.correlationId ++ '] Processing request...']"/>
867
870
  ```
868
871
 
@@ -891,12 +894,11 @@ output application/json
891
894
 
892
895
  This guide covers both linter-enforced practices and general developer guidelines:
893
896
 
894
- | Category | Linter Enforced | General Guidelines |
895
- |----------|-----------------|-------------------|
896
- | Code Quality | ✅ Naming, Structure, Complexity | Testing, Code Review |
897
- | Security | ✅ Hardcoded secrets, TLS | Secrets Management, IAM |
898
- | Operations | ✅ Error handling, Logging | CI/CD, Monitoring, Deployment |
899
- | Architecture | ✅ API-Led patterns | Versioning, Documentation |
897
+ | Category | Linter Enforced | General Guidelines |
898
+ | ------------ | -------------------------------- | ----------------------------- |
899
+ | Code Quality | ✅ Naming, Structure, Complexity | Testing, Code Review |
900
+ | Security | ✅ Hardcoded secrets, TLS | Secrets Management, IAM |
901
+ | Operations | ✅ Error handling, Logging | CI/CD, Monitoring, Deployment |
902
+ | Architecture | ✅ API-Led patterns | Versioning, Documentation |
900
903
 
901
904
  For linter rule details, see the [Rules Catalog](rules-catalog.md).
902
-