@sfdxy/mule-lint 1.20.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -17
- package/dist/package.json +1 -1
- package/dist/src/core/XPathHelper.d.ts.map +1 -1
- package/dist/src/core/XPathHelper.js +8 -0
- package/dist/src/core/XPathHelper.js.map +1 -1
- package/dist/src/engine/LintEngine.d.ts +22 -0
- package/dist/src/engine/LintEngine.d.ts.map +1 -1
- package/dist/src/engine/LintEngine.js +105 -18
- package/dist/src/engine/LintEngine.js.map +1 -1
- package/dist/src/mcp/prompts/index.d.ts +1 -1
- package/dist/src/mcp/prompts/index.d.ts.map +1 -1
- package/dist/src/mcp/prompts/index.js +62 -1
- package/dist/src/mcp/prompts/index.js.map +1 -1
- package/dist/src/mcp/resources/index.js +114 -16
- package/dist/src/mcp/resources/index.js.map +1 -1
- package/dist/src/mcp/tools/getRuleDetails.d.ts.map +1 -1
- package/dist/src/mcp/tools/getRuleDetails.js +30 -1
- package/dist/src/mcp/tools/getRuleDetails.js.map +1 -1
- package/dist/src/rules/api-led/ApikitConsoleProductionRule.d.ts +22 -0
- package/dist/src/rules/api-led/ApikitConsoleProductionRule.d.ts.map +1 -0
- package/dist/src/rules/api-led/ApikitConsoleProductionRule.js +43 -0
- package/dist/src/rules/api-led/ApikitConsoleProductionRule.js.map +1 -0
- package/dist/src/rules/api-led/ApikitMainFlowStructureRule.d.ts +24 -0
- package/dist/src/rules/api-led/ApikitMainFlowStructureRule.d.ts.map +1 -0
- package/dist/src/rules/api-led/ApikitMainFlowStructureRule.js +53 -0
- package/dist/src/rules/api-led/ApikitMainFlowStructureRule.js.map +1 -0
- package/dist/src/rules/api-led/ApikitStatusCodeVariableRule.d.ts +25 -0
- package/dist/src/rules/api-led/ApikitStatusCodeVariableRule.d.ts.map +1 -0
- package/dist/src/rules/api-led/ApikitStatusCodeVariableRule.js +59 -0
- package/dist/src/rules/api-led/ApikitStatusCodeVariableRule.js.map +1 -0
- package/dist/src/rules/connector/EventListenerNullGuardRule.d.ts +24 -0
- package/dist/src/rules/connector/EventListenerNullGuardRule.d.ts.map +1 -0
- package/dist/src/rules/connector/EventListenerNullGuardRule.js +58 -0
- package/dist/src/rules/connector/EventListenerNullGuardRule.js.map +1 -0
- package/dist/src/rules/connector/ReplayChannelConfigRule.d.ts +23 -0
- package/dist/src/rules/connector/ReplayChannelConfigRule.d.ts.map +1 -0
- package/dist/src/rules/connector/ReplayChannelConfigRule.js +52 -0
- package/dist/src/rules/connector/ReplayChannelConfigRule.js.map +1 -0
- package/dist/src/rules/dataweave/DataWeaveRules.d.ts +11 -4
- package/dist/src/rules/dataweave/DataWeaveRules.d.ts.map +1 -1
- package/dist/src/rules/dataweave/DataWeaveRules.js +20 -20
- package/dist/src/rules/dataweave/DataWeaveRules.js.map +1 -1
- package/dist/src/rules/dataweave/DuplicateTransformLogicRule.d.ts +25 -0
- package/dist/src/rules/dataweave/DuplicateTransformLogicRule.d.ts.map +1 -0
- package/dist/src/rules/dataweave/DuplicateTransformLogicRule.js +63 -0
- package/dist/src/rules/dataweave/DuplicateTransformLogicRule.js.map +1 -0
- package/dist/src/rules/error-handling/CatchAllLastRule.d.ts +24 -0
- package/dist/src/rules/error-handling/CatchAllLastRule.d.ts.map +1 -0
- package/dist/src/rules/error-handling/CatchAllLastRule.js +65 -0
- package/dist/src/rules/error-handling/CatchAllLastRule.js.map +1 -0
- package/dist/src/rules/error-handling/ErrorHandlerTypeCoverageRule.d.ts +28 -0
- package/dist/src/rules/error-handling/ErrorHandlerTypeCoverageRule.d.ts.map +1 -0
- package/dist/src/rules/error-handling/ErrorHandlerTypeCoverageRule.js +70 -0
- package/dist/src/rules/error-handling/ErrorHandlerTypeCoverageRule.js.map +1 -0
- package/dist/src/rules/error-handling/ErrorResponseStructureRule.d.ts +23 -0
- package/dist/src/rules/error-handling/ErrorResponseStructureRule.d.ts.map +1 -0
- package/dist/src/rules/error-handling/ErrorResponseStructureRule.js +73 -0
- package/dist/src/rules/error-handling/ErrorResponseStructureRule.js.map +1 -0
- package/dist/src/rules/error-handling/GenericErrorRule.d.ts +15 -3
- package/dist/src/rules/error-handling/GenericErrorRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/GenericErrorRule.js +58 -18
- package/dist/src/rules/error-handling/GenericErrorRule.js.map +1 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts +14 -15
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js +59 -38
- package/dist/src/rules/error-handling/GlobalErrorHandlerRule.js.map +1 -1
- package/dist/src/rules/error-handling/TryScopeRule.d.ts +5 -0
- package/dist/src/rules/error-handling/TryScopeRule.d.ts.map +1 -1
- package/dist/src/rules/error-handling/TryScopeRule.js +30 -7
- package/dist/src/rules/error-handling/TryScopeRule.js.map +1 -1
- package/dist/src/rules/http/ConnectionIdleTimeoutRule.d.ts +27 -0
- package/dist/src/rules/http/ConnectionIdleTimeoutRule.d.ts.map +1 -0
- package/dist/src/rules/http/ConnectionIdleTimeoutRule.js +46 -0
- package/dist/src/rules/http/ConnectionIdleTimeoutRule.js.map +1 -0
- package/dist/src/rules/index.d.ts +1 -1
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +50 -8
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/logging/LoggerPayloadRule.d.ts +15 -0
- package/dist/src/rules/logging/LoggerPayloadRule.d.ts.map +1 -1
- package/dist/src/rules/logging/LoggerPayloadRule.js +48 -4
- package/dist/src/rules/logging/LoggerPayloadRule.js.map +1 -1
- package/dist/src/rules/operations/FlowRefTargetExistsRule.d.ts +23 -0
- package/dist/src/rules/operations/FlowRefTargetExistsRule.d.ts.map +1 -0
- package/dist/src/rules/operations/FlowRefTargetExistsRule.js +58 -0
- package/dist/src/rules/operations/FlowRefTargetExistsRule.js.map +1 -0
- package/dist/src/rules/operations/UnusedFlowRule.d.ts +20 -0
- package/dist/src/rules/operations/UnusedFlowRule.d.ts.map +1 -1
- package/dist/src/rules/operations/UnusedFlowRule.js +73 -7
- package/dist/src/rules/operations/UnusedFlowRule.js.map +1 -1
- package/dist/src/rules/operations/UnusedVariableRule.d.ts +31 -0
- package/dist/src/rules/operations/UnusedVariableRule.d.ts.map +1 -0
- package/dist/src/rules/operations/UnusedVariableRule.js +103 -0
- package/dist/src/rules/operations/UnusedVariableRule.js.map +1 -0
- package/dist/src/rules/performance/ListenerReconnectForeverRule.d.ts +28 -0
- package/dist/src/rules/performance/ListenerReconnectForeverRule.d.ts.map +1 -0
- package/dist/src/rules/performance/ListenerReconnectForeverRule.js +56 -0
- package/dist/src/rules/performance/ListenerReconnectForeverRule.js.map +1 -0
- package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts +7 -4
- package/dist/src/rules/performance/ReconnectionStrategyRule.d.ts.map +1 -1
- package/dist/src/rules/performance/ReconnectionStrategyRule.js +44 -24
- package/dist/src/rules/performance/ReconnectionStrategyRule.js.map +1 -1
- package/dist/src/rules/security/ConnectorCredentialsSecuredRule.d.ts +36 -0
- package/dist/src/rules/security/ConnectorCredentialsSecuredRule.d.ts.map +1 -0
- package/dist/src/rules/security/ConnectorCredentialsSecuredRule.js +124 -0
- package/dist/src/rules/security/ConnectorCredentialsSecuredRule.js.map +1 -0
- package/dist/src/rules/security/HardcodedCredentialsRule.d.ts +4 -0
- package/dist/src/rules/security/HardcodedCredentialsRule.d.ts.map +1 -1
- package/dist/src/rules/security/HardcodedCredentialsRule.js +15 -0
- package/dist/src/rules/security/HardcodedCredentialsRule.js.map +1 -1
- package/dist/src/rules/security/SecurePropertiesEncryptionRule.d.ts +25 -0
- package/dist/src/rules/security/SecurePropertiesEncryptionRule.d.ts.map +1 -0
- package/dist/src/rules/security/SecurePropertiesEncryptionRule.js +59 -0
- package/dist/src/rules/security/SecurePropertiesEncryptionRule.js.map +1 -0
- package/dist/src/rules/security/SecurePropertiesKeyRule.d.ts +23 -0
- package/dist/src/rules/security/SecurePropertiesKeyRule.d.ts.map +1 -0
- package/dist/src/rules/security/SecurePropertiesKeyRule.js +45 -0
- package/dist/src/rules/security/SecurePropertiesKeyRule.js.map +1 -0
- package/dist/src/rules/security/TlsKeystorePasswordRule.d.ts +25 -0
- package/dist/src/rules/security/TlsKeystorePasswordRule.d.ts.map +1 -0
- package/dist/src/rules/security/TlsKeystorePasswordRule.js +63 -0
- package/dist/src/rules/security/TlsKeystorePasswordRule.js.map +1 -0
- package/dist/src/rules/standards/ApikitRouteVariableConsistencyRule.d.ts +26 -0
- package/dist/src/rules/standards/ApikitRouteVariableConsistencyRule.d.ts.map +1 -0
- package/dist/src/rules/standards/ApikitRouteVariableConsistencyRule.js +61 -0
- package/dist/src/rules/standards/ApikitRouteVariableConsistencyRule.js.map +1 -0
- package/dist/src/rules/standards/ConfigPropertiesOrderingRule.d.ts +34 -0
- package/dist/src/rules/standards/ConfigPropertiesOrderingRule.d.ts.map +1 -0
- package/dist/src/rules/standards/ConfigPropertiesOrderingRule.js +76 -0
- package/dist/src/rules/standards/ConfigPropertiesOrderingRule.js.map +1 -0
- package/dist/src/rules/standards/MissingEnvPropertiesDeclarationRule.d.ts +25 -0
- package/dist/src/rules/standards/MissingEnvPropertiesDeclarationRule.d.ts.map +1 -0
- package/dist/src/rules/standards/MissingEnvPropertiesDeclarationRule.js +111 -0
- package/dist/src/rules/standards/MissingEnvPropertiesDeclarationRule.js.map +1 -0
- package/dist/src/rules/yaml/YamlRules.d.ts +6 -2
- package/dist/src/rules/yaml/YamlRules.d.ts.map +1 -1
- package/dist/src/rules/yaml/YamlRules.js +15 -11
- package/dist/src/rules/yaml/YamlRules.js.map +1 -1
- package/dist/src/types/Rule.d.ts +13 -0
- package/dist/src/types/Rule.d.ts.map +1 -1
- package/docs/README.md +87 -27
- package/docs/best-practices/ci-cd.md +135 -0
- package/docs/best-practices/connector-patterns.md +253 -0
- package/docs/best-practices/dataweave-patterns.md +370 -0
- package/docs/best-practices/deployment-2026.md +171 -0
- package/docs/best-practices/error-handling.md +277 -0
- package/docs/best-practices/event-driven-patterns.md +424 -0
- package/docs/best-practices/logging.md +163 -0
- package/docs/best-practices/mulesoft-best-practices.md +72 -865
- package/docs/best-practices/performance.md +273 -0
- package/docs/best-practices/rules-catalog.md +337 -29
- package/docs/best-practices/security.md +181 -0
- package/docs/best-practices/testing.md +190 -0
- package/docs/best-practices/variable-contracts.md +191 -0
- package/docs/linter/architecture.md +119 -64
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YamlRules.d.ts","sourceRoot":"","sources":["../../../../src/rules/yaml/YamlRules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"YamlRules.d.ts","sourceRoot":"","sources":["../../../../src/rules/yaml/YamlRules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,EAAE,SAAc;IAChB,IAAI,SAAkC;IACtC,WAAW,SAA2D;IACtE,QAAQ,EAAG,SAAS,CAAU;IAC9B,QAAQ,EAAG,WAAW,CAAU;IAEhC,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,KAAK,EAAE;CA6C/D;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,EAAE,SAAc;IAChB,IAAI,SAAgC;IACpC,WAAW,SAA0D;IACrE,QAAQ,EAAG,MAAM,CAAU;IAC3B,QAAQ,EAAG,WAAW,CAAU;IAEhC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,KAAK,EAAE;IA6B7D,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,aAAa;CAuBtB;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,EAAE,SAAc;IAChB,IAAI,SAA0B;IAC9B,WAAW,SAA0D;IACrE,QAAQ,EAAG,OAAO,CAAU;IAC5B,QAAQ,EAAG,UAAU,CAAU;IAC/B,SAAS,EAAE,SAAS,CAAmB;IAEvC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,KAAK,EAAE;IAuB7D,OAAO,CAAC,wBAAwB;IA6BhC,OAAO,CAAC,aAAa;CAuBtB"}
|
|
@@ -37,19 +37,23 @@ exports.PlaintextSecretsRule = exports.PropertyNamingRule = exports.EnvironmentF
|
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
39
|
const BaseRule_1 = require("../base/BaseRule");
|
|
40
|
+
const ProjectRule_1 = require("../base/ProjectRule");
|
|
40
41
|
const YamlParser_1 = require("../../core/YamlParser");
|
|
41
42
|
/**
|
|
42
43
|
* YAML-001: Environment Properties Files
|
|
43
44
|
*
|
|
44
45
|
* Checks that environment-specific YAML files exist.
|
|
46
|
+
*
|
|
47
|
+
* This is a ProjectRule — it runs once per scan to avoid producing
|
|
48
|
+
* N identical issues (one per XML file).
|
|
45
49
|
*/
|
|
46
|
-
class EnvironmentFilesRule extends
|
|
50
|
+
class EnvironmentFilesRule extends ProjectRule_1.ProjectRule {
|
|
47
51
|
id = 'YAML-001';
|
|
48
52
|
name = 'Environment Properties Files';
|
|
49
53
|
description = 'Environment-specific YAML property files should exist';
|
|
50
54
|
severity = 'warning';
|
|
51
55
|
category = 'standards';
|
|
52
|
-
|
|
56
|
+
validateProject(context) {
|
|
53
57
|
const issues = [];
|
|
54
58
|
const configDir = path.join(context.projectRoot, 'src/main/resources');
|
|
55
59
|
const configSubDir = path.join(configDir, 'config');
|
|
@@ -77,13 +81,9 @@ class EnvironmentFilesRule extends BaseRule_1.BaseRule {
|
|
|
77
81
|
existingFiles.has(`config-${env}.yml`) ||
|
|
78
82
|
existingFiles.has(`${env}-properties.yaml`);
|
|
79
83
|
if (!hasEnvFile) {
|
|
80
|
-
issues.push({
|
|
81
|
-
line: 1,
|
|
82
|
-
message: `Missing environment properties file for "${env}"`,
|
|
83
|
-
ruleId: this.id,
|
|
84
|
-
severity: this.severity,
|
|
84
|
+
issues.push(this.createProjectIssue(`Missing environment properties file for "${env}"`, {
|
|
85
85
|
suggestion: `Create ${env}.yaml or config-${env}.yaml in src/main/resources/`,
|
|
86
|
-
});
|
|
86
|
+
}));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
return issues;
|
|
@@ -127,9 +127,13 @@ class PropertyNamingRule extends BaseRule_1.BaseRule {
|
|
|
127
127
|
isValidPropertyName(key) {
|
|
128
128
|
// Valid: db.host, api.client.timeout, http.port, salesforce.authorizationUrl
|
|
129
129
|
// Valid: external-sapi.basepath, ramp.polling.max_retries
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
|
|
130
|
+
// Valid: netsuite.NSQLPath (uppercase segments for vendor conventions)
|
|
131
|
+
// Invalid: completely random strings without dots (unless single word key)
|
|
132
|
+
//
|
|
133
|
+
// Each segment must start with a letter (any case) and can contain
|
|
134
|
+
// letters, digits, underscores, and hyphens. Segments are separated by dots.
|
|
135
|
+
return (/^[a-zA-Z][a-zA-Z0-9_-]*(\.[a-zA-Z][a-zA-Z0-9_-]*)+$/.test(key) ||
|
|
136
|
+
/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(key)); // Single word keys OK too
|
|
133
137
|
}
|
|
134
138
|
findYamlFiles(dir) {
|
|
135
139
|
const files = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YamlRules.js","sourceRoot":"","sources":["../../../../src/rules/yaml/YamlRules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,+CAA4C;AAC5C,sDAAmD;AAEnD
|
|
1
|
+
{"version":3,"file":"YamlRules.js","sourceRoot":"","sources":["../../../../src/rules/yaml/YamlRules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,+CAA4C;AAC5C,qDAAkD;AAClD,sDAAmD;AAEnD;;;;;;;GAOG;AACH,MAAa,oBAAqB,SAAQ,yBAAW;IACnD,EAAE,GAAG,UAAU,CAAC;IAChB,IAAI,GAAG,8BAA8B,CAAC;IACtC,WAAW,GAAG,uDAAuD,CAAC;IACtE,QAAQ,GAAG,SAAkB,CAAC;IAC9B,QAAQ,GAAG,WAAoB,CAAC;IAEtB,eAAe,CAAC,OAA0B;QAClD,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;QACvE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACpD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAEzD,kDAAkD;QAClD,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5F,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,EAAE,CAAC,CAAC,4BAA4B;QACzC,CAAC;QAED,MAAM,YAAY,GA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CAAC,CAAC;gBAC9C,CAAC;qBAAM,IAAI,uBAAU,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC7C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,yBAAyB;QAC3B,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAnFD,oDAmFC"}
|
package/dist/src/types/Rule.d.ts
CHANGED
|
@@ -43,6 +43,11 @@ export interface RuleConfig {
|
|
|
43
43
|
/** Rule-specific options */
|
|
44
44
|
options?: Record<string, unknown>;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Detected project layer in MuleSoft API-led connectivity architecture.
|
|
48
|
+
* Used to auto-adjust rule severity and enable/disable rules per layer.
|
|
49
|
+
*/
|
|
50
|
+
export type ProjectLayer = 'sapi' | 'papi' | 'eapi' | 'library' | 'batch' | 'unknown';
|
|
46
51
|
/**
|
|
47
52
|
* Project-level context derived from a pre-scan of all files.
|
|
48
53
|
* Populated by LintEngine before per-file rule execution.
|
|
@@ -52,6 +57,8 @@ export interface ProjectContext {
|
|
|
52
57
|
hasHttpListener: boolean;
|
|
53
58
|
/** True if any file contains an apikit:router or apikit:console element */
|
|
54
59
|
hasApikitRouter: boolean;
|
|
60
|
+
/** Detected project layer based on naming conventions and content */
|
|
61
|
+
projectLayer?: ProjectLayer;
|
|
55
62
|
}
|
|
56
63
|
/**
|
|
57
64
|
* Context passed to each rule during validation
|
|
@@ -71,6 +78,12 @@ export interface ValidationContext {
|
|
|
71
78
|
* When undefined (e.g. standalone file scan), intra-file refs only.
|
|
72
79
|
*/
|
|
73
80
|
allFlowRefs?: Set<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Set of all flow/sub-flow names defined across all project files.
|
|
83
|
+
* Populated during the LintEngine pre-scan phase.
|
|
84
|
+
* Used by HYG-004 (FlowRefTargetExistsRule) for cross-file validation.
|
|
85
|
+
*/
|
|
86
|
+
allFlowNames?: Set<string>;
|
|
74
87
|
/**
|
|
75
88
|
* Project-level feature flags derived from a pre-scan of all files.
|
|
76
89
|
* Rules that only apply to HTTP-exposed projects (e.g. MULE-005) should
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../../src/types/Rule.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,gBAAgB,GAChB,QAAQ,GACR,UAAU,GACV,SAAS,GACT,MAAM,GACN,aAAa,GACb,eAAe,GACf,WAAW,GACX,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,cAAc,CAAC;AAEnB;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,eAAe,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACn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|
|
|
3
|
-
Welcome to the Mule-Lint documentation. This documentation is organized into two sections:
|
|
3
|
+
Welcome to the Mule-Lint documentation. This documentation is organized into two sections: **MuleSoft Best Practices** (for integration developers and AI agents) and **Linter Technical Documentation** (for mule-lint contributors).
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## 📘 MuleSoft Best Practices
|
|
8
8
|
|
|
9
|
-
Comprehensive guidelines for building maintainable, secure, and performant Mule applications.
|
|
9
|
+
Comprehensive guidelines for building maintainable, secure, and performant Mule 4 applications. Each guide is a focused, self-contained reference that can be read independently.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
|
14
|
-
|
|
|
11
|
+
### Core Development
|
|
12
|
+
|
|
13
|
+
| Document | Description |
|
|
14
|
+
| ----------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
15
|
+
| [Best Practices Index](best-practices/mulesoft-best-practices.md) | Master index with quick reference card and API-Led overview |
|
|
16
|
+
| [Error Handling](best-practices/error-handling.md) | Global error handlers, HTTP vs. event-driven patterns, connector error types, CRM error log objects |
|
|
17
|
+
| [Variable Contracts](best-practices/variable-contracts.md) | Standard variables, correlation IDs, array mirroring, action routing |
|
|
18
|
+
| [Logging](best-practices/logging.md) | Categories, structured JSON logging, MDC/tracing, PII prevention |
|
|
19
|
+
| [Security](best-practices/security.md) | Secure properties, TLS 1.2+, credentials, zero-trust architecture |
|
|
20
|
+
| [Performance](best-practices/performance.md) | Timeouts, connection pooling, async error handling, streaming, bulk lookup (N+1 prevention) |
|
|
21
|
+
|
|
22
|
+
### Architecture & Patterns
|
|
23
|
+
|
|
24
|
+
| Document | Description |
|
|
25
|
+
| ---------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
26
|
+
| [Event-Driven Patterns](best-practices/event-driven-patterns.md) | Platform Events, Anypoint MQ, VM Queue Dispatcher, scheduler watermarking, deferred task polling |
|
|
27
|
+
| [Connector Patterns](best-practices/connector-patterns.md) | Entity config YAML, SF/NS connector gotchas, protocol negotiation, ObjectStore caching |
|
|
28
|
+
| [DataWeave Patterns](best-practices/dataweave-patterns.md) | Modules, type coercion, cross-system value mapping (4 strategies), import path rules |
|
|
29
|
+
|
|
30
|
+
### Project & Operations
|
|
31
|
+
|
|
32
|
+
| Document | Description |
|
|
33
|
+
| -------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
34
|
+
| [Folder Structure](best-practices/folder-structure.md) | Standard Maven layout for Mule 4 projects |
|
|
35
|
+
| [Documentation Standards](best-practices/documentation-standards.md) | Flow documentation, README templates, commit messages |
|
|
36
|
+
| [Testing (MUnit)](best-practices/testing.md) | Test structure, error scenario testing, event-driven testing |
|
|
37
|
+
| [CI/CD Integration](best-practices/ci-cd.md) | Pipeline stages, mule-lint integration, quality gates |
|
|
38
|
+
| [Deployment & Modernization](best-practices/deployment-2026.md) | CloudHub 2.0, Java 17, Anypoint Code Builder, API Governance |
|
|
39
|
+
|
|
40
|
+
### Reference
|
|
41
|
+
|
|
42
|
+
| Document | Description |
|
|
43
|
+
| ------------------------------------------------ | ------------------------------------------------------ |
|
|
44
|
+
| [Rules Catalog](best-practices/rules-catalog.md) | Complete reference for all 82 lint rules with examples |
|
|
15
45
|
|
|
16
46
|
---
|
|
17
47
|
|
|
@@ -19,13 +49,14 @@ Comprehensive guidelines for building maintainable, secure, and performant Mule
|
|
|
19
49
|
|
|
20
50
|
For contributors and those extending mule-lint.
|
|
21
51
|
|
|
22
|
-
| Document | Description
|
|
23
|
-
| -------------------------------------------------- |
|
|
24
|
-
| [Architecture](linter/architecture.md) | System design, patterns, and data flow
|
|
25
|
-
| [Rule Engine](linter/rule-engine.md) | Rule engine internals and interfaces
|
|
26
|
-
| [Extending](linter/extending.md) | How to create custom rules
|
|
27
|
-
| [Folder Structure](linter/folder-structure.md) |
|
|
28
|
-
| [Naming Conventions](linter/naming-conventions.md) | Code style and naming standards
|
|
52
|
+
| Document | Description |
|
|
53
|
+
| -------------------------------------------------- | ------------------------------------------------ |
|
|
54
|
+
| [Architecture](linter/architecture.md) | System design, patterns, and data flow |
|
|
55
|
+
| [Rule Engine](linter/rule-engine.md) | Rule engine internals and interfaces |
|
|
56
|
+
| [Extending](linter/extending.md) | How to create custom rules |
|
|
57
|
+
| [Folder Structure](linter/folder-structure.md) | Linter project organization |
|
|
58
|
+
| [Naming Conventions](linter/naming-conventions.md) | Code style and naming standards |
|
|
59
|
+
| [MCP Design](mcp-design.md) | MCP server architecture and tool/resource design |
|
|
29
60
|
|
|
30
61
|
---
|
|
31
62
|
|
|
@@ -72,25 +103,54 @@ mule-lint ./src/main/mule --fail-on-warning
|
|
|
72
103
|
|
|
73
104
|
## Rule Families
|
|
74
105
|
|
|
75
|
-
| Family | Prefix | Count | Description
|
|
76
|
-
| --------------- | ------------------------- | ----- |
|
|
77
|
-
| Core MuleSoft | MULE-XXX | 29 | Core Mule 4 XML validation
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
87
|
-
|
|
106
|
+
| Family | Prefix | Count | Description |
|
|
107
|
+
| --------------- | ------------------------- | ----- | -------------------------------------------- |
|
|
108
|
+
| Core MuleSoft | MULE-XXX | 29 | Core Mule 4 XML validation |
|
|
109
|
+
| Error Handling | ERR-XXX | 4 | Advanced error handler rules |
|
|
110
|
+
| Security | SEC-XXX | 5 | Security best practices (TLS, rate limiting) |
|
|
111
|
+
| Logging | LOG-XXX, HYG-001 | 3 | Structured logging and sensitive data |
|
|
112
|
+
| HTTP | HTTP-XXX | 1 | HTTP connector configuration |
|
|
113
|
+
| Operations | OPS-XXX, RES-XXX, HYG-XXX | 8 | Reconnection, auto-discovery, hygiene |
|
|
114
|
+
| YAML Properties | YAML-XXX | 3 | YAML configuration validation |
|
|
115
|
+
| DataWeave | DW-XXX | 5 | DataWeave file validation |
|
|
116
|
+
| API-Led | API-XXX | 7 | API-Led connectivity patterns |
|
|
117
|
+
| Connectors | SF-XXX | 2 | Salesforce and event connector rules |
|
|
118
|
+
| Standards | CFG-XXX, STD-XXX | 3 | Config and API standards |
|
|
119
|
+
| Governance | PROJ-XXX | 2 | POM and Git hygiene |
|
|
120
|
+
| Experimental | EXP-XXX | 3 | Beta rules for evaluation |
|
|
121
|
+
|
|
122
|
+
**Total: 82 rules**
|
|
88
123
|
|
|
89
124
|
---
|
|
90
125
|
|
|
91
126
|
## For AI Agents
|
|
92
127
|
|
|
93
|
-
|
|
128
|
+
### MCP Resources
|
|
129
|
+
|
|
130
|
+
All best practice guides are available via the MuleSoft Lint MCP server:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
mule-lint://rules → JSON catalog of all 82 rules
|
|
134
|
+
mule-lint://docs/best-practices → Master index and quick reference
|
|
135
|
+
mule-lint://docs/error-handling → Error handling patterns
|
|
136
|
+
mule-lint://docs/event-driven → Event-driven architecture
|
|
137
|
+
mule-lint://docs/connectors → Connector configuration
|
|
138
|
+
mule-lint://docs/variables → Variable contracts
|
|
139
|
+
mule-lint://docs/dataweave → DataWeave patterns
|
|
140
|
+
mule-lint://docs/security → Security best practices
|
|
141
|
+
mule-lint://docs/logging → Logging standards
|
|
142
|
+
mule-lint://docs/performance → Performance optimization
|
|
143
|
+
mule-lint://docs/testing → MUnit testing
|
|
144
|
+
mule-lint://docs/deployment → Deployment & modernization
|
|
145
|
+
mule-lint://docs/ci-cd → CI/CD integration
|
|
146
|
+
mule-lint://docs/folder-structure → Project structure
|
|
147
|
+
mule-lint://docs/documentation-standards → Documentation standards
|
|
148
|
+
mule-lint://docs/rules-catalog → Complete rules reference
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### SARIF Output
|
|
152
|
+
|
|
153
|
+
Use SARIF output for structured results:
|
|
94
154
|
|
|
95
155
|
```bash
|
|
96
156
|
mule-lint ./src/main/mule -f sarif > report.sarif
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# CI/CD Integration
|
|
2
|
+
|
|
3
|
+
> **Applies to:** All
|
|
4
|
+
> **Related Rules:** `PROJ-001` · `PROJ-002`
|
|
5
|
+
> **Last Updated:** April 2026
|
|
6
|
+
|
|
7
|
+
## When to Read This
|
|
8
|
+
|
|
9
|
+
Read this when setting up CI/CD pipelines, integrating mule-lint into builds, or configuring quality gates.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Pipeline Stages
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
17
|
+
│ Build │ → │ Lint │ → │ Test │ → │ Package │ → │ Deploy │
|
|
18
|
+
│ │ │ │ │ │ │ │ │ │
|
|
19
|
+
│ mvn │ │ mule- │ │ mvn test │ │ mvn │ │ anypoint │
|
|
20
|
+
│ compile │ │ lint │ │ │ │ package │ │ deploy │
|
|
21
|
+
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## mule-lint Integration
|
|
27
|
+
|
|
28
|
+
### Quality Gate Configuration
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
// .mulelintrc.json
|
|
32
|
+
{
|
|
33
|
+
"include": ["src/main/mule/**/*.xml"],
|
|
34
|
+
"exclude": ["src/test/munit/**/*.xml"],
|
|
35
|
+
"qualityGate": {
|
|
36
|
+
"name": "Project Quality Gate",
|
|
37
|
+
"conditions": [
|
|
38
|
+
{ "metric": "errors", "operator": ">", "threshold": 0, "status": "fail" },
|
|
39
|
+
{ "metric": "warnings", "operator": ">", "threshold": 10, "status": "warn" }
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"rules": {
|
|
43
|
+
"MULE-001": {
|
|
44
|
+
"enabled": false,
|
|
45
|
+
"reason": "Global error handler in non-standard location — documented exception"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Rule suppression:** When disabling a rule, always include a `reason` or `comment` field explaining why. This documents the engineering decision for future reviewers.
|
|
52
|
+
|
|
53
|
+
### Output Formats
|
|
54
|
+
|
|
55
|
+
| Format | Use Case | Command |
|
|
56
|
+
| -------- | ------------------------------- | ------------------------------------ |
|
|
57
|
+
| `pretty` | Local development | `mule-lint . -f pretty` |
|
|
58
|
+
| `json` | CI/CD parsing | `mule-lint . -f json` |
|
|
59
|
+
| `sarif` | GitHub Code Scanning, AI agents | `mule-lint . -f sarif -o lint.sarif` |
|
|
60
|
+
| `html` | Human review reports | `mule-lint . -f html -o report.html` |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## GitHub Actions Example
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
name: Mule CI/CD
|
|
68
|
+
|
|
69
|
+
on:
|
|
70
|
+
push:
|
|
71
|
+
branches: [main, develop]
|
|
72
|
+
pull_request:
|
|
73
|
+
branches: [main]
|
|
74
|
+
|
|
75
|
+
jobs:
|
|
76
|
+
build-and-test:
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
steps:
|
|
79
|
+
- uses: actions/checkout@v4
|
|
80
|
+
|
|
81
|
+
- name: Set up JDK 17
|
|
82
|
+
uses: actions/setup-java@v4
|
|
83
|
+
with:
|
|
84
|
+
java-version: '17'
|
|
85
|
+
distribution: 'temurin'
|
|
86
|
+
|
|
87
|
+
- name: Cache Maven packages
|
|
88
|
+
uses: actions/cache@v4
|
|
89
|
+
with:
|
|
90
|
+
path: ~/.m2
|
|
91
|
+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
92
|
+
|
|
93
|
+
- name: Build
|
|
94
|
+
run: mvn -B clean compile
|
|
95
|
+
|
|
96
|
+
- name: Run mule-lint
|
|
97
|
+
run: npx @sfdxy/mule-lint . -c .mulelintrc.json -f sarif -o lint.sarif
|
|
98
|
+
|
|
99
|
+
- name: Upload SARIF results
|
|
100
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
101
|
+
with:
|
|
102
|
+
sarif_file: lint.sarif
|
|
103
|
+
|
|
104
|
+
- name: Run MUnit tests
|
|
105
|
+
run: mvn -B test -Dmule.env=dev -Dsecure.key=test
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Git Branch Strategy
|
|
111
|
+
|
|
112
|
+
| Branch | Purpose | Deployment Target |
|
|
113
|
+
| ----------- | --------------------- | ----------------- |
|
|
114
|
+
| `main` | Production-ready code | Production |
|
|
115
|
+
| `develop` | Integration branch | QA/Staging |
|
|
116
|
+
| `feature/*` | New features | Development |
|
|
117
|
+
| `hotfix/*` | Production fixes | Production |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Commit Messages
|
|
122
|
+
|
|
123
|
+
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
feat: add new order processing logic
|
|
127
|
+
fix: resolve null pointer in mapping
|
|
128
|
+
docs: update README with deployment steps
|
|
129
|
+
chore: upgrade mule maven plugin
|
|
130
|
+
refactor: extract common DWL functions to module
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
**See also:** [Testing](testing.md) · [Deployment & Modernization](deployment-2026.md) · [Folder Structure](folder-structure.md)
|