@boundaries/eslint-plugin 5.4.0 → 6.0.0-beta.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 (64) hide show
  1. package/README.md +9 -9
  2. package/dist/Config/Config.d.ts +6 -3
  3. package/dist/Config/Config.js +18 -7
  4. package/dist/Config/Recommended.d.ts +1 -1
  5. package/dist/Config/Recommended.js +3 -2
  6. package/dist/Config/Strict.d.ts +1 -1
  7. package/dist/Config/Strict.js +2 -2
  8. package/dist/Debug/Debug.d.ts +34 -0
  9. package/dist/Debug/Debug.js +285 -0
  10. package/dist/Debug/index.d.ts +1 -0
  11. package/dist/{Support → Debug}/index.js +0 -1
  12. package/dist/Elements/Elements.d.ts +9 -7
  13. package/dist/Elements/Elements.js +12 -7
  14. package/dist/Elements/Elements.types.d.ts +1 -0
  15. package/dist/Messages/CustomMessages.d.ts +44 -0
  16. package/dist/Messages/CustomMessages.js +156 -0
  17. package/dist/Messages/CustomMessages.types.d.ts +25 -0
  18. package/dist/Messages/CustomMessages.types.js +2 -0
  19. package/dist/Messages/Messages.d.ts +42 -13
  20. package/dist/Messages/Messages.js +400 -177
  21. package/dist/Messages/index.d.ts +2 -0
  22. package/dist/Messages/index.js +2 -0
  23. package/dist/Public/Config.types.d.ts +2 -2
  24. package/dist/Public/Config.types.js +2 -2
  25. package/dist/Public/Rules.types.d.ts +5 -4
  26. package/dist/Public/Rules.types.js +5 -6
  27. package/dist/Public/Settings.types.d.ts +3 -2
  28. package/dist/Public/Settings.types.js +4 -3
  29. package/dist/Public/index.d.ts +1 -0
  30. package/dist/Rules/Dependencies.d.ts +59 -0
  31. package/dist/Rules/Dependencies.js +439 -0
  32. package/dist/Rules/EntryPoint.js +44 -94
  33. package/dist/Rules/External.js +93 -68
  34. package/dist/Rules/NoIgnored.js +4 -4
  35. package/dist/Rules/NoPrivate.js +18 -5
  36. package/dist/Rules/NoUnknown.js +5 -5
  37. package/dist/Rules/NoUnknownFiles.js +4 -3
  38. package/dist/Rules/Support/DependencyRule.d.ts +9 -1
  39. package/dist/Rules/Support/DependencyRule.js +15 -6
  40. package/dist/Rules/Support/DependencyRule.types.d.ts +1 -1
  41. package/dist/Rules/Support/Helpers.d.ts +6 -2
  42. package/dist/Rules/Support/Helpers.js +7 -31
  43. package/dist/Settings/Helpers.d.ts +83 -1
  44. package/dist/Settings/Helpers.js +197 -7
  45. package/dist/Settings/Settings.d.ts +19 -2
  46. package/dist/Settings/Settings.js +20 -10
  47. package/dist/Settings/Validations.d.ts +11958 -43
  48. package/dist/Settings/Validations.js +783 -157
  49. package/dist/Settings/index.d.ts +0 -1
  50. package/dist/Settings/index.js +0 -1
  51. package/dist/{Settings → Shared}/Settings.types.d.ts +137 -37
  52. package/dist/{Settings → Shared}/Settings.types.js +30 -6
  53. package/dist/{Support/Common.d.ts → Shared/TypeHelpers.d.ts} +18 -0
  54. package/dist/{Support/Common.js → Shared/TypeHelpers.js} +28 -1
  55. package/dist/Shared/index.d.ts +2 -0
  56. package/dist/Shared/index.js +18 -0
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.js +12 -10
  59. package/package.json +9 -8
  60. package/dist/Rules/ElementTypes.d.ts +0 -25
  61. package/dist/Rules/ElementTypes.js +0 -279
  62. package/dist/Support/Debug.d.ts +0 -5
  63. package/dist/Support/Debug.js +0 -54
  64. package/dist/Support/index.d.ts +0 -2
@@ -1,5 +1,57 @@
1
1
  import type { DependencyKind } from "@boundaries/elements";
