dependency-cruiser 18.0.0 → 18.1.1

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 (111) hide show
  1. package/configs/plugins/3d-reporter-plugin.mjs +1 -1
  2. package/configs/plugins/stats-reporter-plugin.mjs +2 -2
  3. package/package.json +5 -5
  4. package/src/analyze/add-validations.mjs +1 -1
  5. package/src/analyze/derive/folders/utl.mjs +2 -2
  6. package/src/analyze/summarize/index.mjs +121 -4
  7. package/src/analyze/summarize/summarize-modules.mjs +1 -1
  8. package/src/cache/cache.mjs +5 -5
  9. package/src/cache/helpers.mjs +2 -2
  10. package/src/cli/format-meta-info.mjs +12 -14
  11. package/src/cli/index.mjs +3 -4
  12. package/src/cli/init-config/check-and-warn-inconsistencies.mjs +3 -3
  13. package/src/cli/init-config/environment-helpers.mjs +4 -4
  14. package/src/cli/init-config/get-user-input.mjs +1 -1
  15. package/src/cli/init-config/index.mjs +1 -1
  16. package/src/cli/init-config/normalize-init-options.mjs +3 -3
  17. package/src/cli/init-config/validators.mjs +1 -1
  18. package/src/cli/init-config/write-run-scripts-to-manifest.mjs +2 -2
  19. package/src/cli/listeners/ndjson.mjs +1 -1
  20. package/src/cli/listeners/performance-log/index.mjs +1 -1
  21. package/src/cli/normalize-cli-options.mjs +6 -4
  22. package/src/cli/utl/assert-file-existence.mjs +1 -1
  23. package/src/config-utl/extract-babel-config.mjs +3 -1
  24. package/src/config-utl/extract-depcruise-config/index.mjs +1 -1
  25. package/src/config-utl/extract-depcruise-config/merge-configs.mjs +5 -3
  26. package/src/config-utl/extract-ts-config.mjs +1 -1
  27. package/src/config-utl/extract-webpack-resolve-config.mjs +2 -2
  28. package/src/environment.mjs +17 -0
  29. package/src/extract/acorn/extract.mjs +1 -1
  30. package/src/extract/acorn/parse.mjs +2 -2
  31. package/src/extract/extract-dependencies.mjs +1 -1
  32. package/src/extract/extract-stats.mjs +1 -1
  33. package/src/extract/gather-initial-sources.mjs +1 -1
  34. package/src/extract/helpers.mjs +1 -1
  35. package/src/extract/index.mjs +1 -1
  36. package/src/extract/resolve/determine-dependency-types.mjs +3 -2
  37. package/src/extract/resolve/external-module-helpers.mjs +8 -8
  38. package/src/extract/resolve/get-manifest.mjs +7 -7
  39. package/src/extract/resolve/index.mjs +2 -1
  40. package/src/extract/resolve/merge-manifests.mjs +2 -2
  41. package/src/extract/resolve/module-classifiers.mjs +1 -1
  42. package/src/extract/resolve/resolve-amd.mjs +1 -1
  43. package/src/extract/resolve/resolve-cjs.mjs +2 -2
  44. package/src/extract/resolve/resolve-helpers.mjs +1 -1
  45. package/src/extract/resolve/resolve.mjs +2 -2
  46. package/src/extract/swc/dependency-visitor.mjs +1 -0
  47. package/src/extract/swc/parse.mjs +2 -2
  48. package/src/extract/transpile/index.mjs +1 -1
  49. package/src/extract/transpile/meta.mjs +1 -1
  50. package/src/extract/transpile/try-import-available.mjs +1 -1
  51. package/src/extract/transpile/typescript-wrap.mjs +1 -1
  52. package/src/extract/tsc/extract-typescript-deps.mjs +1 -1
  53. package/src/extract/tsc/parse.mjs +3 -3
  54. package/src/graph-utl/add-focus.mjs +1 -1
  55. package/src/graph-utl/consolidate-to-pattern.mjs +1 -0
  56. package/src/graph-utl/indexed-module-graph.mjs +6 -6
  57. package/src/graph-utl/module-graph-with-dependency-set.mjs +1 -1
  58. package/src/graph-utl/rule-set.mjs +3 -3
  59. package/src/main/cruise.mjs +1 -1
  60. package/src/main/helpers.mjs +1 -1
  61. package/src/main/options/normalize.mjs +2 -2
  62. package/src/main/report-wrap.mjs +1 -0
  63. package/src/main/resolve-options/normalize.mjs +2 -2
  64. package/src/main/rule-set/assert-validity.mjs +1 -1
  65. package/src/main/rule-set/normalize.mjs +1 -1
  66. package/src/meta.cjs +1 -1
  67. package/src/report/anon/anonymize-path-element.mjs +1 -1
  68. package/src/report/anon/index.mjs +1 -1
  69. package/src/report/anon/random-string.mjs +1 -1
  70. package/src/report/azure-devops.mjs +2 -2
  71. package/src/report/baseline.mjs +1 -1
  72. package/src/report/d2.mjs +3 -3
  73. package/src/report/dot/index.mjs +1 -1
  74. package/src/report/dot/module-utl.mjs +2 -2
  75. package/src/report/dot/theming.mjs +12 -6
  76. package/src/report/dot-webpage/svg-in-html-snippets/script.cjs +7 -7
  77. package/src/report/error-html/error-html-template.mjs +7 -0
  78. package/src/report/error.mjs +33 -2
  79. package/src/report/html/index.mjs +2 -2
  80. package/src/report/index.mjs +1 -0
  81. package/src/report/markdown.mjs +3 -3
  82. package/src/report/mermaid.mjs +3 -3
  83. package/src/report/metrics.mjs +2 -2
  84. package/src/report/plugins.mjs +2 -1
  85. package/src/report/teamcity.mjs +2 -2
  86. package/src/report/utl/dependency-to-incidence-transformer.mjs +1 -1
  87. package/src/report/utl/index.mjs +1 -1
  88. package/src/schema/cruise-result.validate.mjs +1 -1
  89. package/src/utl/array-util.mjs +1 -1
  90. package/src/utl/find-all-files.mjs +1 -1
  91. package/src/utl/get-extension.mjs +1 -1
  92. package/src/utl/path-to-posix.mjs +1 -1
  93. package/src/utl/regex-util.mjs +4 -2
  94. package/src/utl/try-import.mjs +1 -1
  95. package/src/utl/try-require.cjs +3 -3
  96. package/src/validate/index.mjs +2 -2
  97. package/types/config-utl/extract-babel-config.d.mts +1 -1
  98. package/types/config-utl/extract-depcruise-config.d.mts +1 -1
  99. package/types/config-utl/extract-depcruise-options.d.mts +1 -1
  100. package/types/config-utl/extract-ts-config.d.mts +1 -1
  101. package/types/config-utl/extract-webpack-resolve-config.d.mts +1 -1
  102. package/types/cruise-result.d.mts +27 -0
  103. package/types/dependency-cruiser.d.mts +5 -26
  104. package/types/environment.d.mts +29 -0
  105. package/types/options.d.mts +1 -4
  106. package/types/plugins/3d-reporter-plugin.d.mts +1 -1
  107. package/types/plugins/mermaid-reporter-plugin.d.mts +1 -1
  108. package/types/plugins/stats-reporter-plugin.d.mts +1 -1
  109. package/types/rule-set.d.mts +2 -5
  110. package/types/shared-types.d.mts +1 -5
  111. package/types/strict-rule-set.d.mts +2 -5
