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