2
- import type { DependencyNodeKey, SettingsKey, RulePolicy, RuleShortName, RuleName, RuleMainKey } from "./Settings.types";
2
+ import type { DependencyNodeKey, SettingsKey, RulePolicy, RuleShortName, RuleName, RuleMainKey } from "../Shared/Settings.types";
3
+ /**
4
+ * Returns the documentation URL for an ESLint rule.
5
+ * @param ruleName The name of the rule.
6
+ * @param anchor Optional anchor to a specific section in the documentation page.
7
+ * @returns The documentation URL for the ESLint rule.
8
+ */
9
+ export declare function docsUrl(path: string, anchor?: string): string;
10
+ /**
11
+ * Returns the documentation URL for an ESLint rule.
12
+ * @param ruleName The name of the rule.
13
+ * @param anchor Optional anchor to a specific section in the documentation page.
14
+ * @returns The documentation URL for the ESLint rule.
15
+ */
16
+ export declare function ruleDocsUrl(ruleName: RuleName, anchor?: string): string;
17
+ /**
18
+ * Returns a "more info" message with the documentation URL for a given path.
19
+ * @param path The path to the documentation page.
20
+ * @param anchor Optional anchor to a specific section in the documentation page.
21
+ * @returns A message containing the documentation URL.
22
+ */
23
+ export declare function moreInfoLink(path: string, anchor?: string): string;
24
+ /**
25
+ * Returns a migration guide link for a specific version upgrade.
26
+ * @param versionFrom - The version being upgraded from.
27
+ * @param versionTo - The version being upgraded to.
28
+ * @param anchor - Optional anchor to a specific section in the migration guide.
29
+ * @returns A message containing the migration guide URL for the specified version upgrade.
30
+ */
31
+ export declare function migrationGuideLink(versionFrom: string, versionTo: string, anchor?: string): string;
32
+ /**
33
+ * Returns a migration guide link for upgrading from version 5 to version 6.
34
+ * @param anchor - Optional anchor to a specific section in the migration guide.
35
+ * @returns A message containing the migration guide URL for upgrading from version 5 to version 6.
36
+ */
37
+ export declare function migrationToV6GuideLink(anchor?: string): string;
38
+ /**
39
+ * Returns a migration guide link for upgrading from version 1 to version 2.
40
+ * @param anchor - Optional anchor to a specific section in the migration guide.
41
+ * @returns A message containing the migration guide URL for upgrading from version 1 to version 2.
42
+ */
43
+ export declare function migrationToV2GuideLink(anchor?: string): string;
44
+ /**
45
+ * Returns a settings information link for the plugin settings documentation.
46
+ * @param anchor - Optional anchor to a specific section in the settings documentation.
47
+ * @returns A message containing the settings information URL for the plugin settings documentation.
48
+ */
49
+ export declare function moreInfoSettingsLink(anchor?: string): string;
50
+ /**
51
+ * Warns about the deprecation of a rule and encourages migration to the "dependencies" rule.
52
+ * @param ruleName The name of the deprecated rule.
53
+ */
54
+ export declare function warnMigrationToDependencies(ruleName: RuleName): void;
3
55
  /**
4
56
  * Type guard to check if a value is a valid DependencyKind.
5
57
  * @param value The value to check.
@@ -37,5 +89,35 @@ export declare function isRuleName(value: unknown): value is RuleName;
37
89
  * @returns True if the value is a valid rule short name, false otherwise.
38
90
  */
39
91
  export declare function isRuleShortName(value: unknown): value is RuleShortName;
92
+ /**
93
+ * Type guard for legacy element descriptors declared as plain strings.
94
+ *
95
+ * @param type - Value to check.
96
+ * @returns `true` when the value is a legacy string descriptor.
97
+ */
40
98
  export declare function isLegacyType(type: unknown): type is string;
