@hyperframes/lint 0.8.10 → 0.8.12
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/dist/browser.js +75 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.js +75 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/browser.js
CHANGED
|
@@ -1306,7 +1306,13 @@ var mediaRules = [
|
|
|
1306
1306
|
// audio_volume_tween_overrides_gain
|
|
1307
1307
|
findVolumeTweenOverridesGainFindings,
|
|
1308
1308
|
// audio_carve_ungrouped_sources
|
|
1309
|
-
findCarveUngroupedSourcesFindings
|
|
1309
|
+
findCarveUngroupedSourcesFindings,
|
|
1310
|
+
// audio_group_no_members
|
|
1311
|
+
findAudioGroupNoMembersFindings,
|
|
1312
|
+
// audio_group_timing_attrs
|
|
1313
|
+
findAudioGroupTimingAttrFindings,
|
|
1314
|
+
// audio_group_carve_attr
|
|
1315
|
+
findAudioGroupCarveAttrFindings
|
|
1310
1316
|
];
|
|
1311
1317
|
function findVolumeTweenOverridesGainFindings(ctx) {
|
|
1312
1318
|
const boosted = ctx.tags.filter((tag) => isMediaTag(tag.name)).map((tag) => ({ tag, volume: Number(readAttr(tag.raw, "data-volume") ?? "1") })).filter((entry) => Number.isFinite(entry.volume) && entry.volume !== 1).filter((entry) => !readDecodedAttr(entry.tag.raw, "data-automation")).map((entry) => ({ ...entry, id: readAttr(entry.tag.raw, "id") })).filter((entry) => Boolean(entry.id));
|
|
@@ -1380,6 +1386,74 @@ function findCarveUngroupedSourcesFindings(ctx) {
|
|
|
1380
1386
|
}
|
|
1381
1387
|
return findings;
|
|
1382
1388
|
}
|
|
1389
|
+
var AUDIO_GROUP_TIMING_ATTRS = ["data-start", "data-duration", "data-track-index"];
|
|
1390
|
+
function findAudioGroupNoMembersFindings(ctx) {
|
|
1391
|
+
const memberGroupIds = new Set(
|
|
1392
|
+
ctx.tags.filter((tag) => tag.name === "audio").map((tag) => readAttr(tag.raw, "data-audio-group")).filter((id) => Boolean(id))
|
|
1393
|
+
);
|
|
1394
|
+
if (memberGroupIds.size === 0) return [];
|
|
1395
|
+
const mayHaveCrossFileMembers = ctx.tags.some(
|
|
1396
|
+
(tag) => Boolean(readAttr(tag.raw, "data-composition-src"))
|
|
1397
|
+
);
|
|
1398
|
+
const declaredGroupIds = new Set(
|
|
1399
|
+
ctx.tags.filter((tag) => tag.name === "hf-audio-group").map((tag) => readAttr(tag.raw, "id")).filter((id) => Boolean(id))
|
|
1400
|
+
);
|
|
1401
|
+
const unmatchedMemberGroupIds = [...memberGroupIds].filter((id) => !declaredGroupIds.has(id));
|
|
1402
|
+
const findings = [];
|
|
1403
|
+
for (const tag of ctx.tags) {
|
|
1404
|
+
if (tag.name !== "hf-audio-group") continue;
|
|
1405
|
+
const elementId = readAttr(tag.raw, "id");
|
|
1406
|
+
if (!elementId) continue;
|
|
1407
|
+
if (memberGroupIds.has(elementId)) continue;
|
|
1408
|
+
if (mayHaveCrossFileMembers) continue;
|
|
1409
|
+
const nearby = unmatchedMemberGroupIds.filter((id) => id !== elementId);
|
|
1410
|
+
const suffix = nearby.length > 0 ? ` Clips in this file name ${nearby.map((id) => `"${id}"`).join(", ")} instead.` : "";
|
|
1411
|
+
findings.push({
|
|
1412
|
+
code: "audio_group_no_members",
|
|
1413
|
+
severity: "error",
|
|
1414
|
+
message: `#${elementId} is an audio group no clip belongs to, so its fader, effect chain and automation are dropped.${suffix}`,
|
|
1415
|
+
elementId,
|
|
1416
|
+
fixHint: `Add \`data-audio-group="${elementId}"\` to the clips this bus is for, or delete the bus.`,
|
|
1417
|
+
snippet: truncateSnippet(tag.raw)
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
return findings;
|
|
1421
|
+
}
|
|
1422
|
+
function findAudioGroupTimingAttrFindings(ctx) {
|
|
1423
|
+
const findings = [];
|
|
1424
|
+
for (const tag of ctx.tags) {
|
|
1425
|
+
if (tag.name !== "hf-audio-group") continue;
|
|
1426
|
+
const present = AUDIO_GROUP_TIMING_ATTRS.filter((attr) => hasAttrName(tag.raw, attr));
|
|
1427
|
+
if (present.length === 0) continue;
|
|
1428
|
+
const elementId = readAttr(tag.raw, "id") || void 0;
|
|
1429
|
+
findings.push({
|
|
1430
|
+
code: "audio_group_timing_attrs",
|
|
1431
|
+
severity: "warning",
|
|
1432
|
+
message: `${elementId ? `#${elementId}` : "This audio group"} carries ${present.map((attr) => `\`${attr}\``).join(", ")}, which a bus has no use for \u2014 its members carry the timing and its automation clock is composition time.`,
|
|
1433
|
+
elementId,
|
|
1434
|
+
fixHint: `Remove ${present.map((attr) => `\`${attr}\``).join(", ")} from the group element.`,
|
|
1435
|
+
snippet: truncateSnippet(tag.raw)
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
return findings;
|
|
1439
|
+
}
|
|
1440
|
+
function findAudioGroupCarveAttrFindings(ctx) {
|
|
1441
|
+
const findings = [];
|
|
1442
|
+
for (const tag of ctx.tags) {
|
|
1443
|
+
if (tag.name !== "hf-audio-group") continue;
|
|
1444
|
+
if (!hasAttrName(tag.raw, "data-fx-carve")) continue;
|
|
1445
|
+
const elementId = readAttr(tag.raw, "id") || void 0;
|
|
1446
|
+
findings.push({
|
|
1447
|
+
code: "audio_group_carve_attr",
|
|
1448
|
+
severity: "warning",
|
|
1449
|
+
message: `${elementId ? `#${elementId}` : "This audio group"} carries \`data-fx-carve\`, which belongs on the clip being carved \u2014 a bus has no audio of its own to level-match against, and a carve here stacks with any its members already have.`,
|
|
1450
|
+
elementId,
|
|
1451
|
+
fixHint: "Remove `data-fx-carve` and the `fromCarve` nodes it wrote into this bus's `data-fx-chain`, and carve the bed clip instead.",
|
|
1452
|
+
snippet: truncateSnippet(tag.raw)
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
return findings;
|
|
1456
|
+
}
|
|
1383
1457
|
|
|
1384
1458
|
// src/rules/gsap.ts
|
|
1385
1459
|
async function loadParseGsapScript() {
|