fix: resolve all TypeScript strict null check errors
Fix ~68 pre-existing strict null errors across 13 feature modules. Add non-null assertions for DOM element lookups, null coalescing for optional values, and type guards for nullable properties. Zero tsc errors now with --noEmit.
This commit is contained in:
@@ -195,9 +195,9 @@ export function createKCTargetCard(target: OutputTarget & { state?: any; metrics
|
||||
const brightness = kcSettings.brightness ?? 1.0;
|
||||
const brightnessInt = Math.round(brightness * 255);
|
||||
|
||||
const source = sourceMap[target.picture_source_id];
|
||||
const source = sourceMap[target.picture_source_id!];
|
||||
const sourceName = source ? source.name : (target.picture_source_id || 'No source');
|
||||
const patTmpl = patternTemplateMap[kcSettings.pattern_template_id];
|
||||
const patTmpl = patternTemplateMap[kcSettings.pattern_template_id!];
|
||||
const patternName = patTmpl ? patTmpl.name : 'No pattern';
|
||||
const rectCount = patTmpl ? (patTmpl.rectangles || []).length : 0;
|
||||
|
||||
@@ -226,7 +226,7 @@ export function createKCTargetCard(target: OutputTarget & { state?: any; metrics
|
||||
content: `
|
||||
<div class="card-header">
|
||||
<div class="card-title" title="${escapeHtml(target.name)}">
|
||||
${escapeHtml(target.name)}
|
||||
<span class="card-title-text">${escapeHtml(target.name)}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stream-card-props">
|
||||
@@ -617,7 +617,7 @@ export async function showKCEditor(targetId: any = null, cloneData: any = null)
|
||||
// Tags
|
||||
if (_kcTagsInput) _kcTagsInput.destroy();
|
||||
_kcTagsInput = new TagInput(document.getElementById('kc-tags-container'), {
|
||||
placeholder: window.t ? t('tags.placeholder') : 'Add tag...'
|
||||
placeholder: t('tags.placeholder'),
|
||||
});
|
||||
_kcTagsInput.setValue(_editorTags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user