99
+ /**
100
+ * Type guard to check if a value is a legacy element selector (string or tuple format).
101
+ * @param value - The value to check.
102
+ * @returns True if the value is a legacy element selector, false otherwise.
103
+ */
104
+ export declare function isLegacyElementSelector(value: unknown): value is string | [string, Record<string, unknown>];
105
+ /**
106
+ * Detects if legacy element selector syntax is used.
107
+ * @param selector - The selector to check (can be a single selector or an array of selectors).
108
+ * @returns True if legacy syntax was detected, false otherwise.
109
+ */
110
+ export declare function detectLegacyElementSelector(selector: unknown): boolean;
111
+ /**
112
+ * Detects if legacy template syntax is used in selectors.
113
+ * @param selector - The selector to check (can be a single selector or an array of selectors).
114
+ * @returns True if legacy template syntax was detected, false otherwise.
115
+ */
116
+ export declare function detectLegacyTemplateSyntax(selector: unknown): boolean;
117
+ /**
118
+ * Returns the canonical main selector key used by schema and option checks.
119
+ *
120
+ * @param key - Optional rule main key (`from`, `to`, or `target`).
121
+ * @returns The same key with default fallback to `from`.
122
+ */
41
123
  export declare function rulesMainKey(key?: RuleMainKey): RuleMainKey;
@@ -1,5 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.docsUrl = docsUrl;
4
+ exports.ruleDocsUrl = ruleDocsUrl;
5
+ exports.moreInfoLink = moreInfoLink;
6
+ exports.migrationGuideLink = migrationGuideLink;
7
+ exports.migrationToV6GuideLink = migrationToV6GuideLink;
8
+ exports.migrationToV2GuideLink = migrationToV2GuideLink;
9
+ exports.moreInfoSettingsLink = moreInfoSettingsLink;
10
+ exports.warnMigrationToDependencies = warnMigrationToDependencies;
3
11
  exports.isImportKind = isImportKind;
4
12
  exports.isDependencyNodeKey = isDependencyNodeKey;
5
13
  exports.isSettingsKey = isSettingsKey;
@@ -7,10 +15,112 @@ exports.isRulePolicy = isRulePolicy;
7
15
  exports.isRuleName = isRuleName;
8
16
  exports.isRuleShortName = isRuleShortName;
9
17
  exports.isLegacyType = isLegacyType;
18
+ exports.isLegacyElementSelector = isLegacyElementSelector;
19
+ exports.detectLegacyElementSelector = detectLegacyElementSelector;
20
+ exports.detectLegacyTemplateSyntax = detectLegacyTemplateSyntax;
10
21
  exports.rulesMainKey = rulesMainKey;
11
22
  const elements_1 = require("@boundaries/elements");