@@ -45,7 +45,7 @@ function normalizeReporterOptions(pReporterOptions) {
45
45
  }
46
46
 
47
47
  function normalizeFilterOptions(pOptions, pFilterOptionKeys) {
48
- let lReturnValue = { ...pOptions };
48
+ const lReturnValue = { ...pOptions };
49
49
 
50
50
  for (const lFilterOptionKey of pFilterOptionKeys) {
51
51
  if (pOptions[lFilterOptionKey]) {
@@ -74,7 +74,7 @@ function normalizeCollapse(pCollapse) {
74
74
 
75
75
  function normalizeFocusDepth(pFormatOptions) {
76
76
  /** @type {IFormatOptions}*/
77
- let lFormatOptions = structuredClone(pFormatOptions);
77
+ const lFormatOptions = structuredClone(pFormatOptions);
78
78
  if (Object.hasOwn(lFormatOptions, "focusDepth")) {
79
79
  if (lFormatOptions?.focus) {
80
80
  lFormatOptions.focus.depth = Number.parseInt(
@@ -39,6 +39,7 @@ function reSummarizeResults(pResult, pFormatOptions) {
39
39
  // TODO: apply filters to the folders too
40
40
  pResult.folders,
41
41
  ),
42
+ environment: pResult.summary.environment,
42
43
  },
43
44
  modules: lModules,
44
45
  };
@@ -37,7 +37,7 @@ const DEFAULT_RESOLVE_OPTIONS = {
37
37
 
38
38
  function omit(pObject, pProperty) {
39
39
  const lObject = structuredClone(pObject);
40
- // eslint-disable-next-line security/detect-object-injection
40
+ /* oxlint-disable-next-line no-dynamic-delete */
41
41
  delete lObject[pProperty];
42
42
  return lObject;
43
43
  }
@@ -71,7 +71,7 @@ async function compileResolveOptions(
71
71
  pTSConfig,
72
72
  pResolveOptionsFromDCConfig,
73
73
  ) {
74
- let lResolveOptions = {};
74
+ const lResolveOptions = {};
75
75
 
76
76
  // There's a performance impact of ~1 ms per resolve even when there
77
77
  // are 0 paths in the tsconfig, so not loading it when not necessary
@@ -76,7 +76,7 @@ function assertRuleSafety(pRule) {
76
76
  * Throws an Error in all other cases.
77
77
  *
78
78
  * @param {IConfiguration} pConfiguration The configuration to validate
79
- * @return {IConfiguration} The configuration as passed
79
+ * @returns {IConfiguration} The configuration as passed
80
80
  * @throws {Error} An error with the reason for the error as a message
81
81
  */
82
82
  export default function assertRuleSetValid(pConfiguration) {
@@ -111,7 +111,7 @@ function normalizeRule(pRule) {
111
111
  * - severity (default 'warn')
112
112
  *
113
113
  * @param {IFlattenedRuleSet} pRuleSet
114
- * @return {IStrictRuleSet}
114
+ * @returns {IStrictRuleSet}
115
115
  */
116
116
  export default function normalizeRuleSet(pRuleSet) {
117
117
  bus.debug("startup: parse rule set: normalize");
package/src/meta.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /* generated - don't edit */
2
2
  module.exports = {
3
- version: "18.0.0",
3
+ version: "18.1.1",
4
4
  engines: {
5
5
  node: "^22||^24||>=26",
6
6
  },
@@ -37,7 +37,7 @@ function replaceFromWordList(pPathElement, pWordList, pCached) {
37
37
  * @param {string[]} pWordList words to pick from
38
38
  * @param {RegExp} pWhiteListRE pattern not to anonymize
39
39
  * @param {boolean} pCached caches the replaced value, with pPathElement as the key
40
- * @return {string} the path element, anonymized if it isn't whitelisted
40
+ * @returns {string} the path element, anonymized if it isn't whitelisted
41
41
  */
42
42
  export function anonymizePathElement(
43
43
  pPathElement,
@@ -179,7 +179,7 @@ function sanitizeWordList(pWordList) {
179
179
  */
180
180
  export default function reportAnonymous(pResults, pAnonymousReporterOptions) {
181
181
  /** @type {{wordlist?: String[]}} */
182
- let lAnonymousReporterOptions = pAnonymousReporterOptions || {};
182
+ const lAnonymousReporterOptions = pAnonymousReporterOptions || {};
183
183
  if (!lAnonymousReporterOptions.wordlist) {
184
184
  lAnonymousReporterOptions.wordlist =
185
185
  pResults?.summary?.optionsUsed?.reporterOptions?.anon?.wordlist ?? [];
@@ -51,7 +51,7 @@ function getRandomChar(pChar) {
51
51
  * pulp2slurp => jgyb3guyow
52
52
  *
53
53
  * @param {string} pString - any string
54
- * @return {string} - a random string with above specs
54
+ * @returns {string} - a random string with above specs
55
55
  */
56
56
  export default function getRandomString(pString) {
57
57
  return Array.from(pString).map(getRandomChar).join("");
@@ -80,7 +80,7 @@ function formatViolation(pViolation) {
80
80
  reachability: formatReachabilityViolation,
81
81
  instability: formatInstabilityViolation,
82
82
  };
83
- let lFormattedViolators = _formatViolation(
83
+ const lFormattedViolators = _formatViolation(
84
84
  pViolation,
85
85
  lViolationType2Formatter,
86
86
  formatDependencyViolation,
@@ -133,7 +133,7 @@ function formatIgnoreWarning(pNumberOfIgnored) {
133
133
  * @returns {string}
134
134
  */
135
135
  function formatResultMessage(pSummary) {
136
- let lStatSummary = `${pSummary.totalCruised} modules, ${
136
+ const lStatSummary = `${pSummary.totalCruised} modules, ${
137
137
  pSummary?.totalDependenciesCruised ?? 0
138
138
  } dependencies cruised`;
139
139
 
@@ -7,7 +7,7 @@ const EOL = "\n";
7
7
  * @param {import('../../types/dependency-cruiser').ICruiseResult} pCruiseResult -
8
8
  * the output of a dependency-cruise adhering to dependency-cruiser's
9
9
  * cruise result schema
10
- * @return {import('../../types/dependency-cruiser').IReporterOutput} -
10
+ * @returns {import('../../types/dependency-cruiser').IReporterOutput} -
11
11
  * output: some stats on modules and dependencies in json format
12
12
  * exitCode: 0
13
13
  */
package/src/report/d2.mjs CHANGED
@@ -32,7 +32,7 @@ function getMaxSeverity(pRules) {
32
32
 
33
33
  /**
34
34
  * @param {string} pSource
35
- * @return {string}
35
+ * @returns {string}
36
36
  */
37
37
  function getVertexName(pSource) {
38
38
  const lFolderName = dirname(pSource)
@@ -117,7 +117,7 @@ function getDependencyAttributes(pDependency) {
117
117
 
118
118
  /**
119
119
  * @param {import('../../types/cruise-result').ICruiseResult} pCruiseResult
120
- * @return {string}
120
+ * @returns {string}
121
121
  */
122
122
  function renderD2Source(pCruiseResult) {
123
123
  const lVertices = pCruiseResult.modules
@@ -153,7 +153,7 @@ function renderD2Source(pCruiseResult) {
153
153
  * d2 reporter
154
154
  *
155
155
  * @param {import('../../types/dependency-cruiser').ICruiseResult} pCruiseResult
156
- * @return {import('../../types/dependency-cruiser').IReporterOutput}
156
+ * @returns {import('../../types/dependency-cruiser').IReporterOutput}
157
157
  */
158
158
  export default function d2(pCruiseResult) {
159
159
  return {
@@ -193,7 +193,7 @@ function normalizeDotReporterOptions(
193
193
  pGranularity,
194
194
  pResults,
195
195
  ) {
196
- let lDotReporterOptions = pDotReporterOptions || {};
196
+ const lDotReporterOptions = pDotReporterOptions || {};
197
197
 
198
198
  return {
199
199
  theme:
@@ -57,8 +57,8 @@ function makeInstabilityString(pModule, pShowMetrics = false) {
57
57
  export function folderify(pShowMetrics) {
58
58
  /** @param {import("../../../types/cruise-result").IModule} pModule*/
59
59
  return (pModule) => {
60
- let lAdditions = {};
61
- let lDirectoryName = dirname(pModule.source);
60
+ const lAdditions = {};
61
+ const lDirectoryName = dirname(pModule.source);
62
62
 
63
63
  if (lDirectoryName !== ".") {
64
64
  lAdditions.folder = lDirectoryName;
@@ -47,12 +47,18 @@ function moduleOrDependencyMatchesCriteria(pSchemeEntry, pModule) {
47
47
  }
48
48
 
49
49
  export function getThemeAttributes(pModuleOrDependency, pAttributeCriteria) {
50
- return (pAttributeCriteria || [])
51
- .filter((pSchemeEntry) =>
52
- moduleOrDependencyMatchesCriteria(pSchemeEntry, pModuleOrDependency),
53
- )
54
- .map((pSchemeEntry) => pSchemeEntry.attributes)
55
- .reduce((pAll, pCurrent) => ({ ...pCurrent, ...pAll }), {});
50
+ return (
51
+ (pAttributeCriteria || [])
52
+ .filter((pSchemeEntry) =>
53
+ moduleOrDependencyMatchesCriteria(pSchemeEntry, pModuleOrDependency),
54
+ )
55
+ .map((pSchemeEntry) => pSchemeEntry.attributes)
56
+ /* oxlint-disable-next-line no-accumulating-spread -
57
+ replacing it with alternatives is going to yield the same O(n^2)
58
+ complexity, just with more lines of code
59
+ */
60
+ .reduce((pAll, pCurrent) => ({ ...pCurrent, ...pAll }), {})
61
+ );
56
62
  }
57
63
 
58
64
  export function normalizeTheme(pTheme) {
@@ -84,7 +84,7 @@ function Mode() {
84
84
  *
85
85
  * @param {SVGGelement[]} pEdges
86
86
  * @param {SVGGElement[]} pNodes
87
- * @return {{get: (pTitleText:string) => SVGGElement[]}}
87
+ * @returns {{get: (pTitleText:string) => SVGGElement[]}}
88
88
  */
89
89
  function Title2ElementMap(pEdges, pNodes) {
90
90
  /* {{[key: string]: SVGGElement[]}} */
@@ -93,7 +93,7 @@ function Title2ElementMap(pEdges, pNodes) {
93
93
  /**
94
94
  * @param {NodeListOf<SVGGElement>} pEdges
95
95
  * @param {NodeListOf<SVGGElement>} pNodes
96
- * @return {{[key: string]: SVGGElement[]}}
96
+ * @returns {{[key: string]: SVGGElement[]}}
97
97
  */
98
98
  function buildMap(pEdges, pNodes) {
99
99
  var title2NodeMap = buildTitle2NodeMap(pNodes);
@@ -102,7 +102,7 @@ function Title2ElementMap(pEdges, pNodes) {
102
102
  }
103
103
  /**
104
104
  * @param {NodeListOf<SVGGElement>} pNodes
105
- * @return {{[key: string]: SVGGElement}}
105
+ * @returns {{[key: string]: SVGGElement}}
106
106
  */
107
107
  function buildTitle2NodeMap(pNodes) {
108
108
  return nodeListToArray(pNodes).reduce(addNodeToMap, {});
@@ -136,7 +136,7 @@ function Title2ElementMap(pEdges, pNodes) {
136
136
  /**
137
137
  *
138
138
  * @param {string} pString
139
- * @return {{from?: string; to?:string;}}
139
+ * @returns {{from?: string; to?:string;}}
140
140
  */
141
141
  function pryEdgeFromTitle(pString) {
142
142
  var nodeNames = pString.split(/\s*->\s*/);
@@ -149,7 +149,7 @@ function Title2ElementMap(pEdges, pNodes) {
149
149
  /**
150
150
  *
151
151
  * @param {string} pTitleText
152
- * @return {SVGGElement[]}
152
+ * @returns {SVGGElement[]}
153
153
  */
154
154
  function get(pTitleText) {
155
155
  return (pTitleText && elementMap[pTitleText]) || [];
@@ -161,7 +161,7 @@ function Title2ElementMap(pEdges, pNodes) {
161
161
 
162
162
  /**
163
163
  * @param {SVGGElement} pGElement
164
- * @return {string?}
164
+ * @returns {string?}
165
165
  */
166
166
  function getTitleText(pGElement) {
167
167
  /** @type {SVGTitleElement} */
@@ -177,7 +177,7 @@ function getTitleText(pGElement) {
177
177
 
178
178
  /**
179
179
  * @param {NodeListOf<Element>} pNodeList
180
- * @return {Element[]}
180
+ * @returns {Element[]}
181
181
  */
182
182
  function nodeListToArray(pNodeList) {
183
183
  var lReturnValue = [];
@@ -42,6 +42,13 @@ export default `<!DOCTYPE html>
42
42
  width: 100%;
43
43
  }
44
44
 
45
+ th {
46
+ position: sticky;
47
+ top: 0;
48
+ z-index: 2;
49
+ background-color: white
50
+ }
51
+
45
52
  th,
46
53
  td {
47
54
  text-align: left;
@@ -15,6 +15,13 @@ const SEVERITY2COLOR = new Map([
15
15
  ["ignore", "gray"],
16
16
  ]);
17
17
 
18
+ const SEVERITY2ICON = new Map([
19
+ ["error", "x"],
20
+ ["warn", "‼"],
21
+ ["info", "i"],
22
+ ["ignore", "-"],
23
+ ]);
24
+
18
25
  const EXTRA_PATH_INFORMATION_INDENT = 6;
19
26
 
20
27
  function formatMiniDependency(pMiniDependency) {
@@ -89,7 +96,7 @@ function sumMeta(pMeta) {
89
96
  }
90
97
 
91
98
  function formatSummary(pSummary) {
92
- let lMessage = `${EOL}x ${sumMeta(
99
+ const lMessage = `${EOL}x ${sumMeta(
93
100
  pSummary,
94
101
  )} dependency violations (${formatMeta(pSummary)}). ${
95
102
  pSummary.totalCruised
@@ -116,6 +123,29 @@ function formatIgnoreWarning(pNumberOfIgnoredViolations) {
116
123
  }
117
124
  return "";
118
125
  }
126
+ /**
127
+ * @param {import("../../types/cruise-result.mjs").IEnvironmentIssue} pEnvironmentIssue
128
+ * @returns {string}
129
+ */
130
+ function formatEnvironmentIssue(pEnvironmentIssue) {
131
+ return styleText(
132
+ SEVERITY2COLOR.get(pEnvironmentIssue.severity),
133
+ `${SEVERITY2ICON.get(pEnvironmentIssue.severity)} ${styleText("bold", pEnvironmentIssue.name)}: ${pEnvironmentIssue.description}`,
134
+ );
135
+ }
136
+
137
+ /**
138
+ * @param {import("../../types/cruise-result.mjs").IEnvironmentIssue[]} pEnvironmentIssues
139
+ * @returns {string}
140
+ */
141
+ function formatEnvironmentIssues(pEnvironmentIssues) {
142
+ const lEnvironmentIssues = pEnvironmentIssues ?? [];
143
+
144
+ return (
145
+ (lEnvironmentIssues.length > 0 ? EOL : "") +
146
+ lEnvironmentIssues.map(formatEnvironmentIssue).join(EOL)
147
+ );
148
+ }
119
149
 
120
150
  function report(pResults, pOptions) {
121
151
  const lOptions = {
@@ -135,7 +165,7 @@ function report(pResults, pOptions) {
135
165
  pResults.summary.totalDependenciesCruised
136
166
  } dependencies cruised)${EOL}${formatIgnoreWarning(
137
167
  pResults.summary.ignore,
138
- )}${EOL}`;
168
+ )}${formatEnvironmentIssues(pResults.summary.environment?.issues)}${EOL}`;
139
169
  }
140
170
 
141
171
  return lNonIgnorableViolations
@@ -147,6 +177,7 @@ function report(pResults, pOptions) {
147
177
  )
148
178
  .concat(formatSummary(pResults.summary))
149
179
  .concat(formatIgnoreWarning(pResults.summary.ignore))
180
+ .concat(formatEnvironmentIssues(pResults.summary.environment?.issues))
150
181
  .concat(EOL);
151
182
  }
152
183
 
@@ -17,7 +17,7 @@ function addShowTitle(pDependencyEntry) {
17
17
  }
18
18
 
19
19
  function getClasses(pModule, pOtherClasses) {
20
- let lClasses = pOtherClasses || [];
20
+ const lClasses = pOtherClasses || [];
21
21
  if (pModule.coreModule) {
22
22
  lClasses.push("cell-core-module");
23
23
  }
@@ -37,7 +37,7 @@ function constructTableHead(pModules) {
37
37
  }
38
38
 
39
39
  function constructTableCellTitle(pModule, pIncidence) {
40
- let lTitleLines = [];
40
+ const lTitleLines = [];
41
41
  if (pIncidence.rule) {
42
42
  lTitleLines.push(`${pIncidence.rule}:`);
43
43
  }
@@ -36,6 +36,7 @@ const TYPE2MODULE = new Map([
36
36
  * and returns an IReporterOutput
37
37
  */
38
38
  export async function getReporter(pOutputType) {
39
+ /* oxlint-disable-next-line no-useless-assignment */
39
40
  let lReturnValue = {};
40
41
  if (pOutputType?.startsWith("plugin:")) {
41
42
  lReturnValue = await getExternalPluginReporter(pOutputType);
@@ -49,7 +49,7 @@ function severity2Icon(pSeverity) {
49
49
 
50
50
  /**
51
51
  * @param {import("../../types/cruise-result.mjs").ISummary} pSummary
52
- * @return {string}
52
+ * @returns {string}
53
53
  */
54
54
  function formatStatsSummary(pSummary) {
55
55
  const lSpacerLength = 4;
@@ -60,7 +60,7 @@ function formatStatsSummary(pSummary) {
60
60
  /**
61
61
  * @param {import("../../types/cruise-result.mjs").ICruiseResult} pCruiseResult
62
62
  * @param {Boolean} pIncludeIgnoredInSummary
63
- * @return {string}
63
+ * @returns {string}
64
64
  */
65
65
  function formatRulesSummary(pCruiseResult, pIncludeIgnoredInSummary) {
66
66
  const lTableHead =
@@ -87,7 +87,7 @@ function formatRulesSummary(pCruiseResult, pIncludeIgnoredInSummary) {
87
87
  *
88
88
  * @param {import("../../types/cruise-result.mjs").IViolation[]} pViolations
89
89
  * @param {object} pOptions
90
- * @return {string}
90
+ * @returns {string}
91
91
  */
92
92
  function formatViolations(pViolations, pOptions) {
93
93
  const lTableHead = "|violated rule|module|to|\n|:---|:---|:---|\n";
@@ -63,7 +63,7 @@ function renderSubgraphs(pSource, pOptions, pDepth = 0) {
63
63
  * @param {Map<string, string>} pNamesHashMap
64
64
  */
65
65
  function convertSubgraphSources(pCruiseResult, pNamesHashMap) {
66
- let lTree = {};
66
+ const lTree = {};
67
67
 
68
68
  for (const lModule of pCruiseResult.modules) {
69
69
  const lPaths = lModule.source.split("/");
@@ -114,7 +114,7 @@ const hashToReadableNodeName = (pNode) =>
114
114
  /**
115
115
  * @param {import("../../types/cruise-result").IModule[]} pModules
116
116
  * @param {Boolean} pMinify
117
- * @return {Map<string, string>}
117
+ * @returns {Map<string, string>}
118
118
  */
119
119
  function hashModuleNames(pModules, pMinify) {
120
120
  const lBase = 36;
@@ -173,7 +173,7 @@ ${focusHighlights(pCruiseResult.modules, lNamesHashMap)}`;
173
173
  *
174
174
  * @param {import('../../types/dependency-cruiser').ICruiseResult} pCruiseResult
175
175
  * @param {import("../../types/reporter-options").IMermaidReporterOptions} pOptions
176
- * @return {import('../../types/dependency-cruiser').IReporterOutput}
176
+ * @returns {import('../../types/dependency-cruiser').IReporterOutput}
177
177
  */
178
178
  export default function mermaid(pCruiseResult, pOptions) {
179
179
  return {
@@ -249,7 +249,7 @@ function transformMetricsToTable(
249
249
  largeIntegerWidth: METRIC_WIDTH + METRIC_WIDTH,
250
250
  },
251
251
  );
252
- let lComponents = lObject.data
252
+ const lComponents = lObject.data
253
253
  .filter(
254
254
  (pComponent) =>
255
255
  (!hideModules && pComponent.type === "module") ||
@@ -268,7 +268,7 @@ function transformMetricsToTable(
268
268
  *
269
269
  * @param {import('../../types/dependency-cruiser.js').ICruiseResult} pCruiseResult -
270
270
  * @param {import("../../types/reporter-options.js").IMetricsReporterOptions} pReporterOptions
271
- * @return {import('../../types/dependency-cruiser.js').IReporterOutput} -
271
+ * @returns {import('../../types/dependency-cruiser.js').IReporterOutput} -
272
272
  */
273
273
  export default function metrics(pCruiseResult, pReporterOptions) {
274
274
  const lReporterOptions = pReporterOptions || {};
@@ -25,12 +25,13 @@ export function isValidPlugin(pPluginFunction) {
25
25
  }
26
26
 
27
27
  async function getPluginReporter(pOutputType) {
28
+ /* oxlint-disable-next-line no-useless-assignment */
28
29
  let lReturnValue = false;
29
30
 
30
31
  try {
31
32
  const lModule = await import(pOutputType);
32
33
  lReturnValue = lModule.default;
33
- } catch (pError) {
34
+ } catch {
34
35
  throw new Error(
35
36
  `Could not find reporter plugin '${pOutputType}' (or it isn't valid)`,
36
37
  );
@@ -16,7 +16,7 @@ const EOL = "\n";
16
16
  * Copied from https://github.com/pifantastic/teamcity-service-messages/blob/master/lib/message.js#L72
17
17
  *
18
18
  * @param {String} pMessageString the string to escape
19
- * @return {String}
19
+ * @returns {String}
20
20
  */
21
21
  function escape(pMessageString) {
22
22
  if (pMessageString === null) {
@@ -48,7 +48,7 @@ function escape(pMessageString) {
48
48
  * but this is what teamcity-service-messages used, so as
49
49
  * per the rule of least surprise, this is what we use as well.
50
50
  *
51
- * @return {string} 10 random numeric digits
51
+ * @returns {string} 10 random numeric digits
52
52
  */
53
53
  function getRandomFlowId() {
54
54
  const lFlowIdLength = 10;
@@ -8,7 +8,7 @@ function compareOnSource(pOne, pTwo) {
8
8
 
9
9
  function determineIncidenceType(pFromListEntry) {
10
10
  return (pModule) => {
11
- let lDependency = pModule.dependencies.find(
11
+ const lDependency = pModule.dependencies.find(
12
12
  (pDependency) => pDependency.resolved === pFromListEntry.source,
13
13
  );
14
14
 
@@ -32,7 +32,7 @@ export function formatViolation(
32
32
  *
33
33
  * @param {string} pPrefix - prefix
34
34
  * @param {string} pSource - filename
35
- * @return {string} prefix and filename concatenated
35
+ * @returns {string} prefix and filename concatenated
36
36
  */
37
37
  function smartURIConcat(pPrefix, pSource) {
38
38
  if (PROTOCOL_PREFIX_RE.test(pPrefix)) {