bare-script 3.7.3 → 3.7.4
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/lib/model.js +3 -10
- package/package.json +1 -1
package/lib/model.js
CHANGED
|
@@ -500,16 +500,9 @@ export function lintScript(script) {
|
|
|
500
500
|
|
|
501
501
|
// Helper to format static analysis warnings
|
|
502
502
|
function lintScriptWarning(warnings, script, statement, message) {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
const scriptName = script.scriptName ?? '';
|
|
507
|
-
const lineno = statement[statementKey].lineNumber ?? '';
|
|
508
|
-
warning = (scriptName || lineno) ? `${scriptName}:${lineno}: ${message}` : message;
|
|
509
|
-
} else {
|
|
510
|
-
warning = message;
|
|
511
|
-
}
|
|
512
|
-
warnings.push(warning);
|
|
503
|
+
const scriptName = script.scriptName ?? '';
|
|
504
|
+
const lineno = (statement !== null ? (statement[Object.keys(statement)[0]].lineNumber ?? 1) : 1);
|
|
505
|
+
warnings.push(`${scriptName}:${lineno}: ${message}`);
|
|
513
506
|
}
|
|
514
507
|
|
|
515
508
|
|