12
- const Support_1 = require("../Support");
13
- const Settings_types_1 = require("./Settings.types");
23
+ const Debug_1 = require("../Debug");
24
+ const Shared_1 = require("../Shared");
25
+ const Settings_types_1 = require("../Shared/Settings.types");
26
+ /**
27
+ * Removes the plugin namespace from a rule name.
28
+ * @param ruleName The name of the rule.
29
+ * @returns The rule name without the plugin namespace.
30
+ */
31
+ function removePluginNamespace(ruleName) {
32
+ return ruleName.replace(`${Settings_types_1.PLUGIN_NAME}/`, "");
33
+ }
34
+ /**
35
+ * Adapts the rule name to be used in a URL.
36
+ * @param ruleName The name of the rule.
37
+ * @returns The adapted rule name for URL usage.
38
+ */
39
+ function adaptRuleNameToUrl(ruleName) {
40
+ if (ruleName === Settings_types_1.RULE_NAMES_MAP.ELEMENT_TYPES) {
41
+ return Settings_types_1.RULE_NAMES_MAP.DEPENDENCIES;
42
+ }
43
+ return ruleName;
44
+ }
45
+ /**
46
+ * Returns the documentation URL for an ESLint rule.
47
+ * @param ruleName The name of the rule.
48
+ * @param anchor Optional anchor to a specific section in the documentation page.
49
+ * @returns The documentation URL for the ESLint rule.
50
+ */
51
+ function docsUrl(path, anchor) {
52
+ const anchorSuffix = anchor ? `#${anchor}` : "";
53
+ return `${Settings_types_1.WEBSITE_URL}/docs/${path}/${anchorSuffix}`;
54
+ }
55
+ /**
56
+ * Returns the documentation path for a given rule name.
57
+ * @param ruleName The name of the rule.
58
+ * @returns The documentation path for the given rule name.
59
+ */
60
+ function getRuleDocsPath(ruleName) {
61
+ return `rules/${removePluginNamespace(adaptRuleNameToUrl(ruleName))}`;
62
+ }
63
+ /**
64
+ * Returns the documentation URL for an ESLint rule.
65
+ * @param ruleName The name of the rule.
66
+ * @param anchor Optional anchor to a specific section in the documentation page.
67
+ * @returns The documentation URL for the ESLint rule.
68
+ */
69
+ function ruleDocsUrl(ruleName, anchor) {
70
+ return docsUrl(getRuleDocsPath(ruleName), anchor);
71
+ }
72
+ /**
73
+ * Returns a "more info" message with the documentation URL for a given path.
74
+ * @param path The path to the documentation page.
75
+ * @param anchor Optional anchor to a specific section in the documentation page.
76
+ * @returns A message containing the documentation URL.
77
+ */
78
+ function moreInfoLink(path, anchor) {
79
+ return `More info: ${docsUrl(path, anchor)}`;
80
+ }
81
+ /**
82
+ * Returns a migration guide link for a specific version upgrade.
83
+ * @param versionFrom - The version being upgraded from.
84
+ * @param versionTo - The version being upgraded to.
85
+ * @param anchor - Optional anchor to a specific section in the migration guide.
86
+ * @returns A message containing the migration guide URL for the specified version upgrade.
87
+ */
88
+ function migrationGuideLink(versionFrom, versionTo, anchor) {
89
+ return moreInfoLink(`releases/migration-guides/v${versionFrom}-to-v${versionTo}`, anchor);
90
+ }
91
+ /**
92
+ * Returns a migration guide link for upgrading from version 5 to version 6.
93
+ * @param anchor - Optional anchor to a specific section in the migration guide.
94
+ * @returns A message containing the migration guide URL for upgrading from version 5 to version 6.
95
+ */
96
+ function migrationToV6GuideLink(anchor) {
97
+ return migrationGuideLink("5", "6", anchor);
98
+ }
99
+ /**
100
+ * Returns a migration guide link for upgrading from version 1 to version 2.
101
+ * @param anchor - Optional anchor to a specific section in the migration guide.
102
+ * @returns A message containing the migration guide URL for upgrading from version 1 to version 2.
103
+ */
104
+ function migrationToV2GuideLink(anchor) {
105
+ return migrationGuideLink("1", "2", anchor);
106
+ }
107
+ /**
108
+ * Returns a settings information link for the plugin settings documentation.
109
+ * @param anchor - Optional anchor to a specific section in the settings documentation.
110
+ * @returns A message containing the settings information URL for the plugin settings documentation.
111
+ */
112
+ function moreInfoSettingsLink(anchor) {
113
+ return moreInfoLink(`setup/settings`, anchor);
114
+ }
115
+ /**
116
+ * Warns about the deprecation of a rule and encourages migration to the "dependencies" rule.
117
+ * @param ruleName The name of the deprecated rule.
118
+ */
119
+ function warnMigrationToDependencies(ruleName) {
120
+ (0, Debug_1.warnOnce)(`Rule "${ruleName}" is deprecated and will be removed in future versions.`, `Please migrate to the "${Settings_types_1.RULE_NAMES_MAP.DEPENDENCIES}" rule with appropriate selectors. ${moreInfoLink(getRuleDocsPath(ruleName),
121
+ // cspell: disable-next-line
122
+ "migration-to-boundariesdependencies")}`);
123
+ }
14
124
  /**
15
125
  * Type guard to check if a value is a valid DependencyKind.
16
126
  * @param value The value to check.
@@ -18,7 +128,7 @@ const Settings_types_1 = require("./Settings.types");
18
128
  * @deprecated Use isDependencyKind instead.
19
129
  */
20
130
  function isImportKind(value) {
21
- return ((0, Support_1.isString)(value) &&
131
+ return ((0, Shared_1.isString)(value) &&
22
132
  Object.values(elements_1.DEPENDENCY_KINDS_MAP).includes(value));
23
133
  }
24
134
  /**
@@ -27,7 +137,7 @@ function isImportKind(value) {
27
137
  * @returns True if the value is a valid DependencyNodeKey, false otherwise.
28
138
  */
29
139
  function isDependencyNodeKey(value) {
30
- return ((0, Support_1.isString)(value) &&
140
+ return ((0, Shared_1.isString)(value) &&
31
141
  Object.values(Settings_types_1.DEPENDENCY_NODE_KEYS_MAP).includes(value));
32
142
  }
33
143
  /**
@@ -36,7 +146,7 @@ function isDependencyNodeKey(value) {
36
146
  * @returns True if the value is a valid settings key, false otherwise.
37
147
  */
38
148
  function isSettingsKey(value) {
39
- return ((0, Support_1.isString)(value) &&
149
+ return ((0, Shared_1.isString)(value) &&
40
150
  Object.values(Settings_types_1.SETTINGS_KEYS_MAP).includes(value));
41
151
  }
42
152
  /**
@@ -45,7 +155,7 @@ function isSettingsKey(value) {
45
155
  * @returns True if the value is a valid RulePolicy, false otherwise.
46
156
  */
47
157
  function isRulePolicy(value) {
48
- return ((0, Support_1.isString)(value) &&
158
+ return ((0, Shared_1.isString)(value) &&
49
159
  (value === Settings_types_1.RULE_POLICY_ALLOW || value === Settings_types_1.RULE_POLICY_DISALLOW));
50
160
  }
51
161
  /**
@@ -64,9 +174,89 @@ function isRuleName(value) {
64
174
  function isRuleShortName(value) {
65
175
  return Settings_types_1.RULE_SHORT_NAMES.includes(value);
66
176
  }
177
+ /**
178
+ * Type guard for legacy element descriptors declared as plain strings.
179
+ *
180
+ * @param type - Value to check.
181
+ * @returns `true` when the value is a legacy string descriptor.
182
+ */
67
183
  function isLegacyType(type) {
68
- return (0, Support_1.isString)(type);
184
+ return (0, Shared_1.isString)(type);
69
185
  }
186
+ /**
187
+ * Type guard to check if a value is a legacy element selector (string or tuple format).
188
+ * @param value - The value to check.
189
+ * @returns True if the value is a legacy element selector, false otherwise.
190
+ */
191
+ function isLegacyElementSelector(value) {
192
+ // String format: "type"
193
+ if ((0, Shared_1.isString)(value)) {
194
+ return true;
195
+ }
196
+ // Tuple format: ["type", { captured values }]
197
+ if (Array.isArray(value) && value.length === 2 && (0, Shared_1.isString)(value[0])) {
198
+ return true;
199
+ }
200
+ return false;
201
+ }
202
+ /**
203
+ * Detects if legacy element selector syntax is used.
204
+ * @param selector - The selector to check (can be a single selector or an array of selectors).
205
+ * @returns True if legacy syntax was detected, false otherwise.
206
+ */
207
+ function detectLegacyElementSelector(selector) {
208
+ if (Array.isArray(selector)) {
209
+ for (const sel of selector) {
210
+ if (isLegacyElementSelector(sel)) {
211
+ return true;
212
+ }
213
+ }
214
+ return false;
215
+ }
216
+ else if (selector) {
217
+ return isLegacyElementSelector(selector);
218
+ }
219
+ return false;
220
+ }
221
+ /**
222
+ * Checks if a string contains legacy template syntax ${...}.
223
+ * @param value - The value to check.
224
+ * @returns True if the value contains legacy template syntax, false otherwise.
225
+ */
226
+ function hasLegacyTemplateSyntax(value) {
227
+ return value.includes("${");
228
+ }
229
+ /**
230
+ * Recursively checks if a selector contains legacy template syntax.
231
+ * @param value - The value to check (can be string, object, array, etc.).
232
+ * @returns True if legacy template syntax was detected, false otherwise.
233
+ */
234
+ function checkForLegacyTemplateSyntax(value) {
235
+ if ((0, Shared_1.isString)(value)) {
236
+ return hasLegacyTemplateSyntax(value);
237
+ }
238
+ if ((0, Shared_1.isArray)(value)) {
239
+ return value.some(checkForLegacyTemplateSyntax);
240
+ }
241
+ if ((0, Shared_1.isNull)(value) || !(0, Shared_1.isObject)(value)) {
242
+ return false;
243
+ }
244
+ return Object.values(value).some(checkForLegacyTemplateSyntax);
245
+ }
246
+ /**
247
+ * Detects if legacy template syntax is used in selectors.
248
+ * @param selector - The selector to check (can be a single selector or an array of selectors).
249
+ * @returns True if legacy template syntax was detected, false otherwise.
250
+ */
251
+ function detectLegacyTemplateSyntax(selector) {
252
+ return checkForLegacyTemplateSyntax(selector);
253
+ }
254
+ /**
255
+ * Returns the canonical main selector key used by schema and option checks.
256
+ *
257
+ * @param key - Optional rule main key (`from`, `to`, or `target`).
258
+ * @returns The same key with default fallback to `from`.
259
+ */
70
260
  function rulesMainKey(key = Settings_types_1.FROM) {
71
261
  return key;
72
262
  }
@@ -1,6 +1,23 @@
1
1
  import type { ElementDescriptors } from "@boundaries/elements";
2
- import type { Settings } from "./Settings.types";
2
+ import type { Settings } from "../Shared/Settings.types";
3
+ /**
4
+ * Converts legacy string element descriptors into object descriptors.
5
+ *
6
+ * @param typesFromSettings - Raw `boundaries/elements` setting value.
7
+ * @returns Normalized element descriptors compatible with current matcher API.
8
+ */
3
9
  export declare function transformLegacyTypes(typesFromSettings?: string[] | ElementDescriptors): ElementDescriptors;
10
+ /**
11
+ * Extracts element type names from normalized element descriptors.
12
+ *
13
+ * @param descriptors - Normalized descriptors from settings.
14
+ * @returns List of defined element type names.
15
+ */
4
16
  export declare function getElementsTypeNames(descriptors: ElementDescriptors): string[];
17
+ /**
18
+ * Resolves the effective root path used by boundaries matchers.
19
+ *
20
+ * @param settings - Validated plugin settings.
21
+ * @returns Absolute root path used for dependency and element resolution.
22
+ */
5
23
  export declare function getRootPath(settings: Settings): string;
6
- export declare function isDebugModeEnabled(): string | undefined;
@@ -3,18 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformLegacyTypes = transformLegacyTypes;
4
4
  exports.getElementsTypeNames = getElementsTypeNames;
5
5
  exports.getRootPath = getRootPath;
6
- exports.isDebugModeEnabled = isDebugModeEnabled;
7
6
  const node_path_1 = require("node:path");
8
- const Support_1 = require("../Support");
7
+ const Settings_types_1 = require("../Shared/Settings.types");
9
8
  const Helpers_1 = require("./Helpers");
10
- const Settings_types_1 = require("./Settings.types");
11
- const { VALID_MODES, ROOT_PATH, ENV_ROOT_PATH, DEBUG } = Settings_types_1.SETTINGS;
9
+ const { VALID_MODES, ROOT_PATH, ENV_ROOT_PATH } = Settings_types_1.SETTINGS;
12
10
  // TODO, remove in next major version
11
+ /**
12
+ * Converts legacy string element descriptors into object descriptors.
13
+ *
14
+ * @param typesFromSettings - Raw `boundaries/elements` setting value.
15
+ * @returns Normalized element descriptors compatible with current matcher API.
16
+ */
13
17
  function transformLegacyTypes(typesFromSettings) {
14
18
  const types = typesFromSettings || [];
15
- if (!(0, Support_1.isArray)(types)) {
16
- return [];
17
- }
18
19
  return types.map((type) => {
19
20
  // backward compatibility with v1
20
21
  if ((0, Helpers_1.isLegacyType)(type)) {
@@ -32,9 +33,21 @@ function transformLegacyTypes(typesFromSettings) {
32
33
  };
33
34
  });
34
35
  }
36
+ /**
37
+ * Extracts element type names from normalized element descriptors.
38
+ *
39
+ * @param descriptors - Normalized descriptors from settings.
40
+ * @returns List of defined element type names.
41
+ */
35
42
  function getElementsTypeNames(descriptors) {
36
43
  return descriptors.map((element) => element.type).filter(Boolean);
37
44
  }
45
+ /**
46
+ * Resolves the effective root path used by boundaries matchers.
47
+ *
48
+ * @param settings - Validated plugin settings.
49
+ * @returns Absolute root path used for dependency and element resolution.
50
+ */
38
51
  function getRootPath(settings) {
39
52
  const rootPathUserSetting = process.env[ENV_ROOT_PATH] || settings[ROOT_PATH];
40
53
  if (rootPathUserSetting) {
@@ -44,6 +57,3 @@ function getRootPath(settings) {
44
57
  }
45
58
  return process.cwd();
46
59
  }
47
- function isDebugModeEnabled() {
48
- return process.env[DEBUG];
49
- }